// °¡Àå ±âº» ÀÚ¹Ù½ºÅ©¸³Æ® ¼Ò½º 4Á¾¼ÂÆ® ¸ðÀ½ 
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 MM_showHideLayers() { //v3.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; }
}

// ºê¶ó¿ìÀú È£È¯¼ºÃ¼Å©
function MM_checkBrowser(NSvers,NSpass,NSnoPass,IEvers,IEpass,IEnoPass,OBpass,URL,altURL) { //v4.0
var newURL='', verStr=navigator.appVersion, app=navigator.appName, version = parseFloat(verStr);
if (app.indexOf('Netscape') != -1) {
if (version >= NSvers) {if (NSpass>0) newURL=(NSpass==1)?URL:altURL;}
else {if (NSnoPass>0) newURL=(NSnoPass==1)?URL:altURL;}
} else if (app.indexOf('Microsoft') != -1) {
if (version >= IEvers || verStr.indexOf(IEvers) != -1)
{if (IEpass>0) newURL=(IEpass==1)?URL:altURL;}
else {if (IEnoPass>0) newURL=(IEnoPass==1)?URL:altURL;}
} else if (OBpass>0) newURL=(OBpass==1)?URL:altURL;
if (newURL) { window.location=unescape(newURL); document.MM_returnValue=false; }
}


// »õÃ¢ ¶ç¿ì±â 
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function RWindow(URL,WD,HT) { 
window.open(URL,'counter','width=430,height=400,scrollbars=yes,resizable=0,status=no,menubar=0'); 
} 


function SpamEmail(URL,WD,HT) { 
window.open('/','SpamEmail','width=500,height=700,scrollbars=yes,resizable=0,status=no,menubar=0'); 
}

// ·Î±×ÀÎ ÀÎÇ²¹Ú½º È¿°ú
var str = 0;
	function check_keycode(e) {
		//alert(e.keyCode);
		if (e.type == "keypress") var whichCode = e.keyCode;
	//    alert(whichCode);
		//if (whichCode == 13)
				//SubmitFrm();
	}

	var c=false;
	// Æ÷Ä¿½º°¡ ÀÎÇ² ¹Ú½º¾È¿¡ ÀÖÀ»¶§ ¹è°æÀÌ¹ÌÁö Áö¿ì±â
	function ch (valueid) {
		if(valueid ==  'MEM_ID')  document.NidLogin.MEM_ID.style.backgroundImage="";
		else document.NidLogin.MEM_PASSWD.style.backgroundImage="";
		c=true;
	}

	// Æ÷Ä¿½º°¡ ÀÎÇ² ¹Ú½º¸¦ ¹þ¾î³µÀ»¶§ ¹è°æÀÌ¹ÌÁö »ì¸®±â (ÀÔ·Â°ªÀÌ ÀÖÀ¸¸é »ì¸®Áö ¾Ê±â)
	function chout (valueid) {
		if(valueid ==  'MEM_ID') {
			if(!document.NidLogin.MEM_ID.value) document.NidLogin.MEM_ID.style.backgroundImage="url(/img/ver2/l_id.gif)";
		}
		else {
			if(!document.NidLogin.MEM_PASSWD.value) document.NidLogin.MEM_PASSWD.style.backgroundImage="url(/img/ver2/l_pw.gif)";
		}
	}
	c=true;


// ÇÃ·¡½¬ ¸Þ´º »ç¿ë½Ã ´ÜÃàÅ° ¼ÂÆÃ
function ChangeURL(Num) {
if(Num ==0) location.href="/Ver2/";
	else if(Num ==1) location.href="/Ver2/about/";
	else if(Num ==2) location.href="/Ver2/walnut/";
	else if(Num ==3) location.href="/Ver2/nutrition/";
	else if(Num ==4) location.href="/Ver2/recipe/seminar/boris_seminar.asp";
	else if(Num ==5) location.href="/Ver2/info/";

	else if(Num ==11) location.href="/Ver2/about/";
	else if(Num ==12) location.href="/Ver2/about/office.asp";

	else if(Num ==21) location.href="/Ver2/walnut/";
	else if(Num ==22) location.href="/Ver2/walnut/cultivation.asp";

	else if(Num ==32) location.href="/Ver2/nutrition/california.asp";
	else if(Num ==33) location.href="/Ver2/nutrition/nutrition.asp";
	else if(Num ==34) location.href="/Ver2/nutrition/barcelona.asp";
	else if(Num ==35) location.href="/Ver2/nutrition/fda.asp";
	else if(Num ==36) location.href="/Ver2/nutrition/PennyChris.asp";

	else if(Num ==41) location.href="/Ver2/recipe/";
	else if(Num ==42) location.href="/Ver2/recipe/consumer.asp";

	/* ¼ÒºñÀÚ Á¾·ùº° ¿ä¸®¹ý */
	else if(Num ==421) location.href="/Ver2/recipe/Consumer/korean/korean.asp";
	else if(Num ==422) location.href="/Ver2/recipe/Consumer/appetizer/appetizer.asp";
	else if(Num ==423) location.href="/Ver2/recipe/Consumer/bread/bread.asp";
	else if(Num ==424) location.href="/Ver2/recipe/Consumer/spice/spice.asp";
	else if(Num ==425) location.href="/Ver2/recipe/Consumer/dessert/dessert.asp";
	else if(Num ==426) location.href="/Ver2/recipe/Consumer/entre/entre.asp";
	else if(Num ==427) location.href="/Ver2/recipe/Consumer/salad/salad.asp";
	else if(Num ==428) location.href="/Ver2/recipe/Consumer/sidedish/sidedish.asp";
	else if(Num ==429) location.href="/Ver2/recipe/Consumer/snack/snack.asp";
	else if(Num ==430) location.href="/Ver2/recipe/seminar/lee_seminar.asp";
	else if(Num ==431) location.href="/Ver2/recipe/seminar/chin_seminar.asp";
	else if(Num ==432) location.href="/Ver2/recipe/seminar/la_seminar.asp";
	else if(Num ==433) location.href="/Ver2/recipe/seminar/leebo_seminar.asp";
	
	/* Àü¹®°¡ Á¾·ùº° ¿ä¸®¹ý */
	else if(Num ==43) location.href="/Ver2/recipe/";
	else if(Num ==44) location.href="/Ver2/recipe/bread/bread.asp";
	else if(Num ==45) location.href="/Ver2/recipe/muffin/muffin.asp";
	else if(Num ==46) location.href="/Ver2/recipe/rene/rene.asp";
	else if(Num ==47) location.href="/Ver2/recipe/seminar/seminar.asp";
	else if(Num ==48) location.href="/Ver2/recipe/seminar/boris_seminar.asp";
	else if(Num ==49) location.href="/Ver2/recipe/seminar/jpcal.asp";

	else if(Num ==51) location.href="/Ver2/info/";

	else if(Num ==51) location.href="/Ver2/info/";
	else if(Num ==512) location.href="/Ver2/info/import.asp";
	else if(Num ==513) location.href="/Ver2/info/california.asp";
	else if(Num ==514) location.href="/Ver2/info/standard_default.asp";
	else if(Num ==515) location.href="/Ver2/info/export.asp";


	else if(Num ==52) location.href="/Ver2/info/consist.asp";
	else if(Num ==53) location.href="/Ver2/info/amino.asp";
	else if(Num ==54) location.href="/Ver2/info/oil.asp";
	else if(Num ==55) location.href="/Ver2/info/standard.asp";
	else if(Num ==56) location.href="/Ver2/info/chemical.asp";

	else if(Num ==61) location.href="/Ver2/privacy/";
	else if(Num ==62) location.href="/Ver2/FAQ/";
	else if(Num ==63) location.href="/Ver2/contact/";

	/* °øÁö»çÇ× */
	else if(Num ==99) location.href="/Ver2/Notice/";
	
}



// ÇÃ·¡½¬ ¾×Æ¼ºê X  ÆÐÄ¡
function ActiveXchk(id) 
{ 
	var obj = id.innerHTML; 
	obj = obj.replace("<!--", ""); 
	obj = obj.replace("-->" , ""); 
	document.write(obj); id.id=""; 
} 

//½ºÅ©·Ñ¹öÆ°
function CheckUIElements() {
  var yMenu1From, yMenu1To, yOffset, timeoutNextCheck;
  var wndWidth = parseInt(document.body.clientWidth);
  yMenu1From   = parseInt (qLayer.style.top, 10);
  yMenu1To     = document.body.scrollTop + 580; // À§ÂÊ À§Ä¡
  timeoutNextCheck = 500;

  if ( yMenu1From != yMenu1To ) {
    yOffset = Math.ceil( Math.abs( yMenu1To - yMenu1From ) / 20 );
    if ( yMenu1To < yMenu1From )
      yOffset = -yOffset;

    qLayer.style.top = parseInt (qLayer.style.top, 10) + yOffset;

    timeoutNextCheck = 10;
  }
  qLayer.style.left = 960;
  setTimeout ("CheckUIElements()", timeoutNextCheck);
}

function MovePosition() {
  var wndWidth = parseInt(document.body.clientWidth);

  // ÆäÀÌÁö ·Îµù½Ã Æ÷Áö¼Ç
  qLayer.style.top = 580;
  qLayer.style.left = 960;
  qLayer.style.visibility = "visible";

  // initializing UI update timer
  CheckUIElements();
  return true;
}
