function flashWrite( id, flashUri, vWidth, vHeight ) {
   var _obj_ = "";

   _obj_ = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="' + vWidth + '" height="' + vHeight + '" id="' + id + '" align="middle">';
	_obj_ += '<param name="movie" value="' + flashUri + '" />';
   _obj_ += '<param name="quality" value="high" />';
   _obj_ += '<param name="wmode" value="transparent" />    ';
	_obj_ += '<param name="menu" value="false" />    ';
   _obj_ += '<param name="bgcolor" value="#ffffff" />        ';
   _obj_ += '<embed src="' + flashUri + '" quality="high" wmode="transparent" bgcolor="#ffffff" width="' + vWidth +'" height="' + vHeight + '" id="' + id + '" align="middle" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></embed>    ';
   _obj_ += '</object>';
   document.writeln( _obj_ );
}

/* page Function  */

function main_game_tab(num){
	var target = document.getElementById("main_game_tab").getElementsByTagName("img")
	for (i=1; i<=3 ;i++ )
	{
		target[i-1].src = target[i-1].src.replace("_on.gif", "_off.gif");
		document.getElementById("main_game_"+i).style.display="none"
	}
		target[num-1].src = target[num-1].src.replace("_off.gif", "_on.gif");
		document.getElementById("main_game_"+num).style.display=""
}

function main_tab_contents(num){
	var target = document.getElementById("main_tab").getElementsByTagName("img")
	for (i=1; i<=2 ;i++ )
	{
		target[i-1].src = target[i-1].src.replace("_on.gif", "_off.gif");
		document.getElementById("main_tab_contents_"+i).style.display="none"
	}
		target[num-1].src = target[num-1].src.replace("_off.gif", "_on.gif");
		document.getElementById("main_tab_contents_"+num).style.display=""
}


var new_page_num = 10000;
function news_btn(num){
	var target = document.getElementById("news_box_list").getElementsByTagName("dl");
	for (i=0; i<target.length ;i++ )
	{
		target[i].style.display="none"
	}
	new_page_num = parseInt(new_page_num,10) + parseInt(num,10);
	target[new_page_num%target.length].style.display=""
}


var main_message_num = 10000;
function main_message_next(num){
	var target = document.getElementById("main_message").getElementsByTagName("div");
	for (i=0; i<target.length ;i++ )
	{
		target[i].style.display="none"
	}
	main_message_num = parseInt(main_message_num,10) + parseInt(num,10);
	target[main_message_num%target.length].style.display = ""
}

function img_big_change(target){
	var bigimg = target.parentNode.parentNode.parentNode.childNodes[0];
	bigimg.getElementsByTagName("img")[0].src =  target.src;
	bigimg.getElementsByTagName("DIV")[0].innerHTML =  target.alt;
	var link = target.parentNode.parentNode.childNodes[0];
	bigimg.getElementsByTagName("a")[0].href = link.href;


}



/* ///////////////////////////////////////////////////////////////////////////////////    */
/* ////////////////////////////////////////////////////////////////////////////    */
/* ///////////////////////////    flash active /////////////////////////////////    */
/* ////////////////////////////////////////////////////////////////////////////    */
/* ////////////////////////////////////////////////////////////////////////////    */
/* ///////////////////////////////////////////////////////////////////////////////    */
/* ////////////////////////////////////////////////////////////////////////////    */

/* sub top flash  */
function navigation(pageNum,subNum){
var name = "/tabletennis/_flash/navigation";
var width = "556";
var height = "81";
if (subNum) subNum = subNum.split("_")[0];
if (pageNum) pageNum = pageNum.split("_")[0];
if (!subNum)subNum = 1;
if (subNum>5)subNum = 0;
document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+width+"' height='"+height+"' id='"+name+"' align='middle'>");
document.write("<param name='allowScriptAccess' value='sameDomain' />");
document.write("<param name='allowFullScreen' value='false' />");
document.write("<param name='movie' value='"+name+".swf?subNum="+subNum+"&pageNum="+pageNum+"' />");
document.write("<param name='quality' value='high' />");
document.write("<param name='wmode' value='transparent' />");
document.write("<param name='bgcolor' value='#ffffff' />");
document.write("<embed src='"+name+".swf?subNum="+subNum+"&pageNum="+pageNum+"' quality='high' wmode='transparent' bgcolor='#ffffff' width='"+width+"' height='"+height+"' name='"+name+"' id='"+name+"' align='middle' allowScriptAccess='sameDomain' allowFullScreen='false' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />");
document.write("</object>");
}


function sub_top_flash(subNum){
	if (!subNum)subNum = 1;
	if (subNum>5)subNum = 5;
var path = "../_flash/sub_top0"+subNum;
var name = "sub_top0"+subNum;
var width = "990";
var height = "345";
document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+width+"' height='"+height+"' id='"+name+"' align='middle'>");
document.write("<param name='allowScriptAccess' value='sameDomain' />");
document.write("<param name='allowFullScreen' value='false' />");
document.write("<param name='movie' value='"+path+".swf' />");
document.write("<param name='quality' value='high' />");
document.write("<param name='wmode' value='transparent' />");
document.write("<param name='bgcolor' value='#ffffff' />");
document.write("<embed src='"+path+".swf' quality='high' wmode='transparent' bgcolor='#ffffff' width='"+width+"' height='"+height+"' name='"+name+"' id='"+name+"' align='middle' allowScriptAccess='sameDomain' allowFullScreen='false' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />");
document.write("</object>");
}
