//Navigation Level 3, extend and collapse tree.
//add by B33052, 2006/08/25
function exMenu(num) {
	if (document.getElementById("treeMenu"+num).style.display == "none"){
		document.getElementById("treeMenu"+num).style.display = "block";
		//document.getElementById("subsymbol"+num).innerText ="- ";
	}else{
		document.getElementById("treeMenu"+num).style.display = "none";
		//document.getElementById("subsymbol"+num).innerText ="+";
	}
}
function collapseMenu(num) {
	document.getElementById("treeMenu"+num).style.display = "none";
	//document.getElementById("subsymbol"+num).innerText ="+";
}
function linkState(URL,num) {
        if(document.getElementById("treeMenu"+num).style.display == "none"){
	     menuState = URL + "?menuState=isCollapse";
	}else{
             menuState = URL +"?menuState=isExtend";
        }
        return menuState;
}





//relocation with monitor dpi.
//add by B33052, 2006/04/10
function countX(positionX) {
	var rePosX, clientWidth;

	clientWidth = document.body.clientWidth;
        //alert(clientWidth);
	if (clientWidth >= 900 ){
                rePosX = positionX + ((clientWidth - 900)/2)-9;
	}else if(clientWidth < 900){
                rePosX = positionX + ((1004 - 900)/2)-9;
	}
	return(rePosX);
}


//for index page Su Flash
//User click Flash open scm.jsp page.
//add by B33052, 2006/09/21
function clickFlash(){
	document.location.href="logistics/scm.jsp";
}


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_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_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 showImages(SIMG,W,H)
{
  var LM1 ;
  LM1 = window.open("","ImgWin1","toolbar=no, location=no,directories=no, width="+W +",height="+H);
  LM1.document.write("<html><head><title>Show Picture</title></head>");
  LM1.document.write("<body bgcolor='#FFFFFF'><center>");
  LM1.document.write("<img src='/STATIC/en/images/sea/"+SIMG+"'/>");
  LM1.document.write("<form>");
  LM1.document.write("<input type='button' name='close' value='Close' onClick='window.close()'>");
  LM1.document.write("</form>");
  LM1.document.write("</center></body></html>");
  LM1.document.close();

}