var imgLang;
var swfPref="";

cook=document.cookie.split(";");
imgLang="global";

for(x=0;x<cook.length;x++)
{
	a=cook[x].split(".");
	if(a[0].indexOf("lang") != -1)
	{
		imgLang=a[0].split("=")[1];
	}
}
	
//var apac="au,in,id,jp,my,nz,pk,ph,sg,tw,th,vn,ap".split(",");
var apac="th,au,in,id,my,nz,pk,ph,sg,tw,vn,ap,hu,hk,pt".split(",");
for(x=0;x<apac.length;x++)
{
	if(imgLang==apac[x])
	{
		swfPref="apac/";
	}
}

//var ch="cn,hk,hk-en".split(",");
var ch="cn,hk,hk-en".split(",");
for(x=0;x<ch.length;x++)
{
	if(imgLang==ch[x])
	{
		swfPref="ch/";
	}
}

var MM_contentVersion = 6;
var MM_FlashCanPlay;

var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	    for (var i = 0; i < words.length; ++i)
	    {
		if (isNaN(parseInt(words[i])))
		continue;
		var MM_PluginVersion = words[i]; 
	    }
	MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
   && (navigator.appVersion.indexOf("Win") != -1)) {
	document.write('<scr' + 'ipt language=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
	document.write('on error resume next \n');
	document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
	document.write('</scr' + 'ipt\> \n');
}


function playSpin()
{
	if(MM_FlashCanPlay)
	{
		var theFlashStr="";
		theFlashStr+='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" width="750" height="600" id="flashSpinMovie" >';
		theFlashStr+='<param name="movie" value="swf/'+swfPref+'fadein.swf" />';
		theFlashStr+='<param name="quality" value="high" />';
		theFlashStr+='<param name="bgcolor" value="#ffffff"/>';
		theFlashStr+='<param name="wmode" value="transparent"/>';
		theFlashStr+='<embed src="swf/'+swfPref+'fadein.swf" quality="high" bgcolor="#ffffff" wmode="transparent" width="750" height="600" name="flashSpinMovie" align="" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>';
		theFlashStr+='</object>';
		
		document.getElementById("flashSpin").style.width="750px";
		document.getElementById("flashSpin").style.height="600px";
		document.getElementById("flashSpin").style.visibility="visible";
		document.getElementById("flashSpin").innerHTML=theFlashStr;
	} else {
		loadNew();
	}
}

function loadNew()
{
	//alert("loadNew() called");
	document.location="phone_home.aspx?doIntro=true";
}