function LoadLink(Idx)
{
	var LoadURL = "";
	if(Idx =="0")
	{
		LoadURL = "/main.asp";
	}
	else if(Idx.substring(0,1) =="1")
	{
		switch(Idx)
		{
			case "11" : 
				LoadURL = "/company/intro.asp ";
				break;
			case "12" :
				LoadURL = "/company/business.asp";
				break;
			case "13" :
				LoadURL = "/company/history.asp";
				break;
			case "14" : 
				LoadURL = "/company/vision.asp ";
				break;
			case "15" : 
				LoadURL = "/company/organization.asp ";
				break;
			case "16" : 
				LoadURL = "/company/ir_premiumasp1.asp";
				break;
			default :
				LoadURL = "/company/intro.asp";
				break;
		}
	}
	else if(Idx.substring(0,1) =="2") //movie
	{
		switch(Idx)
		{
			case "21" : 
				LoadURL = "/b_movie/b_movie_s_introduction.asp";
				break;
			case "22" :
				LoadURL = "/b_movie/b_movie_nowplaying.asp";
				break;
			case "23" :
				LoadURL = "/b_movie/b_movie_comingsoon.asp";
				break;
			case "24" : 
				LoadURL = "/b_movie/b_movie_library.asp";
				break;
			case "25" : 
				LoadURL = "/b_movie/press_list.asp ";
				break;
			case "26" : 
				LoadURL = "/b_movie/notice_list.asp";
				break;
			default :
				LoadURL = "/b_movie/b_movie_main.asp";
				break;
		}
	}
	else if(Idx.substring(0,1) =="3") //drama
	{
		LoadURL = "/b_drama/b_drama_main.asp";
		switch(Idx)
		{
			case "31" : 
				LoadURL = "/b_drama/b_drama_s_introduction.asp";
				break;
			case "32" :
				LoadURL = "/b_drama/b_drama_nowplaying.asp";
				break;
			case "33" :
				LoadURL = "/b_drama/b_drama_comingsoon.asp";
				break;
			case "34" : 
				LoadURL = "/b_drama/b_drama_library.asp";
				break;
			case "35" : 
				LoadURL = "/b_drama/press_list.asp ";
				break;
			case "36" : 
				LoadURL = "/b_drama/notice_list.asp";
				break;
			default :
				LoadURL = "/b_drama/b_drama_main.asp";
				break;
		}
	}
	else if(Idx.substring(0,1) =="4") //menagement
	{
		switch(Idx)
		{
			case "41" : 
				LoadURL = "/bm_star/b_star_s_introduction.asp";
				break;
			case "42" : 
				LoadURL = "/bm_star/bm_star.asp";
				break;
			case "43" : 
				LoadURL = "/bm_star/press_list.asp";
				break;
			case "44" : 
				LoadURL = "/bm_star/notice_list.asp";
				break;
			default  : 
				LoadURL = "bm_star/b_management_main.asp";
				break;
		}

	}
	else if(Idx.substring(0,1) =="5")
	{
		switch(Idx)
		{
			case "51" : 
				LoadURL = "/community/press_list.asp";
				break;
			case "52" : 
				LoadURL = "/community/notice_list.asp";
				break;
			case "53" : 
				LoadURL = "/community/qna.asp";
				break;
			case "54" : 
				LoadURL = "/community/freeboard_list.asp";
				break;
			default  : 
				LoadURL = "/community/press_list.asp";
				break;
		}

	}
	if (LoadURL != "")
		location.href=LoadURL;
}
//===============================================================
//	ÁÖ¹Îµî·Ï¹øÈ£ Ã¼Å©	
//===============================================================
function IsValidJumin(str,ctype)
{
	var rpStr = "";
	for(var i = 0; i < str.length; i++) 
	{
		var chr = str.substr(i,1);         
		if(chr == ctype) {continue;}
		if(chr < '0' || chr > '9') {return 1;}
		rpStr += chr;
	}
	if(rpStr == "")
	{
		return 1;
	}
	str = rpStr;

	n1 = str.substring(0,6);
	n2 = str.substring(6,13);
  var curDate;  
 	var curYear;
	var curMonth; 
 	var birthYear = 0;            
	var birthMonth = 0;           
 	var Sum = 0; 
	var Mod = 0; 
	var YearIn = 0; 
	var MonthIn = 0; 
	var DateIn = 0; 
	curDate = new Date();         
	curYear = curDate.getYear();  
	curMonth = curDate.getMonth() + 1;  
  var regno = n1 + "-" + n2;          
  for( i = 0 ; i < 13 ; i++ ) { 
        if( i == 0) 
          YearIn+=parseInt(regno.charAt(i))*10; 
        if( i == 1) 
          YearIn+=parseInt(regno.charAt(i)); 
        if( i == 2) 
          MonthIn+=parseInt(regno.charAt(i))*10; 
        if( i == 3) 
          MonthIn+=parseInt(regno.charAt(i)); 
        if( i == 4) 
          DateIn+=parseInt(regno.charAt(i))*10; 
        if( i == 5) 
          DateIn+=parseInt(regno.charAt(i)); 
        if( i < 6) 
          Sum+=parseInt(regno.charAt(i))*(i+2); 
        if( i > 6 && i < 9 ) 
          Sum+=parseInt(regno.charAt(i))*(i+1); 
        if( i > 8) 
          Sum+=parseInt(regno.charAt(i))*(i-7); 
    } 

   Mod=11-(Sum % 11);                  
   if((11-(Sum % 11)) >= 10) Mod -= 10; 

   if( Mod!=parseInt(regno.charAt(13)) ) {
     return 2; 
     } 
   if( MonthIn < 1 || MonthIn > 12 || DateIn < 1 || DateIn > 31 ) { 
    return 3; 
   } 
   if( (MonthIn ==4 || MonthIn == 6 || MonthIn == 9 || MonthIn == 11 ) && DateIn > 30 ){
     return 4; 
   } 
   if( MonthIn == 2 && DateIn > 29 ) {
           return 5; 
     } 
	return 0;
}

//===============================================================
//trim °´Ã¼·Î.. string.trim(); À¸·Î »ç¿ëÇÏ¸é µÈ´Ù.
//===============================================================
String.prototype.trim = function()
{
	return this.replace(/^\s*(\b.*\b|)\s*$/, "$1");
}
//===============================================================
//ID °¡´É °Ë»ç °´Ã¼·Î..  
//===============================================================
String.prototype.isid = function() {
	 var numberExp =	/^[A-Za-z0-9_-]{3,20}$/;

	return numberExp.test(this);

}
//===============================================================
//¾ËÆÄºª °¡´É °Ë»ç °´Ã¼·Î..  
//===============================================================
String.prototype.isalpha = function() {
	if (this.search(/[^A-Za-z]/) == -1)
	 return true;
	else
	 return false;
}
//===============================================================
//¼ýÀÚ °¡´É °Ë»ç °´Ã¼·Î..  
//===============================================================
String.prototype.isnumber = function() {
	if (this.search(/[^0-9]/) == -1)
	 return true;
	else
	 return false;
}
//===============================================================
//ÀÌ¸ÞÀÏ °¡´É °Ë»ç °´Ã¼·Î..  
//===============================================================
String.prototype.isemail = function() {
	 var numberExp =	/^\w[@]\w{1,}[.]\w{1,}[.]*\w{1,}$/;
	return numberExp.test(this);
}
function IsStrEmail(data)
{
	var numberExp =  /^[a-zA-Z]{1,}[0-9a-zA-Z_-]{1,}[.]{0,1}[0-9a-zA-Z_-]{1,}[@][0-9a-zA-Z_-]{1,}[.][0-9a-zA-Z_-]{1,}[.]*[0-9a-zA-Z_-]{1,}$/;
	return numberExp.test(data);
}
//===============================================================
//	Æù¹øÈ£ Ã¼Å©	ÂüÀÏ°æ¿ì 0 °ÅÁþÀÏ°æ¿ì 1¸¦ ¸®ÅÏ
//===============================================================
function IsValidCellPhone(data){
	data = data.replace(/\-/gi, "");
	var cellphoneExp = /^0\d{1,3}\d{3,4}\d{4}$/;
	return cellphoneExp.test(data)
}
//===============================================================
//	ÇÚµåÆù¹øÈ£ Ã¼Å©	ÂüÀÏ°æ¿ì 0 °ÅÁþÀÏ°æ¿ì 1¸¦ ¸®ÅÏ
//===============================================================
function IsValidHPhone(data){
	data = data.replace(/\-/gi, "");
	var cellphoneExp = /^01[016789]\d{3,4}\d{4}$/;
	return cellphoneExp.test(data)
}
//===============================================================
//	ÇÚµåÆù¹øÈ£ »ç¿ë±ÝÁö Ã¼Å©	ÂüÀÏ°æ¿ì 0 °ÅÁþÀÏ°æ¿ì 1¸¦ ¸®ÅÏ
//===============================================================
function SMSHPhone(data){
	for(SCount = 0 ; SCount < NotPhoneList.length;SCount++)
	{
		if(NotPhoneList[SCount] == data)
			return false;
	}
	return true;
}
function main_open() {
	window.open("main.html","kenox_main","width="+screen.availWidth+",height="+screen.availHeight+",scrollbars=0");
}
function End_Festival()
{
	oDiv.style.setExpression("left", "document.body.clientWidth/2 - oDiv.offsetWidth/2"); // ·¹ÀÌ¾îÀÇ x Ãà À§Ä¡¸¦ ¼³Á¤ ÇÕ´Ï´Ù
	oDiv.style.setExpression("top", "(document.body.clientHeight/2 - oDiv.offsetHeight/2)+30"); // ·¹ÀÌ¾îÀÇ yÃà À§Ä¡¸¦ ¼³Á¤ ÇÕ´Ï´Ù
	oDiv.style.display="";
	document.all.UserReg.src="Ent_festival_02_user.asp";
	return;
}
function Select_Post()
{
	oDiv1.style.setExpression("left", "(document.body.clientWidth/2 - oDiv1.offsetWidth/2)+100"); // ·¹ÀÌ¾îÀÇ x Ãà À§Ä¡¸¦ ¼³Á¤ ÇÕ´Ï´Ù
	oDiv1.style.setExpression("top", "(document.body.clientHeight/2 - oDiv1.offsetHeight/2)-60"); // ·¹ÀÌ¾îÀÇ yÃà À§Ä¡¸¦ ¼³Á¤ ÇÕ´Ï´Ù
	oDiv1.style.display="";
	document.all.SelectPost.src="Ent_festival_02_Post.asp";
	return;
}
//===============================================================
//	ºê¶óÀÌÁ® Áß¾Ó¿¡ ÆË¾÷ À§Ä¡
//===============================================================
function ShowPopUpWin(str,inWidth,inHeight,name,scltype)
{
	y = screen.availHeight;
	x = screen.availWidth;
	xtop = Number((y - inHeight)/2);
	xleft = Number((x - inWidth)/2);
	//±âº»°ª => ³ÐÀÌ : 443 ³ôÀÌ : 270 ==> °¡Àå ¹«³­ÇÏ´ø ³ôÀÌ¿Í ³ÐÀÌ
//	window.open("../com/PopUpDel.asp",name,"width="+inWidth+",height="+inHeight+",top="+xtop+",left="+xleft+",scrollbars="+ scltype +",toolbars=0,menubars=0,locationbars=0,resizeables=0");
	window.open(str,name,"width="+inWidth+",height="+inHeight+",top="+xtop+",left="+xleft+",scrollbars="+ scltype +",toolbars=0,menubars=0,status=1,locationbars=0,resizeables=0");
}
//===============================================================
//	ÀÌº¥Æ® ÆË¾÷
//===============================================================

//===============================================================
//	 ÀÌ¹ÌÁö »çÀÌÁî Á¶ÀýÇÔ¼ö : ÆË¾÷
//===============================================================
function _image_open(img,Width,Height){ 
	if (typeof Width == "string" && typeof Height == "string" )
	{
		_LoadviewImg(img,Width,Height);
	}
	else
	{
		foto1= new Image(); 
		foto1.src=(img); 
		_contImg(img); 
	}
} 
function _contImg(img){ 
	if((foto1.width!=0)&&(foto1.height!=0)){ 
		_LoadviewImg(img,foto1.width,foto1.height); 
	}
	else{ 
		funzione="_contImg('"+img+"')"; 
		intervallo=setTimeout(funzione,20); 
	} 
} 
function _LoadviewImg(img,Width,Height){
	var overH = "";
	var overW = "";
	var imgW=Number(Width)+2; 
	var imgH=Number(Height)+20; 
	if(imgW>screen.width-50)
		{
			imgW=screen.width-100;
			imgH += 50;
			overW="&W="+String(screen.width-100);
		}
	if(imgH>screen.height-50)
		{
			imgH=screen.height-100;
			imgW += 50;
			overH="&H="+String(screen.height-100);
		}
	if(imgW<300){imgW= 300;}
	if(imgH<300){imgH= 300;}
	stringa="scrollbars=no,resizable=no,width="+imgW+",height="+imgH+",left=0,top=0"; 
	window.open("/event/IMAGEVIEW.asp?src="+img + overH + overW,"",stringa); 
}
//document.write('<SCRIPT LANGUAGE="JavaScript" src="../js/Notkey.js"></script>');
//===============================================================
//	ÁÖ¼Ò °Ë»ö ÆË¾÷
//===============================================================
function win_zip(frm_name, frm_zip1, frm_zip2, frm_addr1, frm_addr2)
{
	url = "/info/zip.asp?frm_name="+frm_name+"&frm_zip1="+frm_zip1+"&frm_zip2="+frm_zip2+"&frm_addr1="+frm_addr1+"&frm_addr2="+frm_addr2;
	ShowPopUpWin(url,616,460,"win_zip","0");
}
function win_calendar(frm_name,objName,SetDate)
{
	url = "/info/calendar.asp?frm_name="+frm_name+"&objName="+objName+"&SetDate="+SetDate;
	ShowPopUpWin(url,240,250,"win_calendar","0");
}
function swf(src,w,h,wmode){
	html = '';
	html += '<object type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" id="param" width="'+w+'" height="'+h+'">';
	html += '<param name="movie" value="'+src+'">';
	html += '<param name="quality" value="high">';
	html += '<param name="bgcolor" value="#ffffff">';
	html += '<param name="wmode" value="'+wmode+'">';
	html += '<param name="swliveconnect" value="true">';
	html += '<embed src="'+src+'" quality=high bgcolor="#ffffff" width="'+w+'" height="'+h+'" swliveconnect="true" id="param" name="param" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"><\/embed>';
	html += '<\/object>';
	document.write(html);
}
function MoviePlayer(URL,w,h)
{

var info= '<object name="player" id="player" hideFocus title classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="application/x-oleobject" STANDBY="Microsoft Windows Media Player ±¸¼º¿ä¼Ò¸¦ ÀÐ´ÂÁßÀÔ´Ï´Ù." VIEWASTEXT width="'+w+'" height="'+h+'">' +
'<param NAME="URL" value="'+URL+'" >' + 
'<param NAME="playCount" value="1">' + 
'<param NAME="enableContextMenu" VALUE="0">' + 
'<param NAME="currrentMarker" VALUE="0">' + 
'<param NAME="ShowStatusBar" VALUE="1">' + 
'<param NAME="currentPosition" VALUE="0">' + 
'<param NAME="defaultFrame" value="0">' + 
'<param NAME="ShowDisplay" value="0">' + 
'<param NAME="backgroundColor" VALUE="2566468">' + 
'<param NAME="DisplayForeColor" VALUE="15264680">' + 
//'<param NAME="uiMode" VALUE="none">' + 
'<param NAME="EnableContextMenu" Value="0">' + 
'<param NAME="stretchToFit" Value="true">' + 
'</object>';
document.write(info);

}
function Gall_Pop(Cidx,Viewidx)
{
	url = "/b_drama/gallery_popup.asp?idx="+Cidx+"&Viewidx="+Viewidx;
	ShowPopUpWin(url,558,580,"win_zip","0");
}
