var host = "http://" + document.location.host + "/kor/index.html"
var pname = document.location.href;
var main_v = 0;
if(!pname.indexOf(host)) {
	main_v = -170;
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  if(selObj.options[selObj.selectedIndex].value) {
	  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  }
  if (restore) selObj.selectedIndex=0;
}

	var isDOM = (document.getElementById ? true : false); 
    var isIE4 = ((document.all && !isDOM) ? true : false); 
    var isNS4 = (document.layers ? true : false); 
    var isNS = navigator.appName == "Netscape"; 
	function getRef(id) { 
            if (isDOM) return document.getElementById(id); 
            if (isIE4) return document.all[id]; 
            if (isNS4) return document.layers[id]; 
    } 
    function moveRightEdge() { 
			var divMenu = getRef('divMenu'); 
			var yMenuFrom, yMenuTo, yOffset, timeoutNextCheck; 
            if (isNS4) { 
                    yMenuFrom   = divMenu.top; 
                    yMenuTo     = windows.pageYOffset +250 ;   // À§ÂÊ À§Ä¡ 
            } else if (isDOM) { 
                    yMenuFrom   = parseInt (divMenu.style.top, 10); 
                    yMenuTo     = (isNS ? window.pageYOffset : document.body.scrollTop) + 250 + main_v; // À§ÂÊ À§Ä¡ 
            } 
            timeoutNextCheck = 500; 
            if (yMenuFrom != yMenuTo) { 
                    yOffset = Math.ceil(Math.abs(yMenuTo - yMenuFrom) / 20); 
                    if (yMenuTo < yMenuFrom) 
                            yOffset = -yOffset; 
                    if (isNS4) 
                            divMenu.top += yOffset; 
                    else if (isDOM) 
						//±âÁØÀÌÇÏ·Î ³»·Á°¡Áö ¾Êµµ·Ï ¼³Á¤                  ¦£¦¡ ÀÌ ¼ýÀÚ¸¦ º¯°æ
	                    if(parseInt (divMenu.style.top, 10) < imgh.height-280 || imgh.height > parseInt(document.body.clientHeight+document.body.scrollTop)) {
							divMenu.style.top = parseInt (divMenu.style.top, 10) + yOffset;
						}
                            timeoutNextCheck = 10; 
            } 
            setTimeout ("moveRightEdge()", timeoutNextCheck); 
			//alert(parseInt (divMenu.style.top, 10)+","+document.body.scrollTop)
    } 
/*     
window.onload = function() {
    if (isNS4) { 
            var divMenu = document["divMenu"]; 
            divMenu.top = top.pageYOffset +10; 
            divMenu.visibility = "visible"; 
            moveRightEdge(); 
    } else if (isDOM) { 
			var divMenu = getRef('divMenu'); 
            divMenu.style.top = (isNS ? window.pageYOffset : document.body.scrollTop) + 250 + main_v; 
            divMenu.style.visibility = "visible"; 
            moveRightEdge(); 
    } 
}
*/
function NewWindow(mypage,myname,w,h,scroll){ 
  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  var settings  ='height='+h+',';
      settings +='width='+w+',';
      settings +='top='+wint+',';
      settings +='left='+winl+',';
      settings +='scrollbars='+scroll+',';
      settings +='resizable=no';
	  settings +='directories=no';
	  settings +='titlebar=no';
	  settings +='toolbar=no';
	  settings +='location=no';
	  settings +='menubar=no';
  win=window.open(mypage,myname,settings);
//  if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}

function goboard(p) {
	document.location.href='/tempst_bbs/basic/board_list.php?tbname='+p
}

function number_check(f){
		if((event.keyCode<8)||(event.keyCode>9 && event.keyCode<13)||(event.keyCode>13 && event.keyCode<37)||(event.keyCode>37 && event.keyCode<39)||(event.keyCode>39 && event.keyCode<46)||(event.keyCode>57 && event.keyCode<96)||(event.keyCode>105 && event.keyCode<109)||(event.keyCode>110 && event.keyCode<189)||(event.keyCode>190)){
			event.returnValue=false;
		}
}

function isEmpty( data ){
    for ( var i = 0 ; i < data.length ; i++ ){
        if ( data.substring( i, i+1 ) != " " )
            return false;
    }
    return true;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function setCookie( name, value, expiredays )
{
	var todayDate = new Date();
	todayDate.setDate( todayDate.getDate() + expiredays );
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}
function getCookie( name )
{
	var nameOfCookie = name + "=";
	var x = 0;
	while ( x <= document.cookie.length )
	{
		var y = (x+nameOfCookie.length);
		if ( document.cookie.substring( x, y ) == nameOfCookie ) {
			if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
				endOfCookie = document.cookie.length;
			return unescape( document.cookie.substring( y, endOfCookie ) );
		}
		x = document.cookie.indexOf( " ", x ) + 1;
		if ( x == 0 )
			break;
	}
	return "";
}

//***********************************************************************************************
//************************************   IE ÆÐÄ¡   **********************************************
//***********************************************************************************************
function  viewMediaPlayer(sURL, sName, sFeatures){ 

 //¹Ìµð¾î ÇÃ·¹ÀÌ¾î ¿ÀºêÁ§Æ®¸¦ »Ñ·ÁÁÝ´Ï´Ù. 
 //¹Ìµð¾î ÇÃ·¹ÀÌ¾î ¹öÀüÀº 7~10 ¹öÀü¿¡ È£È¯µÇ´Â ¿ÀºêÁ§Æ®ID¸¦ »ç¿ëÇÕ´Ï´Ù. 
 var WMPCID = "clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95"; 

 var sFeature; 
 var sWidth  = "100%"; 
 var sHeight  = "100%"; 
 var pmBoolean; 
 var sTempArray; 
 var sParamTag = ""; 

 sFeature = sFeatures.split(/\s*,\s*/); 
 for (var i=0; i< sFeature.length ; i++) 
 { 
  sTempArray = sFeature[i].split(/\s*=\s*/); 
  if (sTempArray[0].toLowerCase() == "width"){ 
  //³ÐÀÌ 
  sWidth = sTempArray[1]; 
  }else if (sTempArray[0].toLowerCase() == "height"){ 
  //³ôÀÌ 
  sHeight = sTempArray[1]; 
  }else{ 
  //±âÅ¸ ÆÄ¶ó¸ÞÅÍ Ã³¸® 
  if (sTempArray[1].toLowerCase() == "yes" || sTempArray[1] == "1" || sTempArray[1].toLowerCase() == "true"){ 
    pmBoolean = "true"; 
  }else if (sTempArray[1].toLowerCase() == "no" || sTempArray[1] == "0" || sTempArray[1].toLowerCase() == "false"){ 
    pmBoolean = "false"; 
  }else{ 
    pmBoolean = sTempArray[1]; 
  } 
  sParamTag = "<PARAM NAME='"+sTempArray[0]+"'VALUE='" + pmBoolean + "'>\n"+sParamTag; 
  sParamTag_FF = sTempArray[0]+"='"+pmBoolean+"' "+sParamTag_FF;
  } 
 } 

 document.writeln("<OBJECT ID='"+sName+"' NAME='"+sName+"' CLASSID='"+WMPCID+"' WIDTH='"+sWidth+"' HEIGHT='"+sHeight+"' >"); 
 document.writeln("<PARAM NAME='FileName' VALUE='" + sURL + "'>"); 
 document.writeln(sParamTag); 
 document.writeln("<embed src='" + sURL + "' WIDTH='"+sWidth+"' HEIGHT='"+sHeight+"' "+sParamTag_FF+" pluginspage='http://www.microsoft.com/windows/windowsmedia/download/'>"); 
 document.writeln("</OBJECT>"); 
} 

function  viewFlash(sURL, sName, sFeatures, sFlag){ 

 //ÇÃ·¡½Ã ActiveX ¿ÀºêÁ§Æ®¸¦ »Ñ·ÁÁÝ´Ï´Ù. 
 var FLASHCAB = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"; 
 var FLASHCID = "CLSID:D27CDB6E-AE6D-11CF-96B8-444553540000"; 
 var FLASHVER = "8,0,0,0"; 

 var sFeature; 
 var sWidth  = "100%"; 
 var sHeight  = "100%"; 
 var pmBoolean = "false"; 
 var sTempArray; 
 var sParamTag = ""; 
 var sParamTag_FF = "";
 sFeature = sFeatures.split(/\s*,\s*/); 
 for (var i=0; i< sFeature.length ; i++) 
 { 
  sTempArray = sFeature[i].split(/\s*=\s*/); 
  if (sTempArray[0].toLowerCase() == "width"){ 
  //³ÐÀÌ 
  sWidth = sTempArray[1]; 
  }else if (sTempArray[0].toLowerCase() == "height"){ 
  //³ôÀÌ 
  sHeight = sTempArray[1]; 
  }else{ 
  //±âÅ¸ ÆÄ¶ó¸ÞÅÍ Ã³¸® 
  if (sTempArray[1].toLowerCase() == "yes" || sTempArray[1] == "1" || sTempArray[1].toLowerCase() == "true"){ 
    pmBoolean = "true"; 
  }else if (sTempArray[1].toLowerCase() == "no" || sTempArray[1] == "0" || sTempArray[1].toLowerCase() == "false"){ 
    pmBoolean = "false"; 
  }else{ 
    pmBoolean = sTempArray[1]; 
  } 
  sParamTag = "<PARAM NAME='"+sTempArray[0]+"'VALUE='" + pmBoolean + "'>\n"+sParamTag; 
  sParamTag_FF = sTempArray[0]+"='"+pmBoolean+"' "+sParamTag_FF;
  } 
 } 

 if(sFlag) {
 document.writeln("<OBJECT ID='"+sName+"' NAME='"+sName+"' CLASSID='"+FLASHCID+"' CODEBASE='"+FLASHCAB+"#version="+FLASHVER+"' WIDTH='"+sWidth+"' HEIGHT='"+sHeight+"'>"); 
 document.writeln("<PARAM NAME='movie' VALUE='" + sURL + "'>"); 
 document.writeln(sParamTag); 
 document.writeln("<EMBED SRC='"+sURL+"' ID='"+sName+"' NAME='"+sName+"' WIDTH='"+sWidth+"' HEIGHT='"+sHeight+"' "+sParamTag_FF+" TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer' />") 
 document.writeln("</OBJECT>"); 
 }
} 

function jumincheck(u_jumin1,u_jumin2){       
	check_jumin = false;
	b_year = (u_jumin2.charAt(0)<="2")?"19":"20";
	b_year += u_jumin1.substr(0,2);
	b_month = u_jumin1.substr(2,2)-1;
	b_date = u_jumin1.substr(4,2);
	b_sum = new Date(b_year,b_month,b_date);
	if(b_sum.getYear()%100 != u_jumin1.substr(0,2) || b_sum.getMonth() != b_month || b_sum.getDate() != b_date){
		return check_jumin;
	}
	total = 0;
	temp = new Array(13);
	for(i=1;i<=6;i++)temp[i]=u_jumin1.charAt(i-1);
	for(i=7;i<=13;i++)temp[i]=u_jumin2.charAt(i-7);
	for(i=1;i<=12;i++){
		k=i+1;
		if(k>=10)k=k%10+2;
		total=total+(temp[i]*k);
	}
	last_num=(11-(total%11))%10;
	if(last_num==temp[13]) {
		check_jumin=true;
	}
	else {
		check_jumin=false;
	}
	return check_jumin
}

function checkemail(str){ 
  var supported = 0; 
  if (window.RegExp) { 
    var tempStr = "a"; 
    var tempReg = new RegExp(tempStr); 
    if (tempReg.test(tempStr)) supported = 1; 
  } 
  if (!supported) 
    return (str.indexOf(".") > 2) && (str.indexOf("@") > 0); 

  var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)"); 
  var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$"); 
  return (!r1.test(str) && r2.test(str)); 
}

function checkid(u_id){
	if(u_id.length < 4){
		alert("¾ÆÀÌµð´Â 4ÀÚ¸®¿¡¼­ 12ÀÚ¸®»çÀÌ·Î ÀÔ·ÂÇÏ¼¼¿ä!");
		return false;
	}
	
	var alpa = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
	var firstword = u_id.charAt(0);
	for (k=0 ; k<alpa.length ;k++) if (firstword == alpa.charAt(k)) break;
	if (k == alpa.length){
		alert("¾ÆÀÌµðÀÇ Ã¹±ÛÀÚ´Â ¿µ¹®ÀÚ·Î ½ÃÀÛÇØÁÖ¼¼¿ä!");
		return false;
	}
	
	var str = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
	for (i=0;i<u_id.length; i++) 
	{
		idcheck = u_id.charAt(i);		
		for (j=0;j<str.length;j++) if (idcheck == str.charAt(j)) break;		
		if (j == str.length){
			alert("¾ÆÀÌµð´Â ¿µ¹®ÀÚ¿Í ¼ýÀÚ¸¸À¸·Î Àû¾îÁÖ¼¼¿ä!");
			return false;
		}
	}		
	return true;
}

function checkpwd(u_pwd){
	if(u_pwd.length < 4){
		alert("ÆÐ½º¿öµå´Â 4ÀÚ¸®¿¡¼­ 12ÀÚ¸®»çÀÌ·Î ÀÔ·ÂÇÏ¼¼¿ä!");
		return false;
	}
	
	var str = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
	for (i=0;i<u_pwd.length; i++) 
	{
		idcheck = u_pwd.charAt(i);		
		for (j=0;j<str.length;j++) if (idcheck == str.charAt(j)) break;		
		if (j == str.length){
			alert("ÆÐ½º¿öµå´Â ¿µ¹®ÀÚ¿Í ¼ýÀÚ¸¸À¸·Î Àû¾îÁÖ¼¼¿ä!");
			return false;
		}
	}		
	return true;
}

//¾ÆÀÌµð Çü½Ä Ã¼Å©ÇÔ¼ö ¿µ¹®
function checkiden(u_id){
	if(u_id.length < 4){
		alert("ID should be between 4 and 12 alphabets or numbers!");
		return false;
	}
	
	var alpa = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
	var firstword = u_id.charAt(0);
	for (k=0 ; k<alpa.length ;k++) if (firstword == alpa.charAt(k)) break;
	if (k == alpa.length){
		alert("Please start an English letter at the first ID initial.");
		return false;
	}
	
	var str = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
	for (i=0;i<u_id.length; i++) 
	{
		idcheck = u_id.charAt(i);		
		for (j=0;j<str.length;j++) if (idcheck == str.charAt(j)) break;		
		if (j == str.length){
			alert("Please make your ID with English letters and numbers.");
			return false;
		}
	}		
	return true;
}

//ÆÐ½º¿öµå Çü½Ä Ã¼Å©ÇÔ¼ö ¿µ¹®
function checkpwden(u_pwd){
	if(u_pwd.length < 4){
		alert("Password should be between 4 and 12 alphabets or numbers!");
		return false;
	}
	
	var str = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
	for (i=0;i<u_pwd.length; i++) 
	{
		idcheck = u_pwd.charAt(i);		
		for (j=0;j<str.length;j++) if (idcheck == str.charAt(j)) break;		
		if (j == str.length){
			alert("Please make your Password with English letters and numbers.");
			return false;
		}
	}		
	return true;
}


function topmenu_en(m1,m2) {
	switch (m1)	{
		case "1":
			switch (m2)	{
				case "0":
					document.location.href="/en/company/ceo.html";
					break;		
				case "1":
					document.location.href="/en/company/ci.html";
					break;		
				case "2":
					document.location.href="/en/company/ceo.html";
					break;		
				case "3":
					document.location.href="/en/company/history.html";
					break;		
/*				case "4":
					document.location.href="/en/company/ci.html";
					break;		
				case "5":
					document.location.href="/en/company/philosophy.html";
					break;		
				case "6":
					document.location.href="/en/company/location.html";
					break;		
*/
}
			break;	
		case "2":
			switch (m2)	{
				case "0":
					document.location.href="/en/contact/sales.html";
					break;		
				case "1":
					document.location.href="/en/contact/sales.html";
					break;		
				case "2":
					document.location.href="/en/contact/tech.html";
					break;		
				case "3":
					document.location.href="/en/contact/location.html";
					break;		
			}
			break;	
		case "3":
			switch (m2)	{
				case "0":
					document.location.href="/en/product/pmain.html";
					break;	
				case "1":
					document.location.href="/en/product/jump.html";
					break;	
			    case "2":
					document.location.href="/en/product/fruit.html";
					break;
				case "3":
					document.location.href="/en/product/cube.html";
					break;
				case "4":
					document.location.href="/en/product/penalty.html";
					break;
			}
			break;	
		case "4":
			switch (m2)	{
				case "0":
					document.location.href="/tempst_bbs/ebasic/board_list.php?tbname=enews";
					break;		
				case "1":
					document.location.href="/tempst_bbs/ebasic/board_list.php?tbname=enews";
					break;		
				case "2":
					document.location.href="/tempst_bbs/ebasic/board_list.php?tbname=evideo";
					break;		
			}
			break;	
		case "5":
			switch (m2)	{
				case "0":
					document.location.href="/en/support/";
					break;		
				case "1":
					document.location.href="/tempst_bbs/ebasic/board_list.php?tbname=edown";
					break;		
				case "2":
//					document.location.href="/tempst_bbs/ebasic/board_list.php?tbname=efaq";
					alert("Services Coming Soon");
					break;		
//Q&A
				case "3":
//					document.location.href="#";
					alert("Services Coming Soon");
					break;		
			}
			break;	
		case "6":
			switch (m2)	{
				case "0":
					document.location.href="/mall/";
					break;		
				case "1":
					document.location.href="/tempst_bbs/ebasic/board_list.php?tbname=edown";
					break;		
				case "2":
//					document.location.href="/tempst_bbs/ebasic/board_list.php?tbname=efaq";
					alert("Services Coming Soon");
					break;		
//Q&A
				case "3":
//					document.location.href="#";
					alert("Services Coming Soon");
					break;		
			}
			break;	
	}
}

function topmenukr(m1,m2) {
	switch (m1)	{
		case "1":
			switch (m2)	{
				case "1":
					document.location.href="/kor/andamiro/greeting.html";
					break;		
				case "2":
					document.location.href="/kor/andamiro/organization.html";
					break;		
				case "3":
					document.location.href="/kor/andamiro/history.html";
					break;		
				case "4":
					document.location.href="/kor/andamiro/vision.html";
					break;		
				case "5":
					document.location.href="/tempst_bbs/basic/board_list.php?tbname=recruit";
					break;		
				case "6":
					document.location.href="/kor/andamiro/contactus.html";
					break;		
			}
			break;	
		case "2":
			switch (m2)	{
				case "1":
					document.location.href="/kor/business/division.html";
					break;		
				case "2":
					document.location.href="/kor/business/enter.html";
					break;		
				case "3":
					document.location.href="/kor/business/development.html";
					break;		
				case "4":
					document.location.href="/kor/business/accessory.html";
					break;		
			}
			break;	
		case "3":
			switch (m2)	{
				case "1":
					document.location.href="/kor/products/amuse.html";
					break;	
			    case "2":
					document.location.href="/kor/products/machine.html";
					break;
			    case "3":
					document.location.href="/kor/products/accessory.html";
					break;
			}
			break;	
		case "5":
			switch (m2)	{
				case "0":
					//document.location.href="/kor/support/as.html?tbname=as&divpage=0&mode=write";
					document.location.href="/kor/support/main.html";
					break;		
				case "1":
					document.location.href="/tempst_bbs/basic/board_list.php?tbname=down";
					break;		
				case "2":
					document.location.href="/tempst_bbs/basic/board_list.php?tbname=faq";
					break;		
				case "3":
					document.location.href="/kor/support/qna.html?tbname=qna&divpage=0&mode=write";
					break;		
			}
			break;	
		case "4":
			switch (m2)	{
				case "0":
					document.location.href="/kor/pr/board.html";
					break;		
				case "1":
					document.location.href="/tempst_bbs/basic/board_list.php?tbname=news";
					break;		
				case "2":
					document.location.href="/tempst_bbs/basic/board_list.php?tbname=video";
					break;		
				case "3":
					document.location.href="/tempst_bbs/basic/board_list.php?tbname=photo";
					break;		
			}
			break;	
	}
}

function m_quick(m1) {
		switch (m1)	{
			case "1":
				document.location.href="/mall/wizbag.php";
				break;		
			case "2":
				document.location.href="/mall/wizmember.php?query=mypage";
				break;		
			case "3":
				document.location.href="/tempst_bbs/basic/board_list.php?tbname=eqna";
				break;		
			case "4":
				document.location.href="/tempst_bbs/basic/board_list.php?tbname=efaq";
				break;		
			case "5":
				document.location.href="#";
				break;		
		}
}

function home() {
	top.location.href="/en"
}

function sendform(method)
{
	var f = document.sform;
	f.category.value = method;
	f.submit();
}


