function setFlashObj2(Src,Width,Height,Quality){
	var Target = Src;
if(userEnv.isMac){
	var Target=changefilename_mac(Src);
}
return("<object id='obj' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'codebase='//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='" + Width + "' height='" + Height + "' >"
+ "<param name='movie' value='" + Target + "'>"
+ "<param name='quality' value='" + Quality + "'>"
+ "<param name='menu' value='false'>"
+ "<param name='wmode' value='transparent'>"
+ "<embed id='obj' name='obj' swLiveConnect=true src='" + Target + "' quality='" + Height + "' width='" + Width + "' height='" + Height + "' menu='false' wmode='transparent' pluginspage='//www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash'></embed></object>"
);
}
function setFlashObj(Src,Width,Height,Quality){
	var Target = Src;
if(userEnv.isMac){
	var Target=changefilename_mac(Src);
}
document.write("<object id='obj' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'codebase='//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='" + Width + "' height='" + Height + "' >"
+ "<param name='movie' value='" + Target + "'>"
+ "<param name='quality' value='" + Quality + "'>"
+ "<param name='menu' value='false'>"
+ "<param name='wmode' value='transparent'>"
+ "<embed id='obj' name='obj' swLiveConnect=true src='" + Target + "' quality='" + Height + "' width='" + Width + "' height='" + Height + "' menu='false' wmode='transparent' pluginspage='//www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash'></embed></object>"
);
}
//
function setBaseText(str){
//alert(str);
//var swfbaseMovie = (navigator.appName.indexOf("Microsoft") != -1) ? obj : document.obj;
//var mc = isIE ? window["obj"] : window.document["obj"];
document.obj.SetVariable("_level0.strBase",str);
//swfbaseMovie.SetVariable("_level0.strBase",str);
//document.getElementById("obj").SetVariable("_level0.strBase",str);
//document.getElementById("obj").SetVariable("_level0.strBase", "ieあああ");
};


function changefilename_mac(str){
	var reURL=str.slice("/swf/"+str.lastIndexOf('/')+1,Number(str.length-4))+"_mac.swf";
	return reURL;
	}
//ブラウザ判別
function initUserEnv(){
	this.isWin		= navigator.userAgent.indexOf("Win") != -1 ? true : false;
	this.isMac		= navigator.userAgent.indexOf("Mac") != -1 ? true : false;
	this.isSf		= navigator.userAgent.indexOf("Safari") != -1 ? true : false;
	this.isMoz		= navigator.userAgent.indexOf("Gecko") != -1 ? true : false;
	/*
	this.isNs		= navigator.appName.indexOf("Netscape") != -1 ? true : false;
	this.isNs4		= (document.layers) ? true : false;
	this.isNs4_7	= navigator.userAgent.indexOf("4.7") != -1 ? true : false;
	this.isNs6		= navigator.userAgent.indexOf("Netscape6") != -1 ? true : false;
	this.isNs7		= navigator.userAgent.indexOf("Netscape/7") != -1 ? true : false;
	this.isMoz		= navigator.userAgent.indexOf("Gecko") != -1 ? true : false;
	this.isIe		= navigator.userAgent.indexOf("MSIE") != -1 ? true : false;
	this.isIe4		= navigator.userAgent.indexOf("MSIE 4") != -1 ? true : false;
	this.isIe5		= navigator.userAgent.indexOf("MSIE 5") != -1 ? true : false;
	this.isIe6		= navigator.userAgent.indexOf("MSIE 6") != -1 ? true : false;
	this.isIe7		= navigator.userAgent.indexOf("MSIE 7") != -1 ? true : false;
	this.isOp		= navigator.userAgent.indexOf("Opera") != -1 ? true : false;
	this.isW3CDom	= (document.getElementById) ? true : false;
	this.isMsDom	= (document.all) ? true : false;
	this.isNsDom	= (document.layers) ? true : false;
	this.isDom		= (this.isW3CDom || this.isMsDom || this.isNsDom) ? true : false;
	*/
	return this;
}
var userEnv = new initUserEnv();
//checkBlowser
function checkBlowser(){
	return (userEnv.isW3CDom)? 1:0;
}

function setBaseTextWin(str){
	if(userEnv.isWin){
	//alert("win//"+userEnv.isWin);
	document.obj.SetVariable("_level0.strBaseWin",str);
	}
};

function setBaseTextMac(str){
//	alert(str);
if(userEnv.isMac){
	if(userEnv.isSf){
		//alert("mac//"+userEnv.isMac);
		document.getElementById("obj").SetVariable("_level0.strBaseMac",encodeURI(str));
	}else if(userEnv.isMoz){
		//alert("macFI//"+userEnv.isMac);
		document.obj.SetVariable("_level0.strBaseMac",encodeURI(str));
		//document.getElementById("obj").SetVariable("_level0.strBaseMac",String(str));
		}
	}
};

function setFlashTextObj(Src,Width,Height,Quality){
var Target = Src;
if(userEnv.isMac){
	var Target=changefilename_mac(Src);
}
document.write(
"<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width='" + Width + "' height='" + Height + "' codebase='//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0'>"
+ "<param name='movie' value='" + Target + "'>"
+ "<param name='quality' value='" + Quality + "'>"
+ "<param name='menu' value='false'>"
+ "<embed src='" + Target + "' quality='" + Height + "' width='" + Width + "' height='" + Height + "' menu='false' pluginspage='//www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash'></embed></object>"
);
}
//
function tag_wrapper_open(){document.getElementById("tag_wrapper").className = "visible";}
function tag_wrapper_close(){document.getElementById("tag_wrapper").className = "hidden";}

//

function popUp(Src,Width,Height,Quality,ind,baturank){
	if(userEnv.isMac){
	var Src=changefilename_mac(Src);
}
	msg=new Array();
msg[0]="";
msg[1]="<object id='popp' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width='" + Width + "' height='" + Height + "' codebase='//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0'>"
+ "<param name='movie' value='" + Src + "'>"
+ "<param name='quality' value='" + Quality + "'>"
+ "<param name='menu' value='false'>"
+ "<param name='wmode' value='transparent'>"
+ "<embed swLiveConnect=true id='popp' name='popp' src='" + Src + "' quality='" + Height + "' width='" + Width + "' height='" + Height + "' menu='false' wmode='transparent' pluginspage='//www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash'></embed></object>";

			if(document.all||document.getElementsByTagName('*')){
				//alert(ind);
									document.getElementById("box").innerHTML =msg[ind];
			}else if(document.layers){
       		document.getElementById("box").document.open();
         document.getElementById("box").document.write(msg[ind]);
         document.getElementById("box").document.close();
   }
//
if(typeof(baturank)=='number'){
	BK=baturank;
}else{
	OUBO=baturank;
}

}
//
function foundBatuRank(){
	//alert(BK);
	//var swfpopMovie = (navigator.appName.indexOf("Microsoft") != -1) ? popp : document.popp;
	document.popp.SetVariable("_level0.strCookie", BK);
}
function foundOubo(){
	//alert(BK);
	//var swfpopMovie = (navigator.appName.indexOf("Microsoft") != -1) ? popp : document.popp;
	document.popp.SetVariable("_level0.ouboCookie", OUBO);
}

/*
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"id="movie" width="480" height="360">
<param name=movie value="movie.swf">
<param name="flashvars" value="P=3">
<param name=quality value=high>
<param name=bgcolor value=#FFFFFF>
<embed src="movie.swf" quality=high bgcolor=#FFFFFF width="480" height="360"swLiveConnect=true id="movie" name="movie"type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">
</embed>
</object>*/

function normalFlashObj(Src,Width,Height,Quality){
var Target = Src;
if(userEnv.isMac){
	var Target=changefilename_mac(Src);
}
document.write(
"<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'codebase='//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='" + Width + "' height='" + Height + "' >"
+ "<param name='movie' value='" + Target + "'>"
+ "<param name='quality' value='" + Quality + "'>"
+ "<param name='menu' value='false'>"
+ "<embed src='" + Target + "' quality='" + Height + "' width='" + Width + "' height='" + Height + "' menu='false' pluginspage='//www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash'></embed></object>"
);
}
