self.name="yesasia_main";
var bType //0=none, 1=ns4, 2=ns6, 3=ie
var browser_type=navigator.appName
var browser_version=parseInt(navigator.appVersion)
var canDo=0;

if (browser_type=="Netscape"&&browser_version<5&&browser_version>=3) {bType=1}
else if (browser_type=="Netscape"&&browser_version>=5) {bType=2}
else if (browser_type=="Microsoft Internet Explorer"&&browser_version>=4) {bType=3}
else {bType=0}

//if ((((navigator.appName.indexOf("Netscape")!=-1)&&(parseFloat(navigator.appVersion)>=3))||(parseFloat(navigator.appVersion)>=3))&&document.images){canDo=1;}
if (bType>0&&document.images){canDo=1;}
var d=document,onEvent,ofEvent;
if (canDo==1){ //perload images
	d.en_lang_on  = new Image; d.en_lang_on.src  = "/imgs/header/langText_en.gif";
	d.b5_lang_on  = new Image; d.b5_lang_on.src  = "/imgs/header/langText_b5.gif";
	d.gb_lang_on  = new Image; d.gb_lang_on.src  = "/imgs/header/langText_gb.gif";
	d.jp_lang_on  = new Image; d.jp_lang_on.src  = "/imgs/header/langText_jp.gif";
	d.kr_lang_on  = new Image; d.kr_lang_on.src  = "/imgs/header/langText_kr.gif";
	d.en_lang_off = new Image; d.en_lang_off.src = "/imgs/header/~en/langText.gif";
	d.b5_lang_off = new Image; d.b5_lang_off.src = "/imgs/header/~b5/langText.gif";
	d.gb_lang_off = new Image; d.gb_lang_off.src = "/imgs/header/~gb/langText.gif";
	d.jp_lang_off = new Image; d.jp_lang_off.src = "/imgs/header/~jp/langText.gif";
	d.kr_lang_off = new Image; d.kr_lang_off.src = "/imgs/header/~kr/langText.gif";
	d.en_gtext_on = new Image; d.en_gtext_on.src = "/imgs/header/~en/lang_gt_on.gif";
	d.en_gtext_off= new Image; d.en_gtext_off.src= "/imgs/header/~en/lang_gt.gif";
	d.b5_gtext_on = new Image; d.b5_gtext_on.src = "/imgs/header/~b5/lang_gt_on.gif";
	d.b5_gtext_off= new Image; d.b5_gtext_off.src= "/imgs/header/~b5/lang_gt.gif";
	d.gb_gtext_on = new Image; d.gb_gtext_on.src = "/imgs/header/~gb/lang_gt_on.gif";
	d.gb_gtext_off= new Image; d.gb_gtext_off.src= "/imgs/header/~gb/lang_gt.gif";
	d.jp_gtext_on = new Image; d.jp_gtext_on.src = "/imgs/header/~jp/lang_gt_on.gif";
	d.jp_gtext_off= new Image; d.jp_gtext_off.src= "/imgs/header/~jp/lang_gt.gif";
	d.kr_gtext_on = new Image; d.kr_gtext_on.src = "/imgs/header/~kr/lang_gt_on.gif";
	d.kr_gtext_off= new Image; d.kr_gtext_off.src= "/imgs/header/~kr/lang_gt.gif";

	d.en_l_on  = new Image; d.en_l_on.src  = "/imgs/header/l_en_on.gif";
	d.b5_l_on  = new Image; d.b5_l_on.src  = "/imgs/header/l_b5_on.gif";
	d.gb_l_on  = new Image; d.gb_l_on.src  = "/imgs/header/l_gb_on.gif";
	d.jp_l_on  = new Image; d.jp_l_on.src  = "/imgs/header/l_jp_on.gif";
	d.kr_l_on  = new Image; d.kr_l_on.src  = "/imgs/header/l_kr_on.gif";
	d.en_gt_on = new Image; d.en_gt_on.src = "/imgs/header/~en/l_gt_on.gif";
	d.en_gt_off= new Image; d.en_gt_off.src= "/imgs/header/~en/l_gt.gif";
	d.b5_gt_on = new Image; d.b5_gt_on.src = "/imgs/header/~b5/l_gt_on.gif";
	d.b5_gt_off= new Image; d.b5_gt_off.src= "/imgs/header/~b5/l_gt.gif";
	d.gb_gt_on = new Image; d.gb_gt_on.src = "/imgs/header/~gb/l_gt_on.gif";
	d.gb_gt_off= new Image; d.gb_gt_off.src= "/imgs/header/~gb/l_gt.gif";
	d.jp_gt_on = new Image; d.jp_gt_on.src = "/imgs/header/~jp/l_gt_on.gif";
	d.jp_gt_off= new Image; d.jp_gt_off.src= "/imgs/header/~jp/l_gt.gif";
	d.kr_gt_on = new Image; d.kr_gt_on.src = "/imgs/header/~kr/l_gt_on.gif";
	d.kr_gt_off= new Image; d.kr_gt_off.src= "/imgs/header/~kr/l_gt.gif";
}

function on(which,section){
	if (canDo==1){
		onEvent=eval("d."+which+"_"+section+"_on");
		document.images[section].src = onEvent.src;
		window.status="Document: Done";
	}
}

function of(which,section){
	if (canDo==1){
		ofEvent=eval("d."+which+"_"+section+"_off");
		document.images[section].src = ofEvent.src;
		window.status="Document: Done";
	}
}

function popimage(pointTO,label) {
        var thisImage = new Image(); thisImage.src=pointTO;         
        handle = window.open("",label,"width=200,height=50,resizable=yes");
        handle.document.write("<body leftmargin=10 topmargin=20 marginwidth=10 marginheight=20><P align=center style='color:#666666; font-family:verdena,arial;'>LOADING IMAGE<BR>.");
		var timeexit = 1;
        autosize(thisImage,label,handle,timeexit);
}

function autosize(thisImage,label,handle,timeexit) {
        if (!thisImage.complete) {
        timeexit=timeexit+1;
       		if (timeexit >= 60) {
	   		    handle.document.close();
	   		    handle.document.write("<body leftmargin=10 topmargin=20 marginwidth=10 marginheight=20><P align=center style='font-family:verdena,arial;'><B>SORRY!</B><BR>no large image available.<BR><BR><A href='javascript:self.close();' style='font-size:8pt; color:#993300'>[close]</A></P></body>");
	   		    handle.document.close();
	   		    handle.focus();
       		} else {
	   		    handle.document.write("."); 
	   			var fimg = function() {autosize(thisImage,label,handle,timeexit)}
				self.setTimeout(fimg,500);
	   		}
        } else {
        if (document.all) {
	  var iWidth = thisImage.width+12;
	  var iHeight = thisImage.height+55;
	} else {
	  var iWidth = thisImage.width+20;
	  var iHeight = thisImage.height+41;
	}
        handle.document.close();
	handle = window.open("",label,"width="+iWidth+",height="+iHeight+",toolbar=no,location=no,menubar=no,directories=no,status=no,scrollbars=no,resizable=yes,copyhistory=no");
        handle.document.write("<body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0><center><IMG SRC="+thisImage.src+"></center></body>");
        handle.document.close();
	handle.window.resizeTo(iWidth,iHeight);
	handle.focus();
	}
}
function openPopWindow(theURL,winName,features) {
	popup = window.open(theURL,winName,features);
	popup.focus();
}

function PopIt(pointTO, label, WWW, HHH) {
	popup = window.open(pointTO, label, "toolbar=1,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=0,copyhistory=0,width="+WWW+",height="+HHH+"")}

function PopIt2(pointTO, label, WWW, HHH, ToolBar, LocBar, Dir, Status, MenuBar, Scroll, Resize) {
	popup = window.open(pointTO, label, "toolbar="+ToolBar+",location="+LocBar+",directories="+Dir+",status="+Status+",menubar="+MenuBar+",scrollbars="+Scroll+",resizable="+Resize+",copyhistory=0,width="+WWW+",height="+HHH+"")}

function PopItWithPosition(pointTO, label, TTT, LLL, WWW, HHH, ToolBar, LocBar, Dir, Status, MenuBar, Scroll, Resize) {
	popup = window.open(pointTO, label, "toolbar="+ToolBar+",location="+LocBar+",directories="+Dir+",status="+Status+",menubar="+MenuBar+",scrollbars="+Scroll+",resizable="+Resize+",copyhistory=0,left="+LLL+",top="+TTT+",width="+WWW+",height="+HHH+"")}

function PUwClose(pointTO, winTitle, label, WWW, HHH, loc, resize) {
	popup = window.open("","label","toolbar=1,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable="+resize+",copyhistory=0,width="+WWW+",height="+HHH+"")  
	popup.document.write('<HTML><HEAD><TITLE>'+winTitle+'</TITLE></HEAD>')
	popup.document.write('<FRAMESET FRAMEBORDER=0 ROWS="*,22" FRAMESPACING=0 FRAMEBORDER=0 BORDER=0>')
	popup.document.write('  <FRAME SRC="'+pointTO+'" NORESIZE SCROLLING=auto MARGINHEIGHT=0 MARGINWIDTH=0 BORDER=0 NAME="content">')
	popup.document.write('  <FRAME SRC="http://'+loc+'scripts/pop_up_bottom.html" NORESIZE SCROLLING=no MARGINHEIGHT=0 MARGINWIDTH=0 BORDER=0 NAME="bottom">')
	popup.document.write('</FRAMESET>')
	popup.document.write('<NOFRAMES>')
	popup.document.write('<META HTTP-EQUIV="Refresh" CONTENT="0; URL='+pointTO+'">')
	popup.document.write('<BODY>')
	popup.document.write('Viewing this page requires a browser capable of displaying frames.<BR>')
	popup.document.write('<A HREF="'+pointTO+'">Click here go to that page</A>, or you will be redirect to that page automatically.') 
	popup.document.write('</BODY>')
	popup.document.write('</NOFRAMES>')
	popup.document.write('</HTML>')
	popup.document.close()
}

function openINparent(pointTO) {
	window.opener=window.open(pointTO, "yesasia_main");
}

function Done() {
	window.status = "Document: Done";
}

function checkbox_toggle(formName,whichElement,val) {
//	var dsf=eval("document." + formName);
//	for( var i=0 ; i<dsf.elements.length ; i++)
//		if ((dsf.elements[i].name==val) && (dsf.elements[i].type.toLowerCase()=="checkbox")) {
//			dsf.elements[i].checked=(dsf.elements[i].checked) ? false : true;
//			return;
//		}
	var dsf=eval("document." + formName + "." + whichElement);
	if (val) {
		dsf[val].checked=(dsf[val].checked) ? false : true;
	}
	else {
		dsf.checked=(dsf.checked) ? false : true;
	}
	return;
}

function checkbox_changeAll(formName,val,whichGroup) {
	var dsf=eval("document." + formName);
	for( var i=0 ; i<dsf.elements.length ; i++)
		if (whichGroup) {
			if (dsf.elements[i].type.toLowerCase()=="checkbox" && dsf.elements[i].id==whichGroup) dsf.elements[i].checked=val;
		}
		else {
			if (dsf.elements[i].type.toLowerCase()=="checkbox") dsf.elements[i].checked=val;
		}
		return;
}

function radio_toggle(formName,whichElement,val) {
	var dsf=eval("document." + formName + "." + whichElement);
	dsf[val].checked=true;
	return;
}

function onBGcolor(blah,hi,onColor) {
	if (onColor) {
		blah.style.backgroundColor=onColor;
	}
	else	{
		blah.style.backgroundColor='FFEE99';
	}
//	hi.style.position='relative';
//	hi.style.left='3px';
}

function offBGcolor(blah,hi,onColor) {
	if (onColor) {
		blah.style.backgroundColor=onColor;
	}
	else	{
		blah.style.backgroundColor='FFFFFF';
	}
//	hi.style.position='relative';
//	hi.style.left='0px';
}

function openLink(pointTo) {
	window.location=pointTo;
}

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_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_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_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 gotoPartner(externalSite) {
  switch(externalSite)
  {
  case 'yahoo':
    popup = window.open("http://hk.shopping.yahoo.com", "", "")
  break
  case 'emimusic':
    popup = window.open("http://www.emimusic.com.hk", "", "")
  break
	case 'sonymusic':
    popup = window.open("http://www.sonymusic.com", "", "")
	break
	case 'hongkong':
    popup = window.open("http://www.hongkong.com", "", "")
	break
	case '881903':
    popup = window.open("http://www.881903.com", "", "")
	break
	default:
    popup = window.open("http://hk.shopping.yahoo.com", "", "")
  }
}

function bookmark(url, description)
{
	netscape="Netscape User's hit CTRL+D to add a bookmark to this site."
	if (navigator.appName=='Microsoft Internet Explorer')
	{
		window.external.AddFavorite(url, description);
	}
	else if (navigator.appName=='Netscape')
	{
		alert(netscape);
	}
}

