var link = null;
var alt = null;
var fol = null;
var subfol = null;
var lev_div = "";
var layer = "";
var lalt = 0;
var overcolor = "";
var swflink="";
var lev_no;

var qllink =null;
var qlalt =null;

var isV5 = false;
var isIE = false;
var navmenuout = true
var navmenutimeoutID = 1
var mouseout_menuarticle = true
var menutimeoutID = 1
var pollanswer = false

var isMinNS4 = (navigator.appName.indexOf("Netscape") >= 0 &&
                parseFloat(navigator.appVersion) >= 4) ? 1 : 0;
var isMinIE4 = (document.all) ? 1 : 0;
var isMinIE5 = (isMinIE4 && navigator.appVersion.indexOf("5.") >= 0) ? 1 : 0;

var kanhanURLstr = "/gb/";

//base function
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_showHideLayers() {
if(parseInt(navigator.appVersion) == 5){
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  if(document.getElementById){
   for (i=0; i<(args.length-2); i+=3){
   obj=document.getElementById(args[i]);v=args[i+2];
v=(v=='show')?'visible':(v='hide')?'hidden':v;
   if(obj)obj.style.visibility=v;
   }
  }
  else{
  for (i=0; i<(args.length-2); i+=3) if ((obj=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; }
 }
 }
else{
  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_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_swapImage() { //v3.0C
  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 MM_swapImgRestore() { //v3.0C
  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) { //v3.0
  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); return x;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//end


var path = window.location.pathname;

if(path.indexOf('\\') != -1){
	div = "\\";
}else{
	div = "/";	
}

lev = path.split(div);

for(i=0; i<level_1.length; i++){
	if(path.indexOf(div + level_1[i]) != -1){		
		fol = i;
		
		for (j=0; j<lev.length; j++){
			if(lev[j] == level_1[i]){
				lev_no = j;
				break;
			}
		}
	}
}


for (i=0 ;i<(lev.length - lev_no)-1 ;i++){		
		lev_div += "../";
	}

no = fol + 1;

if(no < 10){
	no = "0" + no;
}

var flashobjectpath = "";
if (document.location.href.indexOf('https://sc.mpfa.org.hk/gb/') != -1){
	flashobjectpath = "https";
}else{
	flashobjectpath = "http";

}


swflink = "http://sc.mpfa.org.hk/gb/www.mpfa.org.hk/";
targetlink = "http" + ":" + "//" + "sc.mpfa.org.hk/gb/www.mpfa.org.hk/";


// Non Flash Version Program Start:
// 20061020

// moock fpi [f.lash p.layer i.nspector]
// version: 1.3.7
// written by colin moock
// code maintained at: http://www.moock.org/webdesign/flash/detection/moockfpi/
// terms of use posted at: http://www.moock.org/terms/
// =============================================================================
// These are the user defined globals.
// Modify the following variables to customize the inspection behaviour.

var requiredVersion = 7;   // Version the user needs to view site (max 9, min 2)
var useRedirect = false;   // Flag indicating whether or not to load a separate
                           // page based on detection results. Set to true to
                           // load a separate page. Set to false to embed the
                           // movie or alternate html directly into this page.
                           
// Only set next three vars if useRedirect is true...
var flashPage   = ""    // The location of the flash movie page
var noFlashPage = ""  // Page displayed if the user doesn't have the
                                  // plugin or we can't detect it.
var upgradePage = ""  // Page displayed if we detect an old plugin
// =============================================================================
// *************
// Everything below this point is internal until after the BODY tag.
// Do not modify! Proceed to the BODY tag for further instructions.
// *************
// System globals
var flash2Installed = false;    // boolean. true if flash 2 is installed
var flash3Installed = false;    // boolean. true if flash 3 is installed
var flash4Installed = false;    // boolean. true if flash 4 is installed
var flash5Installed = false;    // boolean. true if flash 5 is installed
var flash6Installed = false;    // boolean. true if flash 6 is installed
var flash7Installed = false;    // boolean. true if flash 7 is installed
var flash8Installed = false;    // boolean. true if flash 8 is installed
var flash9Installed = false;    // boolean. true if flash 9 is installed
var maxVersion = 9;             // highest version we can actually detect
var actualVersion = 0;          // version the user really has
var hasRightVersion = false;    // boolean. true if it's safe to embed the flash movie in the page
var jsVersion = 1.0;            // the version of javascript supported

// Next comes the standard javascript detection that uses the 
// navigator.plugins array. We pack the detector into a function so that 
// it preloads before being run.

function detectFlash() {  
  // If navigator.plugins exists...
  if (navigator.plugins) {
    if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
      // Some version of Flash was found. Time to figure out which.
      // Set convenient references to flash 2 and the plugin description.
      var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
      var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;

      // A flash plugin-description looks like this: Shockwave Flash 4.0 r5
      // We can get the major version by grabbing the character before the period
      // note that we don't bother with minor version detection. 
      // Do that in your movie with $version or getVersion().
      var flashVersion = parseInt(flashDescription.substring(16));

      flash2Installed = flashVersion == 2;    
      flash3Installed = flashVersion == 3;
      flash4Installed = flashVersion == 4;
      flash5Installed = flashVersion == 5;
      flash6Installed = flashVersion == 6;
      flash7Installed = flashVersion == 7;
      flash8Installed = flashVersion == 8;
      flash9Installed = flashVersion >= 9;
    }
  }
  
  for (var i = 2; i <= maxVersion; i++) {  
    if (eval("flash" + i + "Installed") == true) actualVersion = i;
  }

  if(navigator.userAgent.indexOf("WebTV") != -1) actualVersion = 4;  
  
  if (actualVersion >= requiredVersion) {
    hasRightVersion = true;
  } else {
	hasRightVersion = false;
  }
}

// Check the browser...we're looking for ie/win, but not aol
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;    // true if we're on ie
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false; // true if we're on windows


// This is a js1.1 code block, so make note that js1.1 is supported.
jsVersion = 1.1;

// Write vbscript detection on ie win. IE on Windows doesn't support regular
// JavaScript plugins array detection.
if(isIE && isWin){
  document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
  document.write('on error resume next \n');
  document.write('flash2Installed = (IsObject(CreateObject(\"ShockwaveFlash.ShockwaveFlash.2\"))) \n');
  document.write('flash3Installed = (IsObject(CreateObject(\"ShockwaveFlash.ShockwaveFlash.3\"))) \n');
  document.write('flash4Installed = (IsObject(CreateObject(\"ShockwaveFlash.ShockwaveFlash.4\"))) \n');
  document.write('flash5Installed = (IsObject(CreateObject(\"ShockwaveFlash.ShockwaveFlash.5\"))) \n');  
  document.write('flash6Installed = (IsObject(CreateObject(\"ShockwaveFlash.ShockwaveFlash.6\"))) \n');  
  document.write('flash7Installed = (IsObject(CreateObject(\"ShockwaveFlash.ShockwaveFlash.7\"))) \n');
  document.write('flash8Installed = (IsObject(CreateObject(\"ShockwaveFlash.ShockwaveFlash.8\"))) \n');
  document.write('flash9Installed = (IsObject(CreateObject(\"ShockwaveFlash.ShockwaveFlash.9\"))) \n');
  document.write('</SCR' + 'IPT\> \n'); // break up end tag so it doesn't end our script
}

function genswf(){
	
	detectFlash();
	if(hasRightVersion) {  
		
		if(path.toString().search(kanhanURLstr) != -1){
			document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"'+flashobjectpath+'://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,65,0" width="757" height="205">'+
		        '<param name=movie value="'+lev_div + '../sc_chi/images/general/targetguide.swf?link='+swflink+'&targetlink='+targetlink+'">'+
		        '<param name=quality value=high>'+
		        '<embed src="'+lev_div + '../sc_chi/images/general/targetguide.swf?link='+swflink+'&targetlink='+targetlink+'" quality=high pluginspage="'+flashobjectpath+'://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="757" height="205">'+
		        '</embed> '+
		      '</object>');
		}
		else{
			document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"'+flashobjectpath+'://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,65,0" width="757" height="205">'+
		        '<param name=movie value="'+lev_div + 'images/general/targetguide.swf?link='+swflink+'">'+
		        '<param name=quality value=high>'+
		        '<embed src="'+lev_div + 'images/general/targetguide.swf?link='+swflink+'" quality=high pluginspage="'+flashobjectpath+'://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="757" height="205">'+
		        '</embed> '+
		      '</object>');
	    }
	}
	else{
		if(path.toString().search(kanhanURLstr) != -1){
			document.write('<a href=\"'+lev_div + 'interactive/detial_answer_non_flash.asp"><img src="'+lev_div + '../sc_chi/images/general/'+nonFlash_genImg()+'" border="0"></a>');
		}
		else{
			document.write('<a href=\"'+lev_div + 'interactive/detial_answer_non_flash.asp"><img src="'+lev_div + 'images/general/'+nonFlash_genImg()+'" border="0"></a>');
		}
	}
}

function nonFlash_genImg(){
	var randnum = (Math.floor(Math.random()*5) + 1);
	var imgname = 'interactive_guide_0' + randnum + '.jpg';
	return imgname;
}

// End Non-Flash Program.

function swapimg(){	
	if(path.toString().search(kanhanURLstr) != -1){
		if(fol < 9){
			obj= eval("document.topbtn" + no);
			obj.src = lev_div + "../sc_chi/images/general/btn_over_"+no+".gif";
		}
	}
	else{
		if(fol < 9){
			obj= eval("document.topbtn" + no);
			obj.src = lev_div + "images/general/btn_over_"+no+".gif";
		}
	}
}

function genbg(){
	if(fol < 9){
		if(fol == 0){
			overcolor = '#D66666';
		}else if(fol == 1){		
			overcolor = '#D6B866';
		}else if(fol == 2){		
			overcolor = '#C08953';
		}else if(fol == 3){		
			overcolor = '#6AB279';
		}else if(fol == 4){		
			overcolor = '#5BB4BC';
		}else if(fol == 5){		
			overcolor = '#6F77BB';
		}else if(fol == 6){		
			overcolor = '#9C74B0';
		}else if(fol == 7){		
			overcolor = '#9C7272';
		}else if(fol == 8){		
			overcolor = '#999999';
		}
		
		 document.write('<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" height=\"27\" bgcolor=\"'+overcolor+'">'+
				'<tr> '+
				  '<td width="165">&nbsp;</td>'+
				  '<td class="nav">');
	}
}

function genbgend(){
	if(fol < 9){
		 document.write('</td>'+
			'</tr>'+
		 '</table>');
	}
}

function gentable(l, a, orgcol, tar, lay){
	if (link == null) { 
		link = new Array(); 
		layer = new Array();
		count = 0;
	} else { 
		count = link.length;
	}
	
	if (alt == null) {
		alt = new Array(); 
	}
	
	link[count] = l;	
	alt[count] = a;

	num = count+1;
	if(num < 10){
		num = "0" + num;
	}
	
	if(overcolor == ""){
		overcolor = "#799fe3";
	}

	subfol = link[count].split(lev_div);
	subfol = subfol[1].split('/');
	
	if(path.indexOf(div + subfol[1] + div) != -1){
		if(lay == 'y'){
			document.write('<tr>'+
				'<td bgcolor="'+overcolor+'">'+
					'<table width="100%" border="0" cellspacing="0" cellpadding="0">'+
				  '<tr>'+
					'<td valign="top"><img src="'+lev_div+'images/general/spacer.gif" name="side'+num+'" height="38" width="1"></td>'+
					'<td class="sidetxt"><a href="'+link[count]+'" target="'+tar+'" class="sidebtn" onMouseOut="navmenu_out()" onMouseOver="setpost(\'side'+num+'\',\'Lay'+count+'\',160,0);MM_showHideLayers(\'Lay'+count+'\',\'\',\'show\');navmenu_over();hideother(\'l'+count+'\')"><font color="#FFFFFF">'+alt[count]+'</font></a></td>');
			
			layer[count] = alt[count];

		}else{
			document.write('<tr>'+
				'<td bgcolor="'+overcolor+'">'+
					'<table width="100%" border="0" cellspacing="0" cellpadding="0">'+
				  '<tr>'+
					'<td valign="top"><img src="'+lev_div+'images/general/spacer.gif" name="side'+num+'" height="38" width="1"></td>'+
					'<td class="sidetxt"><a href="'+link[count]+'" target="'+tar+'" class="sidebtn" onMouseOver="hideother(\'non\')"><font color="#FFFFFF">'+alt[count]+'</font></a></td>');		
		}
	}else{
		if(lay == 'y'){
			document.write('<tr>'+
				'<td onMouseOver="bgColor=\''+overcolor+'\'" onMouseOut="bgColor=\''+orgcol+'\'" bgcolor="'+orgcol+'">'+
					'<table width="100%" border="0" cellspacing="0" cellpadding="0">'+
				  '<tr>'+
					'<td valign="top"><img src="'+lev_div+'images/general/spacer.gif" name="side'+num+'" height="38" width="1"></td>'+
				'<td class="sidetxt"><a href="'+link[count]+'" target="'+tar+'" class="sidebtn" onMouseOut="navmenu_out()" onMouseOver="setpost(\'side'+num+'\',\'Lay'+count+'\',160,0);MM_showHideLayers(\'Lay'+count+'\',\'\',\'show\');navmenu_over();hideother(\'l'+count+'\')">'+alt[count]+'</a></td>');	
			
			layer[count] = alt[count];

		}else{
			document.write('<tr>'+
				'<td onMouseOver="bgColor=\''+overcolor+'\'" onMouseOut="bgColor=\''+orgcol+'\'" bgcolor="'+orgcol+'">'+
					'<table width="100%" border="0" cellspacing="0" cellpadding="0">'+
				  '<tr>'+
					'<td valign="top"><img src="'+lev_div+'images/general/spacer.gif" name="side'+num+'" height="38" width="1"></td>'+
				'<td class="sidetxt"><a href="'+link[count]+'" target="'+tar+'" class="sidebtn" onMouseOver="hideother(\'non\')">'+alt[count]+'</a></td>');	
		}
	}
	
	document.write('</tr>'+
				'</table>'+
				'</td>'+
				'</tr>'+
			'<tr>'+
			'<td><img src="'+lev_div+'images/general/spacer.gif"></td>'+
			'</tr>');	
	   
}

function genlayerheader(lyno){
	document.write('<div id=\"Lay'+lyno+'" style="position:absolute; left:0px; top:0px; width:160px; height:15px; z-index:1; visibility: hidden">'+
	  '<table width="160" border="0" cellspacing="1" cellpadding="0" bgcolor="#FFFFFF">');
}

function genlayerheader2(lyno){
	document.write('<div id=\"subLay'+lyno+'" style="position:absolute; left:0px; top:0px; width:160px; height:15px; z-index:1; visibility: hidden">'+
	  '<table width="160" border="0" cellspacing="1" cellpadding="0" bgcolor="#FFFFFF">');
}

function genlayerfooter(){
	 document.write('</table>'+
	'</div>');
}

function genlaytab(lylink,lyalt,lyorgcol,lyovercol, lytarget, lylayer){

	if (lalt == 0) {
		lalt = new Array(); 
		lcount = 0;
	}else{
		lcount = lalt.length;
	}
		
	lalt[lcount] = lyalt;

	lnum = lcount+1;
	if(lnum < 10){
		lnum = "0" + lnum;
	}

	document.write(' <tr> '+
    '  <td class="layer_txt" onMouseOver="bgColor=\''+lyovercol+'\'" onMouseOut="bgColor=\''+lyorgcol+'\'" bgcolor="'+lyorgcol+'"><table width="100%" border="0" cellspacing="0" cellpadding="0">'+
       '  <tr>'+
         ' <td valign="top"><img src="'+lev_div+'images/general/spacer.gif" name="lyside'+lnum+'"></td>');
	if(lylayer == "y"){		
		document.write('<td><a href=\"'+lylink+'" target="'+lytarget+'" class="layerlink" onMouseOut="navmenu_out()" onMouseOver="setpost(\'lyside'+lnum+'\',\'subLay'+lcount+'\',158,-1);MM_showHideLayers(\'subLay'+lcount+'\',\'\',\'show\');navmenu_over();hideother2(\'sl'+lcount+'\')">'+lyalt+'</a></td>');
	}else{
		document.write('<td><a href=\"'+lylink+'" target="'+lytarget+'" class="layerlink" onMouseOver="navmenu_over()" onMouseOut="navmenu_out()">'+lyalt+'</a></td>');
	}
	
	document.write(' </tr>'+
     '  </table> '+  
	' </td>'+
    '</tr>');
}



// quicklinks

function genqlhd(){	
	for(q=0; q<qlmenu.length; q++){
		qlfol = qlmenu[q]['link'].split(lev_div);
		qlfol = qlfol[1].split('/');		
		if(path.indexOf(div + qlfol[1] + div) != -1){
			document.write(qlmenu[q]['alt']);			
			break;
		}
	}
}

function genql(){
	for(q=0; q<qlmenu.length; q++){
		genqltable(qlmenu[q]['link'], qlmenu[q]['alt'], '#CCCCCC', '#E1E1E1', qlmenu[q]['tar']);
	}
}


document.write ('<script src="'+lev_div+'images/quicklinks.js" language="Javascript"></script>');

function genqlmenu(){	
	for(q=0; q<qlmenu.length; q++){		
		gentable(qlmenu[q]['link'], qlmenu[q]['alt'], qlmenu[q]['orgcol'], qlmenu[q]['tar'], qlmenu[q]['layer']);
	}
}

function genqltable(l, a, orgcol, overcol, tar){
	document.write('<tr>');
		qlfol = l.split(lev_div);
		qlfol = qlfol[1].split('/');		
		if(path.indexOf(div + qlfol[1] + div) != -1){
			document.write('<td bgcolor="'+overcol+'" class="qltxt">');
		}else{
			document.write('<td onMouseOver="bgColor=\''+overcol+'\'" onMouseOut="bgColor=\''+orgcol+'\'" bgcolor="'+orgcol+'" class="qltxt">');
		}

		document.write('<a href="'+l+'" target="'+tar+'" class="qllink" onMouseOver="navmenu_over()" onMouseOut="navmenu_out()">'+a+'</a></td>'+
			'</tr>');	
}


//end quicklinks



// disclaimer
function getdisclaimer(){
	document.write ('<script src="'+lev_div+'images/disclaimer.js" language="Javascript"></script>');
}


//show layer

function setpost(img, layerid, x, y){
	tmp_img = getImage(img);	
	tmp_y = getImagePageTop(tmp_img);
	tmp_x = getImagePageLeft(tmp_img);

//alert(layerid);
	if(isMinIE4){
		obj = eval(layerid);
		obj.style.posLeft = tmp_x + x;
		obj.style.posTop = tmp_y + y;		
	}else{
		document.getElementById(layerid).style.left = tmp_x + x;
		document.getElementById(layerid).style.top = tmp_y + y;
	}	
}

function calqmenulpos_y(img){
//	###########################################	
//	configurables
	toppos = 410;		// Navigation Path Position
//	###########################################
	tmp_img = getImage("icql");
	y = getImagePageTop(tmp_img);
	menuheight = (qlmenu.length * 20);
	result = 0;

	diff = (y - toppos);
	menudiff = diff - menuheight;

	if(menudiff > 0){
		result = -menuheight + 20;
	}
	else{
		result = -(menuheight + menudiff);
	}
	return (result);
}

function getImage(name) {

  if (isMinNS4) {
    return findImage(name, document);
  }
  if (isMinIE4)
    return eval('document.all.' + name);
  return null;
}

function findImage(name, doc) {

  var i, img;

  for (i = 0; i < doc.images.length; i++)
    if (doc.images[i].name == name)
      return doc.images[i];
  for (i = 0; i < doc.layers.length; i++)
    if ((img = findImage(name, doc.layers[i].document)) != null) {
      img.container = doc.layers[i];
      return img;
    }
  return null;
}

function getImagePageTop(img) {

  var y, obj;

  if (isMinNS4) {
    if (img.container != null)
      return img.container.pageY + img.y;
    else
      return img.y;
  }
  if (isMinIE4) {
    y = 0;
    obj = img;
    while (obj.offsetParent != null) {
      y += obj.offsetTop;
      obj = obj.offsetParent;
    }
    y += obj.offsetTop;
    return y;
  }
  return -1;
}

function getImagePageLeft(img) {

  var x, obj;

  if (isMinNS4) {
    if (img.container != null)
      return img.container.pageX + img.x;
    else
      return img.x;
  }
  if (isMinIE4) {
    x = 0;
    obj = img;
    while (obj.offsetParent != null) {
      x += obj.offsetLeft;
      obj = obj.offsetParent;
    }
    x += obj.offsetLeft;
    return x;
  }
  return -1;
}

function navmenu_over() {
	navmenuout = false ;
	clearTimeout(navmenutimeoutID);
}

function navmenu_out() {
	navmenuout = true ;
	navmenutimeoutID = setTimeout("autohide_menu()","1000");
}

function autohide_menu() {
	if (navmenuout == true) {
		MM_showHideLayers('ql','', 'hide');
		for(q=0;q<layer.length;q++){	
			MM_showHideLayers('Lay'+q,'','hide');
		}
		for(q=0;q<lalt.length;q++){	
			MM_showHideLayers('subLay'+q,'','hide');
		}
	}
}

function hideother(layername) {

	for(q=0;q<layer.length;q++){
		if (layername != 'l'+q){			
			MM_showHideLayers('Lay'+q,'','hide');
		}		
	}
	for(q=0;q<lalt.length;q++){
		if (layername != 'sl'+q){			
			MM_showHideLayers('subLay'+q,'','hide');
		}		
	}
	
	if(layername != 'ql'){
		MM_showHideLayers('ql','', 'hide');
	}	
}

function hideother2(layername) {

	for(q=0;q<lalt.length;q++){
		if (layername != 'sl'+q){			
			MM_showHideLayers('subLay'+q,'','hide');
		}		
	}
}

function menu_over() {
	mouseout_menuarticle = false ;
	clearTimeout(menutimeoutID);
}


// For Kan Han Usage.
// Generate Language Swap link
function GenImage3(){
	if (locapath.toString().search(kanhanURLstr)!= -1){
		// sc version now.
		document.write('<a href=\"javascript:chglang(\'tc\')\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage(\'Image3\',\'\',\''+lev_div+'../sc_chi/images/general/top_over_04.gif\',1)"><img src="'+lev_div+'../sc_chi/images/general/top_04.gif" alt="楛极笢恅" border="0" name="Image3"></a>');
	} else {
		// tc version now.
		document.write('<a href=\"javascript:chglang(\'sc\')\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage(\'Image3\',\'\',\''+lev_div+'images/general/top_over_04.gif\',1)"><img src="'+lev_div+'images/general/top_04.gif" alt="简体中文" border="0" name="Image3"></a>');		
	}	
}

function GenImage4(){
	if (locapath.toString().search(kanhanURLstr)!= -1){
		// sc version now.
		document.write('<a href=\"javascript:chglang(\'sctxt\')\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage(\'Image4\',\'\',\''+lev_div+'../sc_chi/images/general/top_over_05.gif\',1)"><img src="'+lev_div+'../sc_chi/images/general/top_05.gif" alt="曾恅趼" border="0" name="Image4"></a>');
	} else {
		// tc version now.
		document.write('<a href=\"javascript:chglang(\'tctxt\')\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage(\'Image4\',\'\',\''+lev_div+'images/general/top_over_05.gif\',1)"><img src="'+lev_div+'images/general/top_05.gif" alt="纯文字" border="0" name="Image4"></a>');
	}	
}


function genpslang(){
	var result = "tc";
	if(path.toString().search(kanhanURLstr) != -1){
		result = "sc";
	}
	return result;
}