function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function MM_showHideLayers() { //v6.0
  /*var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }*/
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function showlayers(layerid,tdid){
	var i,layer;
	for(i=1;i<=9;i++){		
		layer = document.getElementById("Layer"+i);
		if (layer != null){
			if (i!=layerid){
				layer.style.visibility = "hidden";
			}else{
				layer.style.visibility = "visible";
			}
		}
	}
	
	i = "a";		
	layer = document.getElementById("Layer"+i);
	if (layer != null){
		if (i!=layerid){
			layer.style.visibility = "hidden";
		}else{
			layer.style.visibility = "visible";
		}
	}
	
	i = "b";		
	layer = document.getElementById("Layer"+i);
	if (layer != null){
		if (i!=layerid){
			layer.style.visibility = "hidden";
		}else{
			layer.style.visibility = "visible";
		}
	}
	
	
	
	layer = document.getElementById("td"+tdid);
	if (layer != null){
		layer.className="menu2_c";
		layer.onmouseover="";
		layer.onmouseout="";
		layer.onclick="";
	}
}
   

function writewelcome(lang,phone){	
			
			var welcome = document.getElementById("welcome");
			
			if (welcome == null) return;
			
			if (lang=="eng"){
				//welcome.innerHTML="Hello,"+phone+"[<a href='#' onclick='logout()'>logout</a>]";
				welcome.innerHTML="Hello,"+phone+"[<a href='javascript:websitelogout();'>logout</a>]";
			}else{
				//welcome.innerHTML="&#x60a8;&#x597d;,"+phone+"[<a href='#' onclick='logout()'>&#x767b;&#x51fa;</a>]";
				welcome.innerHTML="&#x60a8;&#x597d;,"+phone+"[<a href='javascript:websitelogout();'>&#x767b;&#x51fa;</a>]";
			}
		}

		
		function websitelogout(){
			if (lang=="eng"){
				alert("SECURITY NOTICE\n\nTo complete your logout process, please close all browser windows and exit the browser application to prevent retrieval of cached copies of secured web-pages visited. For maximum protection, you should also clear the browser cache.");
				//location.href="https://apps.three.com.hk/appCS/eng/processlogout.jsp?lang=eng";
				location.href="https://www.three.com.hk/appCS2/eng/processlogout.jsp?lang=eng";
			}else{
				alert("\u5b89\u5168\u544a\u793a \r\n \u70ba\u9632\u6b62\u95a3\u4e0b\u66fe\u7d93\u95b1\u89bd\u7684\u7db2\u9801\u88ab\u4eba\u5f9e\u5099\u4efd\u4e2d\u6aa2\u7d22\uff0c\u8acb\u95dc\u9589\u6240\u6709\u700f\u89bd\u5668\u8996\u7a97\uff0c\u53ca\u9000\u51fa\u700f\u89bd\u5668\u7684\u61c9\u7528\uff0c\u4ee5\u5b8c\u6210\u4e00\u5207\u7684\u767b\u51fa\u7a0b\u5e8f\u3002\u70ba\u4f7f\u8cc7\u6599\u5f97\u5230\u6700\u4f73\u7684\u4fdd\u8b77\uff0c\u95a3\u4e0b\u4ea6\u61c9\u6e05\u9664\u700f\u89bd\u5668\u5132\u5b58\u5eab\u3002");
				//location.href="https://apps.three.com.hk/appCS/chi/processlogout.jsp?lang=chi";
				location.href="https://www.three.com.hk/appCS2/chi/processlogout.jsp?lang=chi";
			}
		}

	function hidden3gor2g(num){
		var layer;		
		layer = document.getElementById("3gimg2");
		if (layer != null){
			layer.style.display = "none";
		}					 
		for(var i=1;i<10;i++){
			 layer = document.getElementById(num+"g"+i);
			 if (layer == null){
			 	break;
			 }		
			 layer.style.display = "none";
		}
		
	}	
	
	
	function checksearchForm(lang){
		var queryObj = document.getElementById("ipRetrievalmQuery");
		if (queryObj == null) return;
		var querytext = queryObj.value;	
		if (querytext == ""){
			if (lang == "chi"){
				alert("\u8acb\u8f38\u5165\u60a8\u8981\u641c\u5c0b\u7684\u503c");
				queryObj.focus();
			}else{
				alert("Please input search key");
				queryObj.focus();
			}
		}else{   
			document.searchForm.action="/website/appmanager/three/home?_nfpb=true&_pageLabel=P200370391219567595812&ipRetrievalmMethod=submitquery&ipRetrievalmSortBy=Relevance&lang="+lang;
			document.searchForm.submit();
		}	
		//document.location.href="/website/appmanager/three/home?_nfpb=true&_pageLabel=P200370391219567595812&lang="+lang+"&ipRetrievalmMethod=submitquery&ipRetrievalmStart=1&ipRetrievalmQuery="+querytext+"&ipRetrievalmSortBy=Relevance";
		
	}		

////////////////////////IDD left menu///////////////////////

function Extend(level)
{
	var obj,img;
	//eval('obj=document.all.tdMenu'+level);
	obj = document.getElementById("tdMenu"+level);
	if(obj!=null){
		obj.style.display='block';
		//eval('img=document.all.img_lab'+level);
		img = document.getElementById("img_lab"+level);
		img.src='/website//ShowProperty//cmrep/iddroaming/idd/images/icon_c1_m04y.gif';
	}
}

function sitem(levelid,css)
{ var obj;
  //eval('obj=document.all.level'+levelid);
  obj = document.getElementById("level"+levelid);
  if(obj!=null){
	  obj.className=css;
	  obj.onmouseover="";
	  obj.onmouseout="";
	  
  }
 }
 
 function Sitemstyle(level) {
	 var obj;
	 var select_css='menu3_c';
	 if(level.length==6){
		 level=level.substring(2,4);
		} 
	if(level.length!=4){
		//alert('LevelID error : '+level+' \r\nPls input correct levelID!'); 
		return;
	}
	if(level.charAt(3)=='0' ){
		for(var i=0;i<2;i++)
		{
			if(level.charAt(i+1)=='0'){break;} 
			Extend(level.substring(0,i+1));
		} 
		sitem(level.substring(0,3),select_css); //add by kelun 090115
	}else{
		for(var i=0;i<2;i++){
			if(level.charAt(i+1)=='0'){break;}
			Extend(level.substring(0,i+1));
		}
		sitem(level.substring(0,3),select_css);
	}
}
//////////////////////////IDD LEFT MENU///////////////////////////////

//////////////////////3g/2g/////////////////////////////////////////////
 
 
 function show2g3g(level){
 /*
 var obj2g=document.all.img2g;
 var obj2gcontent=document.all.content2g;
 var obj3g=document.all.img3g;
 var obj3gcontent=document.all.content3g;
 var obj2g3gstyle=document.all.style2g3g;
 */
 var obj2g=document.getElementById("img2g");
 var obj2gcontent=document.getElementById("content2g");
 var obj3g=document.getElementById("img3g");
 var obj3gcontent=document.getElementById("content3g");
 var obj2g3gstyle=document.getElementById("style2g3g");
 if(obj2g!=null&&obj2gcontent!=null && obj3g!=null&& obj3gcontent!=null && obj2g3gstyle!=null){
	var path=obj2g.src.substring(0,obj2g.src.lastIndexOf("/"));
	
 	if(level=='3g'){
//icon_2g.gif; icon_3g.gif; icon_2g_c.gif; icon_3g_c.gif	
	  obj2g.src=path+'/icon_2g.gif';
	  obj3g.src=path+'/icon_3g_c.gif';
	  obj3gcontent.style.display='block';
	  obj2gcontent.style.display='none';	  
	  obj2g3gstyle.className='bg_3g';	
	}
	else if(level=='2g'){
	  obj2g.src=path+'/icon_2g_c.gif';
	  obj3g.src=path+'/icon_3g.gif';
	  obj3gcontent.style.display='none';
	  obj2gcontent.style.display='block';
	  obj2g3gstyle.className='bg_2g';	
	}
  }
 }
 
function Extend2g3g(level){ 
var obj;
var obj2g;
var obj3g;

/*eval('obj=document.all.mobtype_'+level);
obj2g=document.all.mobtype_2g;
obj3g=document.all.mobtype_3g;
*/
obj = document.getElementById("mobtype_"+level);
obj2g = document.getElementById("mobtype_2g");
obj3g = document.getElementById("mobtype_3g");

 if(obj!=null){
 if(obj2g!=null){obj2g.style.display='none';}
 if(obj3g!=null){obj3g.style.display='none'; }
 obj.style.display='block';
	  show2g3g(level);
 }
 else{ return; }
 } 

 //////////////////////3g/2g/////////////////////////////////////////////
 
 ///merge table row and cell
 function processtable(table,rows,colmerge,rowmerge){
		var tableobj;		

		tableobj = document.getElementById(table);	
		

		if (tableobj != null){
					
			
			var rowmerges = rowmerge.split(",");  // like this 1:3:2,4:2:3
			var colmerges = colmerge.split(","); // like this 1:2:4,4:3:4
			//merge col first
			var row;
			var startcol,endcol;
			var siglecolmerge;
			var siglecolmerges;
			
			if (colmerges != ""){
				for (var col=0;col<colmerges.length;col++){
					siglecolmerge = colmerges[col]; //like this 1:2:4
					siglecolmerges = siglecolmerge.split(":");
					row = siglecolmerges[0]; // like this 1				
					startcol = siglecolmerges[1];  //equals 2
					endcol = siglecolmerges[2];    // equals 4
					
					var cols = 1;
					var subcol;
					for(subcol=endcol-1;subcol>=startcol;subcol--){
						tableobj.rows[row].deleteCell(subcol);								
						cols++;				
					}
					tableobj.rows[row].cells[subcol].colSpan = cols;						
				}
			}
		
		
			/*row merge */	
			var singlerowmerge;
			var singlerowmerges;
			var therow;
			var thecol;
			var mergerow;
			if (rowmerges !=""){
				for (row=0;row<rowmerges.length;row++){
			
					singlerowmerge = rowmerges[row]; //like this 1:3:2
					singlerowmerges = singlerowmerge.split(":");
					therow = singlerowmerges[0]; // like this 1			
					//singlerowmerges = singlerowmerges[1].split(":"); //like this 2:4
					thecol = singlerowmerges[1];  //equals 2
					thecol--;
					mergerow = singlerowmerges[2];    // equals 4
					var cols = 1;
					var subrow;			
					for(subrow=parseInt(mergerow)+parseInt(therow);subrow>therow;subrow--){				
						tableobj.rows[subrow].deleteCell(thecol);		
						cols++;
					}
					tableobj.rows[therow].cells[thecol].rowSpan = cols;						
				}
			}
		
			rows = rows.split(",");
			rowslength = rows.length-1
			var havein = 0;
			if (rowslength>0){
				for(row=tableobj.rows.length-1;row>0;row--){
					for(var subrow=rowslength;subrow>=0;subrow--){				
						if (rows[subrow]==row){					
							havein = 1;
							rowslength--;
						}
					}
					if (havein == 0){
						tableobj.deleteRow(row);				
					}
					havein = 0;
				}
			}				
		}				
	}

function checkbrowser() {
	var appname = navigator.appName;
	var useragent = navigator.userAgent;
	var dflag=false;
	//20091125 revised
	//if (appname != 'Microsoft Internet Explorer') {
	//	dflag = true;
	//}

	//if (dflag == true) {	
	//    alert('\u5b89\u5168\u544a\u793a\r\n\u70ba\u78ba\u4fdd\u7528\u6236\u7684\u8cc7\u6599\u80fd\u5920\u5f97\u5230\u66f4\u4f73\u7684\u4fdd\u969c\uff0c\u7528\u6236\u7957\u53ef\u4f7f\u7528\u5fae\u8edf\u56e0\u7279\u7db2\u63a2\u7d22\u8005\u700f\u89bd\u5668(Microsoft Internet Explorer)\u4ee5\u767b\u51653\u9999\u6e2f\u7684\u7db2\u4e0a\u5728\u7dda\u5ba2\u6236\u670d\u52d9\u3002');
		//document.websiteloginbox.websitemobileno.value = '';
    	//document.websiteloginbox.websitepassword.value = '';
	    //document.websiteloginbox.websitemobileno.disabled = true;
    	//document.websiteloginbox.websitepassword.disabled = true;
	//}
}


function isInteger(str)
{

  for(var i=0; i<str.length; i++) {
    var c = str.charAt(i);
    if( !(c>='0' && c<='9'))
      return false;
  }
  return true;
}


function isWhitespace(str)
{

  for(var i=0; i<str.length; i++) {

    var c = str.charAt(i);

    if( c!=' ' && c!='\n' && c!='\t' )

      return false;

  }

  return true;

}

function checkWebsiteLoginForm(lang) {
	
  	checkbrowser();

		var loginbox = document.getElementById("websiteloginbox");

		var mobileno = document.getElementById("websitemobileno").value;

		var passwords = document.getElementById("websitepassword").value;

		//check if nettype radio button exist or not
		var hasNetType = false;
		if (document.forms['websiteloginbox'].websitetype != null){
			hasNetType = true;
		}

		//var action3 = "https://apps.three.com.hk/appCS/"+lang+"/checkgnSSO.jsp?URLTo=http%3A%2F%2Fwww.three.com.hk%2Fwebsite%2F%2Fappmanager%2Fthree%2Fhome%3F_nfpb%3Dtrue%26pageid%3D000001%26_pageLabel%3DP200170391219567376547%26lang%3D"+lang;

		//var action3 = "https://apps.three.com.hk/appCS/"+lang+"/checkgnSSO.jsp?URLTo=http%3A%2F%2Fwww.three.com.hk%2Fwebsite%2Fappmanager%2Fthree%2Fhome%3F_nfpb%3Dtrue%26pageid%3D000001%26_pageLabel%3DP200170391219567376547%26lang%3D"+lang;
		var action3 = "https://www.three.com.hk/appCS2/verifyLogin.do?action=login&lang="+lang+"&URLTo=http%3A%2F%2Fwww.three.com.hk%2Fwebsite%2Fappmanager%2Fthree%2Fhome%3F_nfpb%3Dtrue%26pageid%3D000001%26_pageLabel%3DP200170391219567376547%26lang%3D"+lang;
		//var actionsva  = "http://dualband.three.com.hk/appCS/chi/processlogin_sva.jsp?URLTo=http%3A%2F%2Fwww.three.com.hk%2Fwebsite%2F%2Fappmanager%2Fthree%2Fhome%3F_nfpb%3Dtrue%26pageid%3D000001%26_pageLabel%3DP200170391219567376547%26lang%3D"+lang;

		var actionsva  = "https://203.184.147.72/appCS/"+lang+"/processlogin_sva_test.jsp?URLTo=http%3A%2F%2Fwww.three.com.hk%2Fwebsite%2Fappmanager%2Fthree%2Fhome%3F_nfpb%3Dtrue%26pageid%3D000001%26_pageLabel%3DP200170391219567376547%26lang%3D"+lang;
		//var actionsva = "/appCS2/verifyLogin.do?action=login&URLTo=http%3A%2F%2Fwww.three.com.hk%2Fwebsite%2Fappmanager%2Fthree%2Fhome%3F_nfpb%3Dtrue%26pageid%3D000001%26_pageLabel%3DP200170391219567376547%26lang%3D"+lang;
		

    if( isWhitespace(mobileno) || !isInteger(mobileno) || isWhitespace(passwords) || mobileno.length<8){
      		alert("Please enter both mobile number and password correctly");
		}else{
			if (hasNetType){
	      		//if (document.forms['websiteloginbox'].websitetype[0].checked) {
						//  loginbox.action = action3;
      			//}
      			//if (document.forms['websiteloginbox'].websitetype[1].checked) {
		  			//	loginbox.action = actionsva;
	      		//}
				if (document.forms['websiteloginbox'].websitetype[1].checked) {
					loginbox.action = actionsva;
				}else{
					loginbox.action = action3;
				}
			}else{
				loginbox.action = action3;
			}

			loginbox.submit();
    }

}

function checkappCS2LoginForm() {
	
		checkbrowser();

		var loginbox = document.getElementById("appCS2Login");

		var mobileno = document.getElementById("appCS2Mobileno").value;

		var passwords = document.getElementById("appCS2Password").value;

		//check if nettype radio button exist or not

		//var action3 = "https://apps.three.com.hk/appCS/"+lang+"/checkgnSSO.jsp?URLTo=http%3A%2F%2Fwww.three.com.hk%2Fwebsite%2F%2Fappmanager%2Fthree%2Fhome%3F_nfpb%3Dtrue%26pageid%3D000001%26_pageLabel%3DP200170391219567376547%26lang%3D"+lang;

		//var action3 = "https://apps.three.com.hk/appCS/"+lang+"/checkgnSSO.jsp?URLTo=http%3A%2F%2Fwww.three.com.hk%2Fwebsite%2Fappmanager%2Fthree%2Fhome%3F_nfpb%3Dtrue%26pageid%3D000001%26_pageLabel%3DP200170391219567376547%26lang%3D"+lang;
		//var action3 = "/appCS2/verifyLogin.do?action=login&URLTo=http%3A%2F%2Fwww.three.com.hk%2Fwebsite%2Fappmanager%2Fthree%2Fhome%3F_nfpb%3Dtrue%26pageid%3D000001%26_pageLabel%3DP200170391219567376547%26lang%3D"+lang;
		//var actionsva  = "http://dualband.three.com.hk/appCS/chi/processlogin_sva.jsp?URLTo=http%3A%2F%2Fwww.three.com.hk%2Fwebsite%2F%2Fappmanager%2Fthree%2Fhome%3F_nfpb%3Dtrue%26pageid%3D000001%26_pageLabel%3DP200170391219567376547%26lang%3D"+lang;

		//var actionsva  = "http://dualband.three.com.hk/appCS/"+lang+"/processlogin_sva.jsp?URLTo=http%3A%2F%2Fwww.three.com.hk%2Fwebsite%2Fappmanager%2Fthree%2Fhome%3F_nfpb%3Dtrue%26pageid%3D000001%26_pageLabel%3DP200170391219567376547%26lang%3D"+lang;

    if( isWhitespace(mobileno) || !isInteger(mobileno) || isWhitespace(passwords) || mobileno.length<8){
      	alert("Please enter both mobile number and password correctly");
	}else{
		//loginbox.action = action3;
		loginbox.submit();
    }

}


function openWindow(url,name,width,height){
	window.open(url,name,"width="+width+",heigth="+height+",resizable=yes");
}


///// promotion  switch pic///
nereidFadeObjects = new Object();
nereidFadeTimers = new Object();
function nereidFade(object, destOp, rate, delta){
if (!document.all)
return
    if (object != "[object]"){  //do this so I can take a string too
        setTimeout("nereidFade("+object+","+destOp+","+rate+","+delta+")",0);
        return;
    }
    clearTimeout(nereidFadeTimers[object.sourceIndex]);
    diff = destOp-object.filters.alpha.opacity;
    direction = 1;
    if (object.filters.alpha.opacity > destOp){
        direction = -1;
    }
    delta=Math.min(direction*diff,delta);
    object.filters.alpha.opacity+=direction*delta;
    if (object.filters.alpha.opacity != destOp){
        nereidFadeObjects[object.sourceIndex]=object;
        nereidFadeTimers[object.sourceIndex]=setTimeout("nereidFade(nereidFadeObjects["+object.sourceIndex+"],"+destOp+","+rate+","+delta+")",rate);
    }
}

var SmallWay = {}
SmallWay.Clear = function(DataType ,DataThis, DataTime, DataInterval){
	var HaShowId = parseInt(Math.random() * 10000000)
	DataThis.setAttribute("SmallWay_Show_Id", HaShowId)
	
	var HaInterval = ( !isNaN(DataInterval) ) ? parseInt(DataInterval) : 10
	var HaTime = ( !isNaN(DataTime) ) ? parseInt(DataTime) : 1000
													   
	var HaOpacity = DataThis.getAttribute("SmallWay_Show_OpacityId")
	if ( HaOpacity == null ) {
		HaOpacity = ( DataThis.style.display != "none" ) ? 100 : 0
		DataThis.style.filter = "Alpha(Opacity=" + HaOpacity + ")"
		DataThis.style.cssText = DataThis.style.cssText.replace(/;-moz-opacity:.*?;/gi, "") + ";-moz-opacity:" + (HaOpacity / 100)
	}
	HaOpacity = ( DataThis.style.display != "none" ) ? HaOpacity : 0
	HaOpacity = ( !isNaN(HaOpacity) ) ? (HaTime / HaInterval) * (parseInt(HaOpacity) / 100) : 0
	
	eval("SmallWay.ThisData_" + HaShowId + " = DataThis")
	
	if ( DataType ) {
		DataThis.style.display = "block"
		for ( var i = HaOpacity; i <= HaTime / HaInterval; i++ ){
			window.setTimeout(
				""
				+	"var HaThis = SmallWay.ThisData_" + HaShowId + "\n"
				+	"if ( HaThis != null ) {\n"
				+		"if ( HaThis.getAttribute(\"SmallWay_Show_Id\") == \"" + HaShowId + "\" ) {\n"
				+			"HaThis.style.filter = \"Alpha(Opacity=" + (100 / (HaTime / HaInterval) * i) + ")\"\n"
				+			"HaThis.style.cssText = HaThis.style.cssText.replace(/;-moz-opacity:.*?;/gi, \"\") + \";-moz-opacity:" + (1 / (HaTime / HaInterval) * i) + "\"\n"
				+			"HaThis.setAttribute(\"SmallWay_Show_OpacityId\", " + (100 / (HaTime / HaInterval) * i) + ")\n"
				+		"}\n"
				+	"}\n"
			, HaInterval * (i - HaOpacity))
		}
		window.setTimeout(
		""
		+	"SmallWay.ThisData_" + HaShowId + " = null\n"
		+	"delete SmallWay.ThisData_" + HaShowId + "\n"
		, HaInterval * (i - HaOpacity))
	}else{
		for ( var i = HaOpacity; i >= 0; i-- ){
			window.setTimeout(
				""
				+	"var HaThis = SmallWay.ThisData_" + HaShowId + "\n"
				+	"if ( HaThis != null ) {\n"
				+		"if ( HaThis.getAttribute(\"SmallWay_Show_Id\") == \"" + HaShowId + "\" ) {\n"
				+			"HaThis.style.filter = \"Alpha(Opacity=" + (100 / (HaTime / HaInterval) * i) + ")\"\n"
				+			"HaThis.style.cssText = HaThis.style.cssText.replace(/;-moz-opacity:.*?;/gi, \"\") + \";-moz-opacity:" + (1 / (HaTime / HaInterval) * i) + "\"\n"
				+			"HaThis.setAttribute(\"SmallWay_Show_OpacityId\", " + (100 / (HaTime / HaInterval) * i) + ")\n"
				+		"}\n"
				+	"}\n"
			, (HaOpacity - i) * HaInterval)
		}
		window.setTimeout(
		""
		+	"var HaThis = SmallWay.ThisData_" + HaShowId + "\n"
		+	"if ( HaThis != null ) {\n"
		+		"if ( HaThis.getAttribute(\"SmallWay_Show_Id\") == \"" + HaShowId + "\" ) {\n"
		+			"HaThis.style.display = \"none\""

		+		"}\n"
		+	"}\n"
		+ "SmallWay.ThisData_" + HaShowId + " = null\n"
		+ "delete SmallWay.ThisData_" + HaShowId + "\n"
		, (HaOpacity - i) * HaInterval)

	}
}
////////////////////////////

//Show and Hide content function --add by alex 2008-10-13
function showcontent(div1){
 target = document.getElementById(div1);
 targetstatus = target.style.display.toString();
 if(targetstatus == "none"){
  target.style.display = "inline";
 }
 else
  target.style.display = "none"
}
////////////////////////////
/////home page icon redirect
function localicon(i,lang){
  var cookiestr= document.cookie;	
   if(cookiestr==null){cookiestr="";}
	//alert(cookiestr);
	if(cookiestr.indexOf("NetType=3")>1)	{
 	  if(i==3){
	  	if(lang.indexOf("chi")>=0)
		  document.location="https://apps.three.com.hk/appCS/cs?actionName=authorized.CheckBillAction&lang=chi";
		 else
		  document.location="https://apps.three.com.hk/appCS/cs?actionName=authorized.CheckBillAction&lang=eng" ;	
	  }else if(i==4){
	  	if(lang.indexOf("chi")>=0)
		  document.location="https://apps.three.com.hk/appCS/chi/ebill_front.jsp";
		 else
		  document.location="https://apps.three.com.hk/appCS/eng/ebill_front.jsp" ;	
	  }
    }else{
 	  if(i==3){
		 if(lang.indexOf("chi")>=0)
		  document.location="https://dualband.three.com.hk/appCS/cs?actionName=authorized.CheckBillAction&lang=eng&xserv=twoserver&xapp=website&xtype=d";
		 else
		  document.location="https://dualband.three.com.hk/appCS/cs?actionName=authorized.CheckBillAction&lang=eng&xserv=twoserver&xapp=website&xtype=d" ;
	  }else if(i==4){
	   	if(lang.indexOf("chi")>=0)
		  document.location="https://dualband.three.com.hk/appCS/chi/ebill_front.jsp?xserv=twoserver&xapp=website&xtype=d";
		 else
		  document.location="https://dualband.three.com.hk/appCS/eng/ebill_front.jsp?xserv=twoserver&xapp=website&xtype=d" ;	
	  }
    }  
}


	//****************************exchange chinese or english*********************************//
	function websiteswitchlang(tolan){
		var thishref = top.location.href;
		
  		if (thishref.indexOf('lang=eng')<0 && thishref.indexOf('lang=chi')<0 && thishref.indexOf('eng')<0 && thishref.indexOf('chi')<0) {
  			  if (thishref.indexOf('?')<0 && thishref.indexOf('%3F')<0) {
       			 thishref=thishref+'?lang='+tolan;
   			 } else {
       			 thishref=thishref+'&lang='+tolan;
    		}
  		}
  		
  		if (thishref.indexOf('lang%3Deng')<0 && thishref.indexOf('lang%3Dchi')<0 && thishref.indexOf('eng')<0 && thishref.indexOf('chi')<0) {
  			  if (thishref.indexOf('?')<0 && thishref.indexOf('%3F')<0) {
       			 thishref=thishref+'?lang='+tolan;
   			 } else {
       			 thishref=thishref+'&lang='+tolan;
    		}
  		}
  		
  		if (tolan == 'eng') {    		
    		thishref=thishref.replace(/lang=chi/g,"lang=eng");
			thishref=thishref.replace(/lang%3Dchi/g,"lang%3Deng");
			thishref=thishref.replace(/%2Fchi%2F/g,"%2Feng%2F");
			thishref=thishref.replace(/\/chi\//g,"/eng/");
			thishref=thishref.replace(/l=chi/g,"l=eng");
    		  		
  		} else {   


			thishref=thishref.replace(/lang=eng/g,"lang=chi");
			thishref=thishref.replace(/lang%3Deng/g,"lang%3Dchi");  
			thishref=thishref.replace(/%2Feng%2F/g,"%2Fchi%2F");  
			thishref=thishref.replace(/\/eng\//g,"/chi/");
			thishref=thishref.replace(/l=eng/g,"l=chi");
  		}
		
		top.location.href=thishref;
	}	

function getChannel(pageid,lang){      
   if (pageid ==""){
     return "";
   }      
      
   if (pageid == "0")return "Home"; 
   if (pageid == "1")return "Handsets&Devices"; 
   if (pageid == "2")return "Tariff Plan";
   if (pageid == "3")return "Planet3";
   if (pageid == "4")return "MobileBroadband";
   if (pageid == "5")return "IDD&Roaming";
   if (pageid == "6")return "Prepaid SIM";
   if (pageid == "7")return "SocialKing";
   if (pageid == "8")return "i-mode";
   if (pageid == "9")return "Business";
   if (pageid == "a")return "Traveler";
   if (pageid == "b")return "3Care";
      
}
 
	
function showHidetd(id){

	var varid = document.getElementById("varid"+id);
	var trid = document.getElementById("tr"+id);
	if(trid.style.display=="")
	{
		trid.style.display="none";
		varid.src="/website//ShowProperty//cmrep/theme/appCS2/images/icon_c1_m04.gif";
		}
	else
	{
		trid.style.display="";
		varid.src="/website//ShowProperty//cmrep/theme/appCS2/images/icon_c1_m04c.gif";
	}
	return;
}