// ロールオーバー関連&nbsp;020711

///// init /////
lastimgname = "";
doflag = false;


///// プリロード /////
function preloadimg(pDir, pArray) {
	fileDir = pDir;
//	preloadcl = new Array();
	preloadhi = new Array();
	var maxnum = pArray.length -1;
	for (i=0; i <= maxnum; i++) {
//		preloadcl[i] = new Image();
//		preloadcl[i].src=(fileDir + pArray[i] + "_cl.gif");
		preloadhi[i] = new Image();
		preloadhi[i].src=(fileDir + pArray[i] + "_hi.gif");
	}
}


///// フラグセット /////
function doflagSet(pState){
	if (doflag != pState) {
		doflag = pState;
		lastimgnamesrc = "";
	}
}


///// mouseOver function /////
function mov(pName,pNameSub) {if (doflag) {
		filename = pName;
		if ("" + pNameSub != "undefined") {lastimgname = eval('document.' + pNameSub)}
		else {lastimgname = eval('document.' + filename)}
		lastimgnamesrc = lastimgname.src;
		theDir = lastimgnamesrc.substring(0, lastimgnamesrc.lastIndexOf("/") +1);
		//alert(theDir);
		lastimgname.src=(theDir + filename + "_hi.gif");
}}


///// mouseDown function /////
function mdo() {if (doflag) {
//		lastimgname.src=(fileDir + filename + "_cl.gif");
}}


///// mouseUp function /////
function mup() {if (doflag) {
		lastimgname.src=lastimgnamesrc;
}}


///// mouseOut function /////
function mou() {if (doflag) {
		if(lastimgnamesrc != "") {lastimgname.src = lastimgnamesrc};
}}


function ccwin(pURL) {
	tbsvball06ccwin = window.open(pURL,'tbsvball06ccwin','height=570,width=640,status=no,resizable=yes,scrollbars=no');
	if (parseInt(navigator.appVersion.charAt(0)) > 3) {
		tbsvball06ccwin.focus();tbsvball06ccwin.focus();tbsvball06ccwin.focus();tbsvball06ccwin.focus();tbsvball06ccwin.focus();
	}
}
///// Language Change function /////
function changeLang(pLang) {
	var myURL = "" + location.href;
	myURL = myURL.split("_j.html")[0];
	myURL = myURL.split(".html")[0];
	//alert(myURL);
	if (myURL.charAt(myURL.length -1) == "/") myURL += "index";
	if (pLang == "ja") {
		location.href = myURL + "_j.html";
	} else {
		location.href = myURL + ".html";
	}
}

///// writeSWF function /////
function noFlash() {
	location.replace("index_noflash.html");
}
function writeSWF(lang) {
document.write('<OBJECT width="100%" height="100%" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#5,0,0,0">');
document.write('<PARAM name="SRC" value="op.swf">');
document.write('<PARAM name="BGCOLOR" value="#000000">');
document.write('<PARAM name="TYPE" value="application/x-shockwave-flash">');
document.write('<PARAM name="SALIGN" value="TL">');
document.write('<PARAM name="menu" value="false">');
document.write('<PARAM name="FlashVars" value="' + lang +'">');
document.write('<PARAM name="wmode" value="opaque" / >');
document.write('<EMBED src="op.swf" width="100%" height="100%" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/" bgcolor="#000000" salign="TL" menu="false" flashvars="'+ lang + '">');
document.write('</EMBED>');
document.write('</OBJECT>');
}
function writeSWF2(w,h,swf,lang) {
document.write('<OBJECT width="' + w +'" height="' + h + '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#5,0,0,0">');
document.write('<PARAM name="SRC" value="' + swf + '">');
document.write('<PARAM name="BGCOLOR" value="#000000">');
document.write('<PARAM name="TYPE" value="application/x-shockwave-flash">');
document.write('<PARAM name="SALIGN" value="TL">');
document.write('<PARAM name="menu" value="false">');
document.write('<PARAM name="FlashVars" value="' + lang + '">');
document.write('<PARAM name="wmode" value="opaque" / >');
document.write('<PARAM NAME="quality" VALUE="high">');
document.write('<EMBED src="' + swf + '" width="' + w + '" height="' + h + '" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/" bgcolor="#000000" salign="TL" menu="false" flashvars="'+ lang + '">');
document.write('</EMBED>');
document.write('</OBJECT>');
}
function writeSWFm(swf,pos) {
document.write('<OBJECT width="200" height="100%" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#5,0,0,0">');
document.write('<PARAM name="SRC" value="' + swf + '">');
document.write('<PARAM name="BGCOLOR" value="#000000">');
document.write('<PARAM name="TYPE" value="application/x-shockwave-flash">');
document.write('<PARAM name="SALIGN" value="TL">');
document.write('<PARAM name="menu" value="false">');
document.write('<PARAM name="FlashVars" value="' + pos +'">');
document.write('<PARAM name="wmode" value="opaque" / >');
document.write('<EMBED src="' + swf + '" width="200" height="100%" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/" bgcolor="#000000" salign="TL" menu="false" flashvars="'+ pos + '">');
document.write('</EMBED>');
document.write('</OBJECT>');
}
function writeSWFm_long(swf,pos) {
document.write('<OBJECT width="185" height="100%" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#5,0,0,0">');
document.write('<PARAM name="SRC" value="' + swf + '">');
document.write('<PARAM name="BGCOLOR" value="#000000">');
document.write('<PARAM name="TYPE" value="application/x-shockwave-flash">');
document.write('<PARAM name="SALIGN" value="TL">');
document.write('<PARAM name="menu" value="false">');
document.write('<PARAM name="FlashVars" value="' + pos +'">');
document.write('<PARAM name="wmode" value="opaque" / >');
document.write('<EMBED src="' + swf + '" width="185" height="100%" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/" bgcolor="#000000" salign="TL" menu="false" flashvars="'+ pos + '">');
document.write('</EMBED>');
document.write('</OBJECT>');
}
function writeSWFmNews(h,swf,pos) {
document.write('<OBJECT width="200" height="' + h + '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#5,0,0,0">');
document.write('<PARAM name="SRC" value="' + swf + '">');
document.write('<PARAM name="BGCOLOR" value="#000000">');
document.write('<PARAM name="TYPE" value="application/x-shockwave-flash">');
document.write('<PARAM name="SALIGN" value="TL">');
document.write('<PARAM name="menu" value="false">');
document.write('<PARAM name="FlashVars" value="' + pos +'">');
document.write('<PARAM name="wmode" value="opaque" / >');
document.write('<EMBED src="' + swf + '" width="200" height="' + h + '" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/" bgcolor="#000000" salign="TL" menu="false" flashvars="'+ pos + '">');
document.write('</EMBED>');
document.write('</OBJECT>');
}





function openWin(pURL,pWidth, pHeight, pSubName) {
	var winName = pSubName ? pSubName :  'vball06ccwin' ;
	tbsvball06ccwin = window.open(pURL,winName,'height='+ pHeight + ',width=' + pWidth + ',status=no,resizable=yes,scrollbars=no');
	if (parseInt(navigator.appVersion.charAt(0)) > 3) {
		tbsvball06ccwin.focus();tbsvball06ccwin.focus();tbsvball06ccwin.focus();tbsvball06ccwin.focus();tbsvball06ccwin.focus();
	}
}
