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];}
}

var myCount;

function scrollLayer(sLayerID,bType){
	var activeLayer=document.getElementById(sLayerID);
	var layerHeight=activeLayer.style.height.slice(0,-2)*1;
	var layerWidth=activeLayer.style.width.slice(0,-2)*1;
	
	if (bType=="down"){
		decreaseLayer(layerWidth,layerHeight,sLayerID);
	}else{
		increaseLayer(1,10,layerWidth,layerHeight,sLayerID);
	}
}

function increaseLayer(nWidth,nHeight,sWidth,sHeight,thisLayer){
	document.getElementById(thisLayer).style.clip="rect(0 "+nWidth+" "+nHeight+" 0)"
	if ((nWidth>=sWidth)&&(nHeight>=sHeight)){
		return true;
	}else{
		if (nWidth<sWidth){
			nWidth=nWidth+7;		
		}
		if (nHeight<sHeight){
			nHeight=nHeight+7;		
		}
		myCount = window.setTimeout("increaseLayer("+nWidth+","+nHeight+","+sWidth+","+sHeight+",'"+thisLayer+"');",1);
	}
	return true;
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;

//alert(args[0]+"|"+args[1]+"|"+args[2]+"|"+args[3]);

	if ((args[2]=="show")&&(args[3]==true))
	{

		scrollLayer(args[0],"up");
	}

  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_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function reMoveLayer(){
	var i,nLayerLeft;
	var tempLeft;
	var layerOffset=document.imgRef.width;

//alert(layerOffset);
	for (i=1;i<4;i++){	
		tempLeft=document.getElementById("Menu"+i).style.left.slice(0,-4)*1;
		document.getElementById("Menu"+i).style.left=165+(layerOffset/3);
	}
}

function hidAllLayer(thisNot){
	for (i=1;i<4;i++){
		if (i!=thisNot){
			MM_showHideLayers('Menu'+i,'','hid');		
		}
	}
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);



document.write("<div id=\"Menu1\" style=\"position:absolute; left:165px; top:130px; width:200px; height:200px; z-index:1; visibility: hidden\"");
document.write("onMouseOver=\"MM_showHideLayers('Menu1','','show')\" onMouseOut=\"MM_showHideLayers('Menu1','','hide')\">");
//document.write("<a href=\""+linkMenu11+"\"><img src=\""+imgPath+"images/sub2_1.gif\" border=\"0\"></a><a href=\""+linkMenu12+"\"><img src=\""+imgPath+"images/sub2_2.gif\" border=\"0\"></a><a href=\""+linkMenu13+"\"><img src=\""+imgPath+"images/sub2_3.gif\" border=\"0\"></a> ");
document.write("<TABLE bgcolor=\"#175DBE\" bordercolor=\"#5184CE\" border=\"1\" style=\"font-family: 'MS Sans Serif'; font-size: 10pt; font-style: normal; font-weight: normal; color: #FFFFFF\">");
document.write("<TR><A HREF=\"aboutus1.jsp\" ><TD onmouseover=\"javascript:this.style.backgroundColor='#5184CE'\" onmouseout=\"javascript:this.style.backgroundColor='#175DBE'\" style=\"cursor:hand;\">ประวัติความเป็นมา</TD></A></TR>");
document.write("<TR><A HREF=\"aboutus2.jsp\" ><TD onmouseover=\"javascript:this.style.backgroundColor='#5184CE'\" onmouseout=\"javascript:this.style.backgroundColor='#175DBE'\" style=\"cursor:hand;\">โครงสร้างการบริหารงาน</TD></A> </TR>");
document.write("<TR><A HREF=\"aboutus3.jsp\" ><TD onmouseover=\"javascript:this.style.backgroundColor='#5184CE'\" onmouseout=\"javascript:this.style.backgroundColor='#175DBE'\" style=\"cursor:hand;\">บริการของเรา</TD></A></TR>");
document.write("<TR><A HREF=\"aboutus4.jsp\" ><TD onmouseover=\"javascript:this.style.backgroundColor='#5184CE'\" onmouseout=\"javascript:this.style.backgroundColor='#175DBE'\" style=\"cursor:hand;\">ผลงานของสำนักพิมพ์</TD></A></TR>");
document.write("<TR><A HREF=\"aboutus5.jsp\" ><TD onmouseover=\"javascript:this.style.backgroundColor='#5184CE'\" onmouseout=\"javascript:this.style.backgroundColor='#175DBE'\" style=\"cursor:hand;\">ศูนย์หนังสือ</TD></A></TR>");
document.write("<TR><A HREF=\"aboutus6.jsp\" ><TD onmouseover=\"javascript:this.style.backgroundColor='#5184CE'\" onmouseout=\"javascript:this.style.backgroundColor='#175DBE'\" style=\"cursor:hand;\">การรับสมาชิกและจัดจำหน่าย</TD></A></TR>");
document.write("<TR><A HREF=\"aboutus7.jsp\" ><TD onmouseover=\"javascript:this.style.backgroundColor='#5184CE'\" onmouseout=\"javascript:this.style.backgroundColor='#175DBE'\" style=\"cursor:hand;\">การติดต่อ</TD></A></TR>");
document.write("</TABLE>");
document.write("</div>");
document.write("<div id=\"Menu2\" style=\"position:absolute; left:165px; top:242px; width:200px; height:200px; z-index:1; visibility: hidden\" ");
document.write("onMouseOver=\"MM_showHideLayers('Menu2','','show')\" onMouseOut=\"MM_showHideLayers('Menu2','','hide')\">");
//document.write("<a href=\""+linkMenu21+"\"><img src=\""+imgPath+"images/sub3_1.gif\" border=\"0\"></a><a href=\""+linkMenu22+"\"><img src=\""+imgPath+"images/sub3_2.gif\" border=\"0\"></a><a href=\""+linkMenu23+"\"><img src=\""+imgPath+"images/sub3_3.gif\" border=\"0\"></a><a href=\""+linkMenu24+"\"><img src=\""+imgPath+"images/sub3_4.gif\" border=\"0\"></a><a href=\""+linkMenu25+"\"><img src=\""+imgPath+"images/sub3_5.gif\" border=\"0\"></a><a href=\""+linkMenu26+"\"><img src=\""+imgPath+"images/sub3_6.gif\" border=\"0\"></a><a href=\""+linkMenu27+"\"><img src=\""+imgPath+"images/sub3_7.gif\" border=\"0\"></a> ");
document.write("<TABLE bgcolor=\"#175DBE\" bordercolor=\"#5184CE\" border=\"1\" style=\"font-family: 'MS Sans Serif'; font-size: 10pt; font-style: normal; font-weight: normal; color: #FFFFFF\">");
document.write("<TR><A HREF=\"products_book.jsp\" ><TD onmouseover=\"javascript:this.style.backgroundColor='#5184CE'\" onmouseout=\"javascript:this.style.backgroundColor='#175DBE'\" style=\"cursor:hand;\">สินค้าประเภทหนังสือ</TD></A></TR>");
document.write("<TR><A HREF=\"products_cd.jsp\" ><TD onmouseover=\"javascript:this.style.backgroundColor='#5184CE'\" onmouseout=\"javascript:this.style.backgroundColor='#175DBE'\" style=\"cursor:hand;\">สินค้าประเภท CD/DVD</TD></A> </TR>");
document.write("<TR><A HREF=\"products_elect.jsp\" ><TD onmouseover=\"javascript:this.style.backgroundColor='#5184CE'\" onmouseout=\"javascript:this.style.backgroundColor='#175DBE'\" style=\"cursor:hand;\">ข้อมูลอิเล็กทรอนิกส์</TD></A></TR>");
document.write("<TR><A HREF=\"products_fax.jsp\" ><TD onmouseover=\"javascript:this.style.backgroundColor='#5184CE'\" onmouseout=\"javascript:this.style.backgroundColor='#175DBE'\" style=\"cursor:hand;\">ข้อมูลแฟกซ์</TD></A></TR>");
document.write("<TR><TD >บริการอื่นๆ</TD></TR>");
document.write("</TABLE>");
document.write("</div>");
document.write("<div id=\"Menu3\" style=\"position:absolute; left:165px; top:259px; width:200px; height:200px; z-index:1; visibility: hidden\" ");
document.write("onMouseOver=\"MM_showHideLayers('Menu3','','show')\" onMouseOut=\"MM_showHideLayers('Menu3','','hide')\">");
document.write("<a href=\""+linkMenu31+"\"><img src=\""+imgPath+"images/sub4_1.gif\" border=\"0\"></a><a href=\""+linkMenu32+"\"><img src=\""+imgPath+"images/sub4_2.gif\" border=\"0\"></a><a href=\""+linkMenu33+"\"><img src=\""+imgPath+"images/sub4_3.gif\" border=\"0\"></a>");
document.write("</div>");