
function setVar() {
    var str1 = document.location.toString();
    var str2 = "?count="
    var str3 = "1";
    if (str1.indexOf(str2) > 0) {
      str3 = str1.substring(str1.indexOf(str2) + str2.length);
    }
    var el = thisMovie("cdnet")
    el.setVariable("count", str3);
  }

function getVar() {
    var str1 = document.location.toString();
    var str2 = "?count="
    var str3 = "1";
    if (str1.indexOf(str2) > 0) {
      str3 = str1.substring(str1.indexOf(str2) + str2.length);	  
    }
	return str3;
  }


function thisMovie(movieName) { 
    if (navigator.appName.indexOf("Microsoft") != -1) {
		return getElementByTagAndId("object", movieName);
    }else {
		return getElementByTagAndName("embed", movieName);
    }
}

function getElementByTagAndId(tagName, id){
	var el = null;
	var els = document.getElementsByTagName(tagName);
	for(var i=0 ; i < els.length ; i++){
		if(els[i].id == id) {	el = els[i];	break;	}
	}
	return el;
}

function getElementByTagAndName(tagName, name){
	var el = null;
	var els = document.getElementsByTagName(tagName);
	for(var i=0 ; i < els.length ; i++){
		if(name == "" && i == 0){	el = els[i];	break;	}
		if(els[i].name == name) {	el = els[i];	break;	}
	}
	return el;
}

//Flash init() 
function flashCM(URL,width,height,vars,bgColor,winmode, id) {
	vars='open_num=' + getVar();
	if(bgColor==null) bgColor='transparent';
	if(winmode==null) winmode='opaque';

	document.write("	<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' "); 
	document.write("		width='"+width+"' height='"+height+"' id='"+id+"' align='middle'> ");
	document.write("	<param name='allowScriptAccess' value='always' /> ");
	document.write("	<param name='movie' 						value='"+URL+"' /> ");
	document.write("	<param name='allowFullScreen' 				value='true' /> ");
	document.write("	<param name='FlashVars' 				value='"+vars+"' /> ");
	document.write("	<param name='wmode' 						value='"+winmode+"' /> ");
	document.write("	<param name='menu' 							value='false' /> ");
	document.write("	<param name='quality'						value='high' /> ");
	document.write("	<param name='bgcolor'						value='"+bgColor+"' /> ");
	document.write("	<embed src='"+URL+"' flashVars='"+vars+"' wmode='"+winmode+"' menu='false' quality='high' ");
	document.write("		bgcolor='"+bgColor+"' width='"+width+"' height='"+height+"' name='"+id+"' align='middle' ");
	document.write("		allowScriptAccess='always' allowFullScreen='true' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' /> ");
	document.write("	</object> ");
}

function main()
{
    var param = document.getElementById('country').value;
    location.href   = '/?country=' + param;
}

function menu01_01() 
{
    var param = document.getElementById('country').value;
    location.href   = '/circle/?page_dir=about_us&country=' + param;
}

function menu01_02() 
{
    var param = document.getElementById('country').value;
    location.href   = '/circle/?page_n=our_team&page_dir=about_us&country=' + param;
}

function menu01_03() 
{
    var param = document.getElementById('country').value;
    location.href   = '/circle/?page_n=history&page_dir=about_us&country=' + param;
}

function menu01_04() 
{
    var param = document.getElementById('country').value;
    location.href   = '/circle/?page_n=partners&page_dir=about_us&country=' + param;
}

function menu01_05() 
{
    var param = document.getElementById('country').value;
    location.href   = '/circle/?page_n=contact_us&page_dir=about_us&country=' + param;
}

function menu02_01() 
{
    var param = document.getElementById('country').value;
    location.href   = '/circle/?page_n=3dworld&page_dir=business&country=' + param;
}

function menu02_02() 
{
    var param = document.getElementById('country').value;
    location.href   = '/circle/?page_n=publishing&page_dir=business&country=' + param;
}

function menu02_03() 
{
    var param = document.getElementById('country').value;
    location.href   = '/circle/?page_n=payment&page_dir=business&country=' + param;
}

function menu02_04() 
{
    var param = document.getElementById('country').value;
    location.href   = '/circle/?page_n=service&page_dir=business&country=' + param;
}

function menu03_01() 
{
    var param = document.getElementById('country').value;
    location.href   = '/circle/?page_n=planet&page_dir=contents&country=' + param;
}

function menu04_01() 
{
    var param = document.getElementById('country').value;
    location.href   = '/board/?page_n=notice&page_dir=board&country=' + param;
}

function menu04_02() 
{
    var param = document.getElementById('country').value;
    location.href   = '/board/?page_n=bodo&page_dir=board&country=' + param;
}

function chn_lang() 
{
    location.href   = '/?country=cn';
}

function kor_lang() 
{
    location.href   = '/?country=ko';
}

function eng_lang()
{
    location.href   = '/';
}

