//Flash Streaming
function goMenu(url) {

  if (url == "1_1") {
    location.href = "Silverlight.htm?count=1";
  } else if (url == "1_2") {
    location.href = "mediadown.htm?count=1";
  } else if (url == "1_3") {
    location.href = "aquaplayer.htm?count=1";
  } else if (url == "1_4") {
	location.href = "Silverlight.htm?count=2";
  } else if (url == "1_5") {
	location.href = "mediadown.htm?count=1";
  } else if (url == "1_6") {
	location.href = "security.htm?count=1";
  } else if (url == "1_7") {
	location.href = "Silverlight.htm?count=3";
  } else if (url == "1_8") {
	location.href = "hybrid.htm?count=1";
  } else if (url == "1_9") {
	location.href = "security.htm?count=3";
  }
  
  //Silverlight
    else if (url == "2_1") {
	location.href = "flashS.htm?count=1";
  } else if (url == "2_2") {
	location.href = "aquaplayer.htm?count=1";
  } else if (url == "2_3") {
	location.href = "aquaplayer.htm?count=1";
  } else if (url == "2_4") {
	location.href = "flashS.htm?count=2";
  } else if (url == "2_5") {
	location.href = "mediadown.htm?count=1";
  } else if (url == "2_6") {
	location.href = "security.htm?count=1";
  } else if (url == "2_7") {
	location.href = "flashS.htm?count=3";
  } else if (url == "2_8") {
	location.href = "hybrid.htm?count=1";
  } else if (url == "2_9") {
	location.href = "security.htm?count=3";
  } 

	//File Delivery
    else if (url == "3_1") {
	location.href = "flashS.htm?count=2";
  } else if (url == "3_2") {
	location.href = "WA.htm?count=1";
  } else if (url == "3_3") {
	location.href = "aquadownloader.htm?count=1";
  } else if (url == "3_4") {
	location.href = "Silverlight.htm?count=2";
  } else if (url == "3_5") {
	location.href = "WA.htm?count=1";
  } else if (url == "3_6") {
	location.href = "aquadownloader.htm?count=1";
  } 
  
	//WA
    else if (url == "4_1") {
	location.href = "flashS.htm?count=1";
  } else if (url == "4_2") {
	location.href = "hybrid.htm?count=1";
  } else if (url == "4_3") {
	location.href = "saas.htm?count=1";
  } 

    //BA
    else if (url == "5_1") {
	location.href = "flashS.htm?count=1";
  } else if (url == "5_2") {
	location.href = "WA.htm?count=1";
  } else if (url == "5_3") {
	location.href = "download.htm?count=2";
  } 

	//Hybrid streaming
	else if (url == "6_1") {
	location.href = "Silverlight.htm?count=2";
  } else if (url == "6_2") {
	location.href = "flashS.htm?count=2";
  } else if (url == "6_3") {
	location.href = "aquaplayer.htm?count=1";
  }

	//Media Download
	else if (url == "7_1") {
	location.href = "flashS.htm?count=1";
  } else if (url == "6_2") {
	location.href = "Silverlight.htm?count=1";
  } else if (url == "6_3") {
	location.href = "aquaplayer.htm?count=1";
  }

  	//SaaS
	else if (url == "8_1") {
	location.href = "WA.htm?count=1";
  } else if (url == "8_2") {
	location.href = "Silverlight.htm?count=1";
  } else if (url == "8_3") {
	location.href = "flashS.htm?count=3";
  } else if (url == "8_4") {
	location.href = "WA.htm?count=1";
  } else if (url == "8_5") {
	location.href = "saas.htm?count=1";
  } else if (url == "8_6") {
	location.href = "download.htm?count=1";
  }
  
    //Media Player
	else if (url == "9_1") {
	location.href = "security.htm?count=1";
  } else if (url == "9_2") {
	location.href = "security.htm?count=2";
  } else if (url == "9_3") {
	location.href = "security.htm?count=3";
  } else if (url == "9_4") {
	location.href = "security.htm?count=1";
  } else if (url == "9_5") {
	location.href = "security.htm?count=2";
  } else if (url == "9_6") {
	location.href = "security.htm?count=3";
  }

    //Filie Downloader
	else if (url == "10_1") {
	location.href = "download.htm?count=1";
  } else if (url == "10_2") {
	location.href = "download.htm?count=2";
  } else if (url == "10_3") {
	location.href = "WA.htm?count=1";
  }

    //Media security
	else if (url == "11_1") {
	location.href = "flashS.htm?count=2";
  } else if (url == "11_2") {
	location.href = "Silverlight.htm?count=3";
  } else if (url == "11_3") {
	location.href = "aquaplayer.htm?count=1";
  } else if (url == "11_4") {
	location.href = "flashS.htm?count=2";
  } else if (url == "11_5") {
	location.href = "Silverlight.htm?count=2";
  } else if (url == "11_6") {
	location.href = "aquaplayer.htm?count=1";
  } else if (url == "11_7") {
	location.href = "flashS.htm?count=2";
  } else if (url == "11_8") {
	location.href = "Silverlight.htm?count=2";
  } else if (url == "11_9") {
	location.href = "aquaplayer.htm?count=1";
  }
}


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> ");
}
