window.name="main";

function OpenWindow1(strUrl,w,h)
  {  window.open(strUrl,"Title","toolbar=0,width="+w+",height="+h+",scrollbars=1,resizable=no");
}

function getFocus()
{
 this.focus();
}

function displayLayers(layerName, dis)
{
 
var obj;
if (document.all) {//For I.E.
   obj = document.all[layerName].style;
   obj.display = dis ? "inline" : "none";
  }
  else if (document){//For Netscape or FireFox
   obj = document.getElementById(layerName).style;
   obj.display = dis ? "inline" : "none";
  } 
} 



function ChangeImageOver(name)
{
	document.images[name].src = "/sb300cn/FILE/"+name+"_on.gif";
}

function ChangeImageOut(name)
{
	document.images[name].src = "/sb300cn/FILE/"+name+"_off.gif";
}

function SwitchLang(obj)
{
	address = document.location.href;
	language = obj.options[obj.selectedIndex].value;
	
	if (address.indexOf("/en/")>=0){
		newurl = address.replace("/en/","/"+language+"/");
	}
	if (address.indexOf("/sc/")>=0){
		newurl = address.replace("/sc/","/"+language+"/");
	}
	if (address.indexOf("/kr/")>=0){
		newurl = address.replace("/kr/","/"+language+"/");
	}
	document.location.href=newurl;
}

function PopUp(url, w, h)
{
	npop = window.open(url,'popwin','width='+w+',height='+h+',menubar=no,status=no,scrollbars=no,resizable=no,toolbar=no,location=no,directories=no')
}

function changeCase(cs)
{
	hideAllCases();
	displayCases(cs,true);
}

function displayCases(layerName, dis){
	
	var obj;
	if (document.all) {//For I.E.
		obj = document.all[layerName].style;
		obj.display = dis ? "inline" : "none";
	}
	else if (document){//For Netscape or FireFox
		obj = document.getElementById(layerName).style;
		obj.display = dis ? "inline" : "none";
	}
	if(dis){
		document.images["tab_"+layerName].src="/sb300cn/sb300cn_portlets/homepage/images/"+"tab_"+layerName+"_on.gif";
	}
	else{
		document.images["tab_"+layerName].src="/sb300cn/sb300cn_portlets/homepage/images/"+"tab_"+layerName+"_off.gif";
	}
	
}	

function hideAllCases(){
	
	for (var j=0; j < csArray.length; j++) {		
		displayCases(csArray[j], false);		
	}
}