/*Image Rollover Function by DreamWeaver Maked*/
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);

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.01
  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 && d.getElementById) x=d.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 MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  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; }
}

/*Toop Navigation Script*/
topmenuclick = 1;
function setTopmenu(num,code){
	if(num < 5){
		try{ 
		if(topmenuclick==1) var preimg="whh0100";
		if(topmenuclick==2) var preimg="whh0200";
		if(topmenuclick==3) var preimg="whh0300";
		if(topmenuclick==4) var preimg="whh0400";
		//alert(topmenuclick);
		var imgdir = "http://www.whimori.com/at_whh/whh_images/img_whhmenu/";
		eval("document.getElementById('divtop"+topmenuclick+"').style.display = 'none'");
		eval("document.getElementById('imgtop"+topmenuclick+"').src = '"+imgdir+"ctit_off_"+preimg+".gif'");
		eval("document.getElementById('divtop"+num+"').style.display = ''");
		eval("document.getElementById('imgtop"+num+"').src = '"+imgdir+"ctit_on_"+code+".gif'");
		topmenuclick = num;
		
		}catch(e){
			return;
		}
	}else{
		return;
	}
}

/*기본 롤오버스크립트 시작*/
function imgrollover(img,overname){
	img.src = overname;	
}
function imgrollout(img,outname){
	img.src = outname;
}
/*기본 롤오버스크립트 끝*/

/*window popup*/
function popupwin(url, name, opt){
	if(url != ""){
		window.open(url,name,opt);
	}
	return;
}
/*FAQ 자바스크립트 시작*/
var clickvalue='';
function qclick(idnum){

	answer=eval("answerid"+idnum+".style");

	if(clickvalue!=answer)
	{
		if(clickvalue!='')
		{
			clickvalue.display='none';
		}
		answer.display='block';
		clickvalue=answer;
	}
	else
	{
		answer.display='none';
		clickvalue='';
	}
}

/*FAQ 자바스크립트 끝*/

/*메뉴롤오버*/

nowrollNum = 0; //현재 페이지 메뉴

function rollMenu(num, chimg){
	try{
		if(nowrollNum != num){
			eval("document.getElementById('rollimg"+num+"').src = '"+chimg+"'");
		}
	}catch(e){
		return;
	}
}

function setMenu(num, chimg){
	try{
		eval("document.getElementById('rollimg"+num+"').src = '"+chimg+"'");
		nowrollNum = num;
	}catch(e){
		return;
	}
}


/*플래시 링크 & 서브 탑메뉴 링크*/
function GoUrl(num){
	switch(num){
		/*HOME*/
		case 0 :
			location.href = "http://www.whimori.com/at_whh/whh0100/whh0101/whh0100.html";
			break;

		/*휘모리소개*/
		case "0100" :
			location.href = "http://www.whimori.com/at_whh/whh0100/whh0101/whh0100.html";
			break;
		case "0101" :
			location.href = "http://www.whimori.com/at_whh/whh0100/whh0101/whh0100.html";
			break;
		case "0102" :
			location.href = "http://www.whimori.com/at_whh/whh0100/whh0102/whh0102.html";
			break;
		case "0103" :
			location.href = "http://www.whimori.com/at_whh/whh0100/whh0103/whh0103.html";
			break;
		case "0104" :
			location.href = "http://www.whimori.com/at_whh/whh0100/whh0104/whh0104.html";
			break;
		
		/*휘모리상품정보*/
		case "0200" :
			location.href = "http://www.whimori.com/at_whh/whh0200/whh0201/whhb010100/whhb010100.html";
			break;
		case "0201" :
			location.href = "http://www.whimori.com/at_whh/whh0200/whh0201/whhb010100/whhb010100.html";
			break;
		case "0202" :
			location.href = "http://www.whimori.com/at_whh/whh0200/whh0202/whhb020100/whhb020100.html";
			break;
		case "0203" :
			location.href = "http://www.whimori.com/at_whh/whh0200/whh0203/whhb030100/whhb030100.html";
			break;
		case "0204" :
			location.href = "http://www.whimori.com/at_whh/whh0200/whh0204/whhb040100/whhb040100.html";
			break;
		case "0205" :
			location.href = "http://www.whimori.com/at_whh/whh0200/whh0205/whhb050100/whhb050100.jsp";
			break;
		case "0206" :
			location.href = "http://www.whimori.com/at_whh/whh0200/whh0206/whhb060100/whhb060100.jsp";
			break;
		/*생산이력정보실*/
		case "0300" :
			location.href = "http://www.whimori.com/at_whh/whh0300/whh0301/whh0301.html";
			break;
		case "0301" :
			location.href = "http://www.whimori.com/at_whh/whh0300/whh0301/whh0301.html";
			break;
		case "0302" :
			location.href = "http://www.whimori.com/at_whh/whh0300/whh0302/whh0302.jsp";
			break;
		
		/*휘모리이야기*/
		case "0400" :
			location.href = "http://www.whimori.com/at_whh/whh0400/whh0401/whh0401.jsp";
			break;
		case "0401" :
			location.href = "http://www.whimori.com/at_whh/whh0400/whh0401/whh0401.jsp";
			break;
		case "0402" :
			location.href = "http://www.whimori.com/at_whh/whh0400/whh0404/whh0402/whh0402.html";
			break;
		case "0403" :
			location.href = "http://www.whimori.com/at_whh/whh0400/whh0403/whh0403.html";
			break;
		case "0404" :
			location.href = "http://www.whimori.com/at_whh/whh0400/whh0404/whh0404.jsp";
			break;

		/*사이트맵*/
		case "0500" :
			location.href = "http://www.whimori.com/at_whh/whh0500/whh0501/whh0501.html";
			break;
		case "0501" :
			location.href = "http://www.whimori.com/at_whh/whh0500/whh0501/whh0501.html";
			break;
		
		
	}
	
	return;

}

