if(location.href.toString().search('westcomzivo')!=-1){
	locationPath='ht'+'tp://kam-hing.westcomzivo.com';
}
else if (location.href.toString().search('202.67.219.28')!=-1){
	locationPath='ht'+'tp://202.67.219.28/kamhingintl.com';
}
else{
	locationPath='ht'+'tp://www.kamhingintl.com';
}

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.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);
  if(!x && document.getElementById) x=document.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 for check current Path
function getLocationPath(){
	var locPath=location.href.toString();
	var targetString;
	var subPath;
	
	if(location.href.toString().search(enFolder)!=-1){
		targetString=location.href.search(enFolder);
		subPath=locPath.substring(0, targetString);
	}
	if(location.href.toString().search(tcFolder)!=-1){
		targetString=location.href.search(tcFolder);
		subPath=locPath.substring(0, targetString);
	}
	if(location.href.toString().search(scFolder)!=-1){
		targetString=location.href.search(scFolder);
		subPath=locPath.substring(0, targetString);
	}
	return subPath;
}

//function for Print Function
function PrintDocument(){
	window.open(document.URL,'PrintPage','top=10,left=10,height=500,width=650,scrollbars=1');
}

//function for mouse over effect on left menu
function overLeftMenu(obj){
      if (document.images){
		eval("document.images." + obj + ".src = '"+imagePath+menuImagePath+obj+menuImageOver+menuImageType+"'");
      }
}

//function for mouse out effect on left menu
function outLeftMenu(obj){
      if (document.images){
		eval("document.images." + obj + ".src = '"+imagePath+menuImagePath+obj+menuImageType+"'");
      }
}

//function for switching image
function simg(obj,src){
      if (document.images){
              obj.src = src;
      }
}

function changeLanguage(switchLang){
	var tempVar = "";
	var tempPos = "";
	var currentPath=location.href.toString();
	var switchEn=enFolder;
	var switchTc=tcFolder;
	var switchSc=scFolder;

	if (currentPath.indexOf("#")!=-1)
	{
		tempPos = currentPath.indexOf("#")
		currentPath = currentPath.substring(0,tempPos)
	}
	
	switch (switchLang){
		case '/en/':
			currentPath=currentPath.replace(switchTc, switchEn);
			currentPath=currentPath.replace(switchSc, switchEn);
			break;
		case '/tc/':
			currentPath=currentPath.replace(switchEn, switchTc);
			currentPath=currentPath.replace(switchSc, switchTc);
			break;
		case '/sc/':
			currentPath=currentPath.replace(switchEn, switchSc);
			currentPath=currentPath.replace(switchTc, switchSc);
			break;
		default:
	}
	
	document.location=currentPath;
}

function moveDivs(layerObj, inObj){
	layerObj.top  = inObj;
} 

function moveTopDivs(layerObj, inObjTop, inObjLeft){
	layerObj.top  = inObjTop;
	layerObj.left  = inObjLeft;
} 

function getDim(el){
	for (var lx=0,ly=0;el!=null;
		lx+=el.offsetLeft,ly+=el.offsetTop,el=el.offsetParent);
	return {x:lx,y:ly}
}

function styleSheet(){
	var styleType='style.css';

/*	
	if(isText)
		styleType=styleType.replace('.css', '_text.css'); 
	
	if(langID==2)
		styleType=styleType.replace('.css', '_tc.css'); 
		
	if(langID==3)
		styleType=styleType.replace('.css', '_sc.css'); 
*/
	
	if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) <= 4)) {
		document.writeln('<link href="'+locationPath.replace("/text", "")+'/css/nt_'+styleType+'" rel="STYLESHEET" type="text/css">');
	}else{
//		alert (locationPath);
		document.writeln('<link href="'+locationPath.replace("/text", "")+'/css/'+styleType+'" rel="STYLESHEET" type="text/css">');
	}
}

var bV=parseInt(navigator.appVersion);
NS4=(document.layers) ? true : false;
IE4=((document.all)&&(bV>=4))?true:false;
ver4 = (NS4 || IE4) ? true : false;
isExpanded = false;
function getIndex(el) {
 ind = null;
 for (i=0; i<document.layers.length; i++) {
  whichEl = document.layers[i];
  if (whichEl.id == el) {
   ind = i;
   break;
  }
 }
 return ind;
}
function arrange() {
 nextY = document.layers[firstInd].pageY + document.layers[firstInd].document.height;
 for (i=firstInd+1; i<document.layers.length; i++) {
  whichEl = document.layers[i];
  if (whichEl.visibility != "hide") {
   whichEl.pageY = nextY;
   nextY += whichEl.document.height;
  }
 }
}
function initIt(){
 if (NS4) {
  for (i=0; i<document.layers.length; i++) {
   whichEl = document.layers[i];
   if (whichEl.id.indexOf("Child") != -1) whichEl.visibility = "hide";
  }
  arrange();
 }
 else {
  tempColl = document.all.tags("DIV");
  for (i=0; i<tempColl.length; i++) {
   if (tempColl(i).className == "child") tempColl(i).style.display = "none";
  }
 }
}
function expandIt(el) {
 if (!ver4) return;
 if (IE4) {expandIE(el)} else {expandNS(el)}
}
function expandIE(el) { 
 whichEl = eval(el + "Child");
 whichIm = event.srcElement;
 if (whichEl.style.display == "none") {
  whichEl.style.display = "block";
//  whichIm.src = "../../../images/redcube.gif";  
 }
 else {
  whichEl.style.display = "none";
//  whichIm.src = "../../../images/redcube1.gif";
 }
}
function expandNS(el) {
 whichEl = eval("document." + el + "Child");
 whichIm = eval("document." + el + "Parent.document.images['imEx']");
 if (whichEl.visibility == "hide") {
  whichEl.visibility = "show";
//  whichIm.src = "../../../images/redcube.gif";
 }
 else {
  whichEl.visibility = "hide";
//  whichIm.src = "../../../images/redcube1.gif";
 }
 arrange();
}
function showAll() {
 for (i=firstInd; i<document.layers.length; i++) {
  whichEl = document.layers[i];
  whichEl.visibility = "show";
 }
}
function expandAll(isBot) {
// newSrc = (isExpanded) ? "../../../images/redcube1.gif" : "../../../images/redcube.gif";
 if (NS4) {
        document.images["imEx"].src = newSrc;
  for (i=firstInd; i<document.layers.length; i++) {
   whichEl = document.layers[i];
//   if (whichEl.id.indexOf("Parent") != -1) {
//    whichEl.document.images["imEx"].src = newSrc;
//   }
   if (whichEl.id.indexOf("Child") != -1) {
    whichEl.visibility = (isExpanded) ? "hide" : "show";
   }
  }
  arrange();
  if (isBot && isExpanded) scrollTo(0,document.layers[firstInd].pageY);
 }
 else {
  divColl = document.all.tags("DIV");
  for (i=0; i<divColl.length; i++) {
   if (divColl(i).className == "child") {
    divColl(i).style.display = (isExpanded) ? "none" : "block";
   }
  }
//  imColl = document.images.item("imEx");
//  for (i=0; i<imColl.length; i++) {
//   imColl(i).src = newSrc;
//  }
 }
 isExpanded = !isExpanded;
}
with (document) {
 write("<STYLE TYPE='text/css'>");
 if (NS4) {
  write(".parent {position:absolute; visibility:hidden}");
  write(".child {position:absolute; visibility:hidden}");
  write(".regular {position:absolute; visibility:hidden}")
 }
 else {
  write(".child {display:none}")
 }
 write("</STYLE>");
}
onload = initIt;