//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);
	}
	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 currentPath=location.href.toString();
	var switchEn=enFolder;
	var switchTc=tcFolder;
	var switchSc=scFolder;
	var switchText=textFolder;
	
	switch (switchLang){
		case '/graphics/':
			currentPath=currentPath.replace(switchText, "");
//			currentPath=currentPath.replace(switchTc, switchText+switchTc);
			break;
		case '/text/':
			currentPath=currentPath.replace(switchEn, switchText+switchEn);
			currentPath=currentPath.replace(switchTc, switchText+switchTc);
			currentPath=currentPath.replace(switchSc, switchText+switchSc);
			break;
		case '/gb/':
//			currentPath='http://'+gb_urlPath+locationPath.substring(7, locationPath.length)+switchTc;
			currentPath=currentPath.replace('ht'+'tp://', 'ht'+'tp://'+gbUrlPath);
			currentPath=currentPath.replace(switchEn, switchTc);
			break;
		case '/en/':
			currentPath=currentPath.replace(switchTc, switchEn);
			currentPath=currentPath.replace(switchSc, switchEn);
			currentPath=currentPath.replace(gbUrlPath, "");
			break;
		case '/tc/':
			currentPath=currentPath.replace(switchEn, switchTc);
			currentPath=currentPath.replace(switchSc, switchTc);
			currentPath=currentPath.replace(gbUrlPath, "");
			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{
		document.writeln('<link href="'+locationPath.replace("/text", "")+'/css/'+styleType+'" rel="STYLESHEET" type="text/css">');
	}
}



