document.onkeypress = keydw;

function keydw()
{
	if(event.keyCode == 13)
	{
		if(navigator.appName.charAt(0) == "N")
		{
			if(event.target.type == "text")		return false;
			else return true;
		}
		else if(navigator.appName.charAt(0) == "M")
		{
			if(event.srcElement.type == "text")	return false;
			else return true;
		}
		return true;
	}
	else
		return true; 
}

document.onfocusin = bluring;

function bluring()
{
	if(event.srcElement.tagName == "A" || event.srcElement.tagName == "IMG" || event.srcElement.type == "image") 
		document.body.focus();
}

function openToWin(url,width,height){
	window.open(url,'openToWin','toolbar=no,scrollbars=0,resizable=yes,width='+width+',height='+height+',top=200,left=300');
}


function KeyCheckSpaceNo()
{// ½ºÆäÀÌ½º ÀÔ·Â ¹æÁö
	event.returnValue = true;
	
	// 32 : ½ºÆäÀÌ½º
	if (event.keyCode == 32) event.returnValue = false;
}

function KeyCheckPhoneNumber()
{// ¼ýÀÚ/ºÎÈ£ ÀÔ·Â °¡´É
    event.returnValue = false;
    
    if (event.keyCode == 8 || event.keyCode == 13 || event.keyCode == 40 || event.keyCode == 41 || event.keyCode == 45)
    {// 8 : ¹é½ºÆäÀÌ½º, 13 : ¿£ÅÍÅ°, 40 : (±âÈ£, 41 : )±âÈ£, 45 : -±âÈ£
		event.returnValue = true;
	}
	else
	{
		if(event.keyCode >= 48 && event.keyCode <= 57) event.returnValue = true;
	}
}

function KeyCheckNumberData()
{// ¼ýÀÚ/ºÎÈ£ ÀÔ·Â °¡´É
    event.returnValue = false;
    
    if (event.keyCode == 8 || event.keyCode == 13 || event.keyCode == 43 || event.keyCode == 45 || event.keyCode == 46)
    {// 8 : ¹é½ºÆäÀÌ½º, 13 : ¿£ÅÍÅ°, 43 : +ºÎÈ£, 45 : -ºÎÈ£, 46 : .±âÈ£
		event.returnValue = true;
	}
	else
	{
		if(event.keyCode >= 48 && event.keyCode <= 57) event.returnValue = true;
	}
}

function KeyCheckOnlyNumber()
{// ¼ýÀÚ¸¸ ÀÔ·Â °¡´É
    event.returnValue = false;
    
    if (event.keyCode == 8 || event.keyCode == 13)
    {// 8 : ¹é½ºÆäÀÌ½º, 13 : ¿£ÅÍÅ°
		event.returnValue = true;
	}
	else
	{
		if(event.keyCode >= 48 && event.keyCode <= 57) event.returnValue = true;
	}
}

// ÇÑ±ÛÃ¼Å© ÇÔ¼ö Á¤ÀÇºÎºÐ
/* °ËÁõÇÒ°Í!!!!
function CheckHangul(objname) {

	var errType = '', errResult = true;
	alert(objname);
	var user_name = document.getElementById(objname);
    strarr = new Array(user_name.value.length);
    schar = new Array('/','.','>','<',',','?','}','{',' ','\\','|','(',')','+','=');

    for (i = 0; i < user_name.value.length; i++)
    {
        for (j = 0; j < schar.length; j++)
        {
            if (schar[j] == user_name.value.charAt(i))
            {
                //alert(escape(name.value.charAt(i)) );
                errType = "1";
                errResult = false;
                break;
            }
            else
                continue;
        }

        strarr[i] = user_name.value.charAt(i)
        if(errType == "")
			if ((strarr[i] >=0) && (strarr[i] <=9))
			{
					errType = "2";
					errResult = false;
					break;
			}
			else if ((strarr[i] >='a') && (strarr[i] <='z'))
			{
					errType = "3";
					errResult = false;
					break;
			}
			else if ((strarr[i] >='A') && (strarr[i] <='Z'))
			{
					errType = "4";
					errResult = false;
					break;
			}
			else if ((escape(strarr[i]) > '%60') && (escape(strarr[i]) <'%80') )
			{
					errType = "5";
					errResult = false;
					break;
			}
			else
			{
			//      alert(escape(strarr[i]) );
				continue;
			}
		}
		else
			break;
    }  

	if(errType == "1")
        alert("/ . > < , } { ? \\ | ( ) + = "+"\nÀ§ÀÇ ¹®ÀÚµéÀº Çã¿ëµÇÁö ¾Ê½À´Ï´Ù.\n"+"ÀÌ¸§Àº ÇÑ±ÛÀÔ·Â¸¸ °¡´ÉÇÕ´Ï´Ù.");
	else if(errType == "2")
            alert("ÀÌ¸§¿¡ ¼ýÀÚ°¡ ÀÖ½À´Ï´Ù. ÀÌ¸§Àº ÇÑ±ÛÀÔ·Â¸¸ °¡´ÉÇÕ´Ï´Ù.");
	else if(errType == "3")
            alert("ÀÌ¸§¿¡ ¾ËÆÄºªÀÌ ÀÖ½À´Ï´Ù. ÀÌ¸§Àº ÇÑ±ÛÀÔ·Â¸¸ °¡´ÉÇÕ´Ï´Ù.");
	else if(errType == "4")
            alert("ÀÌ¸§¿¡ ¾ËÆÄºªÀÌ ÀÖ½À´Ï´Ù. ÀÌ¸§Àº ÇÑ±ÛÀÔ·Â¸¸ °¡´ÉÇÕ´Ï´Ù.");
	else if(errType == "5")
            alert("ÀÌ¸§¿¡ Æ¯¼ö¹®ÀÚ°¡ ÀÖ½À´Ï´Ù. ÀÌ¸§Àº ÇÑ±ÛÀÔ·Â¸¸ °¡´ÉÇÕ´Ï´Ù.");

	if(errResult == false)
		user_name.focus();
}
*/



function ConfirmReg(source,args){
	if(confirm('µî·Ï ÇÏ½Ã°Ú½À´Ï±î?')){
	}else{
		args.IsValid =false;
		return false;
	}
}

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() { //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 goPerfInfoDet(jsPIIdPerf)
{
    self.location = "/Home/Perf/PerfInfoDet.aspx?IdPerf=" + jsPIIdPerf;
}

function goExpectationInfoDet(jsPIIdPerf)
{
    self.location = "/Home/Perf/ExpectationInfoDet.aspx?IdPerf=" + jsPIIdPerf;
}

function goExpectationArtistDet(jsPIIdPerf, jsPIIdPerfArtist)
{
    self.location = "/Home/Perf/ExpectationInfoDet.aspx?MenuGb=16&IdPerf=" + jsPIIdPerf + "&IdPerfArtist=" + jsPIIdPerfArtist;
}

function goPerfArtistDet
(jsPIIdPerf, jsPIIdPerfArtist)
{
    self.location = "/Home/Perf/PerfInfoDet.aspx?MenuGb=16&IdPerf=" + jsPIIdPerf + "#IdPerfArtist" + jsPIIdPerfArtist;
}

function goNormalBoardDet(jsPSDetPageName, jsPIId)
{
    self.location = "/Home/Community/" + jsPSDetPageName + "?Mode=r&Id=" + jsPIId;
}


function goSearch()
{
	var objvalue = document.getElementById("SrchTxt_text").value;
	//var SelectGenre = "";
	//if(document.all.SelGenre !=null){
	//	SelectGenre = document.getElementById("SelGenre").value;
	//}
	if(objvalue ==''){
		alert('°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä');
		return;
	}else{
		//parent.top.location.href ='/Home/Search/KeywordSearch.aspx?keyword='+objvalue+"&Genre="+SelectGenre;
		parent.top.location.href ='/Home/Search/SearchPage.aspx?SrchTxt=' + escape(objvalue);
	}
}

function goSearchEnter()
{
	if(event.keyCode==13)
	{
		goSearch();
	}
}

function ParentGo(locurl){
	parent.top.location.href = locurl;
}

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 prefix = name + "=";
	var cookieStartIndex = document.cookie.indexOf(prefix);
	if (cookieStartIndex == -1)
		return (null);
	var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length);
	if (cookieEndIndex == -1)
		cookieEndIndex = document.cookie.length;
	return (unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex)));
}

function getSubCookie(name, subname) {
	var prefix = name + "=";
	var cookieStartIndex = document.cookie.indexOf(prefix);
	if (cookieStartIndex == -1)
		return (null);
	var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length);
	if (cookieEndIndex == -1)
		cookieEndIndex = document.cookie.length;
	var cookies = unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex));
	prefix = subname + "=";
	cookieStartIndex = cookies.indexOf(prefix);
	if (cookieStartIndex == -1)
		return (null);
	cookieEndIndex = cookies.indexOf("&", cookieStartIndex + prefix.length);
	if (cookieEndIndex == -1)
		cookieEndIndex = document.cookie.length;
	return (unescape(cookies.substring(cookieStartIndex + prefix.length, cookieEndIndex)));
}


function search_start() {}
function search_start.DoPopup_2()
{
    window.open ('http://search.auction.co.kr/search/searchpopup.html','search_popup','status=no,resizable=no,width=490,height=680');
}

search_start.OnSubmit = function(frmMain){
	if(document.all.txtKeyword.value == "")
	{
		alert("°Ë»öÇÒ Ç×¸ñ¿¡ ´ëÇÑ °ªÀ» ÀÔ·ÂÇÏ¼¼¿ä");
		document.all.txtKeyword.focus();
		return false;
	}
	
	keyword_sp_char = "~`!@#$%^&*_=|\\<,>.?/{}[]:\"'";
	if(search_start.CheckSpecialChar(document.all.txtKeyword.value, keyword_sp_char) == false)
	{
		alert("Æ¯¼ö¹®ÀÚ(" + keyword_sp_char + ")¸¦ ÀÔ·ÂÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.");
		document.all.txtKeyword.focus();
		return false;
	}
	
	
	// ¹°Ç°¸í °Ë»ö
	if((document.all.optSection.selectedIndex == 0) || (document.all.optSection.selectedIndex == 1))
	{
		var IsSearch = true;
		// °ýÈ£ Ã¼Å©
		if(search_start.CheckParen(document.all.txtKeyword.value) == false)
		{
			alert("°ýÈ£ (, )ÀÇ ¼ö°¡ ¸ÂÁö ¾Ê½À´Ï´Ù.");
			document.all.txtKeyword.focus();
			return false;
		}	
		
		// ÁöÁ¤°Ë»ö¾î Ã³¸®
		if( typeof(IsSpecialKeywordLink) != "undefined") 
		{
			if (IsSpecialKeywordLink == true)
			{
				var linkUrl = search_start.CheckSpecialKeyword(document.all.txtKeyword.value);
				if( linkUrl != '' ){
					document.location.href=linkUrl;
					return false;
				}
			}
		}

		location.href = "http://search.auction.co.kr/search/search.aspx?keyword="+document.all.txtKeyword.value+"&itemno=&seller=&dom=auction&isSuggestion=No&optSection="+document.all.optSection.options[document.all.optSection.selectedIndex].value+"&txtKeyword="+document.all.txtKeyword.value;
	}
	// °æ¸Å¹øÈ£ °Ë»ö
	else if(document.all.optSection.selectedIndex == 2)
	{
		if(document.all.txtKeyword.value.length != 10)
		{
			alert("¹°Ç°¹øÈ£´Â 10ÀÚ¸®¼ö ÀÔ´Ï´Ù. ¹°Ç°¹øÈ£¸¦ ´Ù½Ã ÀÔ·ÂÇØÁÖ¼¼¿ä!");
			document.all.txtKeyword.focus();
			return false;
		}		
		location.href = "http://search.auction.co.kr/search/listno.aspx?keyword=&itemno="+document.all.txtKeyword.value+"&seller=&dom=auction&isSuggestion=No&optSection=1&txtKeyword="+document.all.txtKeyword.value;
	}
	// ÆÇ¸ÅÀÚID °Ë»ö
	else if(document.all.optSection.selectedIndex == 3)
	{
		location.href = "http://search.auction.co.kr/search/listid.aspx?keyword=&itemno=&seller="+document.all.txtKeyword.value+"&dom=auction&isSuggestion=No&optSection=2&txtKeyword="+document.all.txtKeyword.value;
	}
	else
		return false;	
}

search_start.CheckSpecialKeyword = function(keyword)
{
	var retValue = '';
	var iLoop;
	if(typeof(specialKeyword) != "undefined")
	{
		for (iLoop = 0; iLoop <= (specialKeyword.length-1) ; iLoop++ )
		{
			if (specialKeyword[iLoop][0] == keyword)
			{
				retValue = specialKeyword[iLoop][1];
				break;
			}
		}
	}

	return retValue;
}

// 2004-07-15  ÀÌÈñÁÖ bc_174 : Ãß°¡ ½ÃÀÛ
search_start.CheckSpecialChar = function (str, special_char)
{
	var flag = true;

	for(i = 0; i <= str.length;  i++)
	{
		ch = str.charAt(i);
		for(j = 0; j < special_char.length; j++)
		{
			if(ch == special_char.charAt(j))
			{  
				flag = false;
				break;
			}
		}
		if(flag == false)
			break;
	}
	return flag;
}

search_start.CheckParen = function(str)
{	
	// ( °¹¼ö
	var Lcnt = 0;
	var Rcnt = 0;
	
	for(i = 0; i <= str.length ; i++)
	{
		ch = str.charAt(i);
		
		if(ch == "(")
			Lcnt = Lcnt + 1;
		else if(ch == ")")
			Rcnt = Rcnt + 1;
	}
	
	if(Lcnt > 0 || Rcnt > 0)
	{
		if(Lcnt != Rcnt)
			return false;
	}
	return true;
}

function Right(str, n){
    if (n <= 0)
       return "";
    else if (n > String(str).length)
       return str;
    else {
       var iLen = String(str).length;
       return String(str).substring(iLen, iLen - n);
    }
}

//°øÅëÇÃ·¯½¬
/*
function EmbededFlash(sourceUrl,objWidth,objHeight){
	document.write("<OBJECT codeBase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0'");
	document.write("height='"+objHeight+"' width='"+objWidth+"' align='middle' classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'>");
	document.write("<PARAM NAME='FlashVars' VALUE=''>");
	document.write("<PARAM NAME='Movie' VALUE='"+sourceUrl+"'>");
	document.write("<PARAM NAME='Src' VALUE='"+sourceUrl+"'>");
	document.write("<PARAM NAME='WMode' VALUE='Transparent'>");
	document.write("<PARAM NAME='Play' VALUE='-1'>");
	document.write("<PARAM NAME='Loop' VALUE='-1'>");
	document.write("<PARAM NAME='Quality' VALUE='High'>");
	document.write("<PARAM NAME='SAlign' VALUE=''>");
	document.write("<PARAM NAME='Menu' VALUE='-1'>");
	document.write("<PARAM NAME='Base' VALUE=''>");
	document.write("<PARAM NAME='DeviceFont' VALUE='0'>");
	document.write("<PARAM NAME='EmbedMovie' VALUE='0'>");
	document.write("<PARAM NAME='BGColor' VALUE=''>");
	document.write("<PARAM NAME='SWRemote' VALUE=''>");
	document.write("<PARAM NAME='MovieData' VALUE=''>");
	document.write("<param name='allowScriptAccess' value='always' />");
	document.write("<PARAM NAME='SeamlessTabbing' VALUE='1'>");
	document.write("<PARAM NAME='Profile' VALUE='0'>");
	document.write("<PARAM NAME='ProfileAddress' VALUE=''>");
	document.write("<PARAM NAME='ProfilePort' VALUE='0'>");
	document.write("<embed src='"+sourceUrl+"' quality='high' WMode='Transparent' width='"+objWidth+"' height='"+objHeight+"' align='middle'");
	document.write("type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'>");
	document.write("</OBJECT>");
}
*/

function EmbededFlash(swf, width, height, bgcolor, id, flashvars)
{
    var strFlashTag = new String();
    
    if (navigator.appName.indexOf("Microsoft") != -1)
    {
        strFlashTag += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
        strFlashTag += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=version=8,0,0,0" ';
        strFlashTag += 'id="' + id + '" width="' + width + '" height="' + height + '">';
        strFlashTag += '<param name="movie" value="' + swf + '"/>';
        
        if(flashvars != null) {strFlashTag += '<param name="flashvars" value="' + flashvars + '"/>'};
        strFlashTag += '<param name="quality" value="best"/>';
        strFlashTag += '<param name="bgcolor" value="' + bgcolor + '"/>';
        strFlashTag += '<param name="menu" value="false"/>';
        strFlashTag += '<param name="salign" value="LT"/>';
        strFlashTag += '<param name="scale" value="noscale"/>';
        strFlashTag += '<param name="wmode" value="transparent"/>';
        strFlashTag += '<param name="allowScriptAccess" value="sameDomain"/>';
        strFlashTag += '</object>';
    }
    else
    {
        strFlashTag += '<embed src="' + swf + '" ';
        strFlashTag += 'quality="best" ';
        strFlashTag += 'bgcolor="' + bgcolor + '" ';
        strFlashTag += 'width="' + width + '" ';
        strFlashTag += 'height="' + height + '" ';
        strFlashTag += 'menu="false" ';
        strFlashTag += 'scale="noscale" ';
        strFlashTag += 'id="' + id + '" ';
        strFlashTag += 'salign="LT" ';
        strFlashTag += 'wmode="transparent" ';
        strFlashTag += 'allowScriptAccess="sameDomain" ';
        if(flashvars != null) {strFlashTag += 'flashvars="' + flashvars + '" '};
        strFlashTag += 'type="application/x-shockwave-flash" ';
        strFlashTag += 'pluginspage="http://www.macromedia.com/go/getflashplayer">';
        strFlashTag += '</embed>';
    }

 document.write(strFlashTag);
}

function EmbededFlashNew(sourceUrl,objWidth,objHeight){
	document.write("<OBJECT name='objMainFlash' codeBase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0'");
	document.write("height='"+objHeight+"' width='"+objWidth+"' align='middle' classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'>");
	document.write("<PARAM NAME='FlashVars' VALUE=''>");
	document.write("<PARAM NAME='Movie' VALUE='"+sourceUrl+"'>");
	document.write("<PARAM NAME='Src' VALUE='"+sourceUrl+"'>");
	document.write("<PARAM NAME='WMode' VALUE='Transparent'>");
	document.write("<PARAM NAME='Play' VALUE='-1'>");
	document.write("<PARAM NAME='Loop' VALUE='-1'>");
	document.write("<PARAM NAME='Quality' VALUE='High'>");
	document.write("<PARAM NAME='SAlign' VALUE=''>");
	document.write("<PARAM NAME='Menu' VALUE='-1'>");
	document.write("<PARAM NAME='Base' VALUE=''>");
	document.write("<PARAM NAME='DeviceFont' VALUE='0'>");
	document.write("<PARAM NAME='EmbedMovie' VALUE='0'>");
	document.write("<PARAM NAME='BGColor' VALUE=''>");
	document.write("<PARAM NAME='SWRemote' VALUE=''>");
	document.write("<PARAM NAME='MovieData' VALUE=''>");
	document.write("<param name='allowScriptAccess' value='always' />");
	document.write("<PARAM NAME='SeamlessTabbing' VALUE='1'>");
	document.write("<PARAM NAME='Profile' VALUE='0'>");
	document.write("<PARAM NAME='ProfileAddress' VALUE=''>");
	document.write("<PARAM NAME='ProfilePort' VALUE='0'>");
	document.write("<embed src='"+sourceUrl+"' quality='high' WMode='Transparent' width='"+objWidth+"' height='"+objHeight+"' align='middle'");
	document.write("type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'>");
	document.write("</OBJECT>");
}

function EmbededFlashFile(sourceUrl,objWidth,objHeight){
	document.write("<OBJECT name='objTopFlash' codeBase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0'");
	document.write("height='"+objHeight+"' width='"+objWidth+"' align='middle' classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'>");
	document.write("<PARAM NAME='FlashVars' VALUE=''>");
	document.write("<PARAM NAME='Movie' VALUE='"+sourceUrl+"'>");
	document.write("<PARAM NAME='Src' VALUE='"+sourceUrl+"'>");
	document.write("<PARAM NAME='WMode' VALUE='Transparent'>");
	document.write("<PARAM NAME='Play' VALUE='-1'>");
	document.write("<PARAM NAME='Loop' VALUE='-1'>");
	document.write("<PARAM NAME='Quality' VALUE='High'>");
	document.write("<PARAM NAME='SAlign' VALUE=''>");
	document.write("<PARAM NAME='Menu' VALUE='-1'>");
	document.write("<PARAM NAME='Base' VALUE=''>");
	document.write("<PARAM NAME='DeviceFont' VALUE='0'>");
	document.write("<PARAM NAME='EmbedMovie' VALUE='0'>");
	document.write("<PARAM NAME='BGColor' VALUE=''>");
	document.write("<PARAM NAME='SWRemote' VALUE=''>");
	document.write("<PARAM NAME='MovieData' VALUE=''>");
	document.write("<param name='allowScriptAccess' value='always' />");
	document.write("<PARAM NAME='SeamlessTabbing' VALUE='1'>");
	document.write("<PARAM NAME='Profile' VALUE='0'>");
	document.write("<PARAM NAME='ProfileAddress' VALUE=''>");
	document.write("<PARAM NAME='ProfilePort' VALUE='0'>");
	document.write("<embed id='embedFlash' src='"+sourceUrl+"' quality='high' WMode='Transparent' bgcolor='#ffffff' width='"+objWidth+"' height='"+objHeight+"' align='middle'");
	document.write("type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'>");
	document.write("</OBJECT>");
}

//°øÅëÇÃ·¯½¬ - Åõ¸íµµ ¾ø¾Ú
function EmbededFlashNoTrans(sourceUrl,objWidth,objHeight){
	document.write("<OBJECT codeBase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0'");
	document.write("height='"+objHeight+"' width='"+objWidth+"' align='middle' classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'>");
	document.write("<PARAM NAME='FlashVars' VALUE=''>");
	document.write("<PARAM NAME='Movie' VALUE='"+sourceUrl+"'>");
	document.write("<PARAM NAME='Src' VALUE='"+sourceUrl+"'>");
	document.write("<PARAM NAME='Play' VALUE='-1'>");
	document.write("<PARAM NAME='Loop' VALUE='-1'>");
	document.write("<PARAM NAME='Quality' VALUE='High'>");
	document.write("<PARAM NAME='SAlign' VALUE=''>");
	document.write("<PARAM NAME='Menu' VALUE='-1'>");
	document.write("<PARAM NAME='Base' VALUE=''>");
	document.write("<PARAM NAME='Scale' VALUE='ShowAll'>");
	document.write("<PARAM NAME='DeviceFont' VALUE='0'>");
	document.write("<PARAM NAME='EmbedMovie' VALUE='0'>");
	document.write("<PARAM NAME='BGColor' VALUE=''>");
	document.write("<PARAM NAME='SWRemote' VALUE=''>");
	document.write("<PARAM NAME='MovieData' VALUE=''>");
	document.write("<param name='allowScriptAccess' value='always' />");
	document.write("<PARAM NAME='SeamlessTabbing' VALUE='1'>");
	document.write("<PARAM NAME='Profile' VALUE='0'>");
	document.write("<PARAM NAME='ProfileAddress' VALUE=''>");
	document.write("<PARAM NAME='ProfilePort' VALUE='0'>");
	document.write("<embed src='"+sourceUrl+"' quality='high' WMode='Transparent' bgcolor='#ffffff' width='"+objWidth+"' height='"+objHeight+"' align='middle'");
	document.write("type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'>");
	document.write("</OBJECT>");
}

//°øÅëÇÃ·¯½¬
function EmbededFlashSe(sourceUrl,objWidth,objHeight){
	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='"+objWidth+"' height='"+objHeight+"'>");
	document.write("<param name='movie' value='"+sourceUrl+"'>");
	document.write("<param name='quality' value='high'>");
	document.write("<embed src='"+sourceUrl+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+objWidth+"' height='"+objHeight+"'></embed>");
	document.write("</object>");
}

//°øÅë¹Ìµð¾î
function EmbededMedia(sourceUrl,objWidth,objHeight){
	document.write("<embed type='application/x-mplayer2' pluginspage='http://microsoft.com/windows/mediaplayer/en/download/' width='"+objWidth+"' height='"+objHeight+"'");
	document.write("src='"+sourceUrl+"' ShowStatusBar=false autostart='true'");
	document.write("loop='false' enablecontextmenu='false' showcontrols=false bgcolor='#f6f6ec' style='BACKGROUND-COLOR: #f6f6ec'></embed>");
}

/*----¿¹¸ÅÆË¾÷-----*/
//¿¹¸Å ÆË¾÷(°ø¿¬¾ÆÀÌµð¸¸)
function goOpenPerfSale(idPerf){
	
	var openWidth = 900;
	var openHeight = 628;

	var openTicketLinkWidth = 610;
	var openTicketLinkHeight = 600;
	
	var winwidth = (screen.width - openWidth) / 2; 
	var winheight = (screen.height - openHeight) / 2; 
	var wini
	
	
	var jsPSTemp = "º» °ø¿¬Àº Ãæ¹«¾ÆÆ®È¦ Æ¼ÄÏ¿¹¸Å½Ã½ºÅÛ ÀüÈ¯ÀÛ¾÷À¸·Î Æ¼ÄÏ¸µÅ© »çÀÌÆ®¿¡¼­ ¿¹¸ÅµË´Ï´Ù.\n\n";
    jsPSTemp = jsPSTemp + "Ãæ¹«¾ÆÆ®È¦ À¯·áÈ¸¿øÀº Á¦ÈÞÈ¸¿øÀ¸·Î ·Î±×ÀÎÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.\n\n";
    jsPSTemp = jsPSTemp + "¡Ø È¸¿ø¹øÈ£ È®ÀÎÀº Ãæ¹«¾ÆÆ®È¦ È¨ÆäÀÌÁö-¸¶ÀÌÆäÀÌÁö¿¡¼­.\n\n";
    jsPSTemp = jsPSTemp + "¹®ÀÇ.02-2230-6601(Ãæ¹«¾ÆÆ®È¦)\n\n";

    if(idPerf == "405" || idPerf == "430")
    {
//        if(confirm(jsPSTemp))
//        {
			if(idPerf == '405')
			{	
				wini = window.open('http://aff.ticketlink.co.kr/ticketlink/aff_home.jsp?def_user_cd=417&aff_kind=theater2&ProCd=B0044303&PlaceCd=B1082&PlaceName=Ãæ¹«¾ÆÆ®È¦  Áß±ØÀå ºí·¢&ProName=À¯¸®»óÀÚ¿Í ÇÔ²²ÇÏ´Â Ãß¾ïÀÇ °¡¿äÅé10 ÄÜ¼­Æ®','perfSale','width='+openTicketLinkWidth +',height='+openTicketLinkHeight+',left='+winwidth+',top='+winheight+ ', scrollbars=yes, scroll=yes');
			}
			else if(idPerf == '430')
			{
				wini = window.open('http://aff.ticketlink.co.kr/ticketlink/aff_home.jsp?def_user_cd=417&aff_kind=theater2&ProCd=B0044107&PlaceCd=B1082&PlaceName=Ãæ¹«¾ÆÆ®È¦  Áß±ØÀå ºí·¢&ProName=¾È³çÇÏ¼¼¿ä!  ±è¹ü¼ö ÀÔ´Ï´Ù','perfSale','width='+openTicketLinkWidth +',height='+openTicketLinkHeight+',left='+winwidth+',top='+winheight+ ', scrollbars=yes, scroll=yes');
			}
//		}
    }
	else
	{
		wini = window.open('/Home/PerfSale/PerfSalePopup.aspx?Id='+idPerf,'perfSale','width='+openWidth+',height='+openHeight+',left='+winwidth+',top='+winheight);
	}

	wini.focus();
	return false;
	
}

//ÆÐÅ°Áö ¿¹¸ÅÆË¾÷(°ø¿¬¾ÆÀÌµð¸¸)
function goOpenPackageSale(idPerf){

	var openWidth = 900;
	var openHeight = 628;
	
	var winwidth = (screen.width - openWidth) / 2; 
	var winheight = (screen.height - openHeight) / 2; 
	var wini = window.open('/Home/PerfSale/PackageSalePopup.aspx?Id='+idPerf,'PackageSale','width='+openWidth+',height='+openHeight+',left='+winwidth+',top='+winheight);
	wini.focus();
	return false;
	
}

//¿¹¸Å ÆË¾÷-ÇÒÀÎÄÚµå
function goOpenPerfSaleEvent(idPerf,IdCode){

	var openWidth = 900;
	var openHeight = 628;
	
	var winwidth = (screen.width - openWidth) / 2; 
	var winheight = (screen.height - openHeight) / 2; 
	var wini = window.open('/Home/PerfSale/PerfSalePopup.aspx?Id='+idPerf+'&IdCode='+IdCode,'perfSale','width='+openWidth+',height='+openHeight+',left='+winwidth+',top='+winheight);
	wini.focus();
	return false;
	
}

//¿¹¸Å ÆË¾÷(»ç¿ëÀÚ ¾ÆÀÌµð +°ø¿¬¾ÆÀÌµð)
function goOpenPerfSaleMsg(Userid,idPerf){

	if(Userid==''){
		goLoginPopup();
	}else{
		goOpenPerfSale(idPerf);
	}
}


/*----·Î±×ÀÎ ÆË¾÷-----*/
//ÆË¾÷¿¡¼­ ·Î±×ÀÎ ÆË¾÷ ÆäÀÌÁö
function goLoginPopup(){
	if(confirm('·Î±×ÀÎÀ» ÇØÁÖ¼¼¿ä.')){	
		var openWidth = "394";
		var openHeight = "265";
		var winwidth = (screen.width - openWidth) / 2; 
		var winheight = (screen.height - openHeight) / 2; 	
		window.open('/Home/Member/Login.aspx?ReturnUrl='+escape(document.URL.replace('#','')),'LoginPop1','width='+openWidth+',height='+openHeight+',left='+winwidth+',top='+winheight);
	}else{
		self.close();
	}
}


//·Î±×ÀÎ ÆË¾÷ - º°µµÀÇ ¸Þ¼¼Áö ÀÖÀ½
function goLoginPopupMsg(msg){
	if(confirm(msg)){		
		var openWidth = 394;
		var openHeight = 265;
		var winwidth = (screen.width - openWidth) / 2; 
		var winheight = (screen.height - openHeight) / 2; 
		window.open('/Home/Member/Login.aspx?ReturnUrl='+escape(document.URL.replace('#','')),'LoginPop1','width='+openWidth+',height='+openHeight+',left='+winwidth+',top='+winheight);
		return false;
	}else{
		return false;
	}
}

//·Î±×ÀÎ ÆË¾÷ - º°µµÀÇ ¸Þ¼¼Áö ÀÖÀ½
function goLoginPopupMsgSe(msg){
	if(confirm(msg)){		
		var openWidth = 394;
		var openHeight = 265;
		var winwidth = (screen.width - openWidth) / 2; 
		var winheight = (screen.height - openHeight) / 2; 
		window.open('/Home/Member/Login.aspx?ReturnUrl='+escape(document.URL.replace('#','')),'LoginPop1','width='+openWidth+',height='+openHeight+',left='+winwidth+',top='+winheight);
	}
}

//·Î±×ÀÎ ÆäÀÌÁö·Î ÀÌµ¿--ÇöÀç »ç¿ë X
function goLoginPage(){
	if(confirm('·Î±×ÀÎÀ» ÇØÁÖ¼¼¿ä.')){		
		opener.location.href = '/Home/Member/Login.aspx?ReturnUrl='+escape(document.URL.replace('#',''));
		self.close();
	}else{
		self.close();
	}
}

/*----·Î±×ÀÎ ÆË¾÷-----*/


function ViewBigImg(ImgID){
	var imgname = eval("document.all."+ImgID);
	if(imgname !=null){
		OpenBigImage(imgname.src);
	}
}

function OpenBigImage(imageUrl){
	window.open("/Common/FileMng/ImagePopup.aspx?imgpath="+escape(imageUrl),"viewimg",'width=100,height=100,scroll=yes');
}

function ResizePicture(ImgID,vwidth){
	var imgname = eval("document.all."+ImgID);
	if(imgname !=null){
		if(!imgname.complete){
			setTimeout("ResizePicture('"+ImgID+"','"+vwidth+"')",1000); // ÇÔ¼ö¸¦ ´Ù½Ã È£Ãâ
		}else{
			if(imgname.width > vwidth){
				imgname.style.width = vwidth;
			}
		}
	}
}

function OpenAnotherWin(szhref, w, h)
{
     AnotherWin = window.open(szhref,"AnotherWin","toolbar=no,location=no,left=500,top=300,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+w+",height="+h);
}   

function goPerfView(idPerf)
{
	var idsPerf = idPerf+'';
	var NowUrl = idsPerf.toLowerCase();
	
	if(NowUrl.indexOf("http://") == -1)
	{
		if(idsPerf.indexOf('/') > 0)
		{
			//var IdRecom = idsPerf.split('-');
			//location.href='/Home/Collection/Recom.aspx?Id='+IdRecom[1];
			//location.href='#';
			location.href = idPerf;
		}
		else
		{
			location.href='/Home/Perf/PerfInfoDet.aspx?IdPerf='+idPerf;
		}
	}
	else
	{
		location.href = idPerf;
	}
}


function objmenuItem(url){	// MenuItem Object »ý¼º
	this.url = url;
}

function callCalendar(sDate){
	location.href = "/Home/Perf/PerfDoing.aspx?date="+sDate+"&SaleState=&IdTheater=ALL";
}

function goLoginPageByReg(){
	if(confirm('·Î±×ÀÎÈÄ ±Û¾²±â°¡ °¡´ÉÇÕ´Ï´Ù.\n·Î±×ÀÎ ÇÏ½Ã°Ú½À´Ï±î?')){		
		location.href = '/Home/Member/Login.aspx?ReturnUrl='+escape(opener.document.URL.replace('#',''));
		return false;
	}else{
		return false;
	}
}

function goLogin()
{
	window.open('/Home/Member/Login.aspx', '·Î±×ÀÎ','width=394,height=265,left=400, top=400'); 
}

function goEmailReject()
{
	window.open('/Home/EtcInfo/EmailRejection.aspx', 'ÀÌ¸ÞÀÏ¹«´Ü¼öÁý°ÅºÎ','width=394,height=230,left=512, top=384'); 
}

function goPerfExpectationDet(jsPIIdBBS)
{
    window.parent.window.location.href = "/Home/Community/Ex.aspx?mode=r&bid=" + jsPIIdBBS;
}

function goPerfPostScriptDet(jsPIIdBBS)
{
    window.parent.window.location.href = "/Home/Community/PS.aspx?mode=r&bid=" + jsPIIdBBS;
}

function goFlashMoveUrl(jsPSid, jsPSSector)
{
	var NowUrl = jsPSid.toLowerCase();
//	if(jsPSid.indexOf("http://") != -1)   

        if(jsPSid.indexOf("/") != -1)
        {
		window.parent.window.location.href = jsPSid; 
        }
	else
        {
		window.parent.window.location.href = "/Home/PerfInfo/PerfInfoDet.aspx?IdPerf=" + jsPSid; 
        }
}

function SetNumber(jsPObj)
{
    if (typeof jsPObj == 'string')
    {
        jsPObj = document.getElementById(jsPObj);
    }
    
    var jsLStr = jsPObj.value.replace(/\D/g, "");
    jsPObj.value = jsLStr
}

function MoveNextField(jsPSCurId, jsPILen, jsPSNextld) 
{
	if( document.getElementById(jsPSCurId).value.length == parseInt(jsPILen, 10))  
	{
		document.getElementById(jsPSNextld).focus();
	}
}

function checkBizId( jsPSBizId )
{
    var jsLBFlag = false;
    var jsLIBizId = jsPSBizId.replace(/\D/g, "");
    var jsLACheckId = new Array(1, 3, 7, 1, 3, 7, 1, 3, 5, 1);
    var Index;
    var jsLIChkSum1=0;
    var jsLIChkSum2;
    var jsLIRemander;

    for (Index=0; Index<=7; Index++) 
    {
        jsLIChkSum1 += jsLACheckId[Index] * jsLIBizId.charAt(Index);
    }

     jsLIChkSum2 = "0" + (jsLACheckId[8] * jsLIBizId.charAt(8));
     jsLIChkSum2 = jsLIChkSum2.substring(jsLIChkSum2.length - 2, jsLIChkSum2.length);

     jsLIChkSum1 += Math.floor(jsLIChkSum2.charAt(0)) + Math.floor(jsLIChkSum2.charAt(1));

     jsLIRemander = (10 - (jsLIChkSum1 % 10)) % 10 ;

    if (Math.floor(jsLIBizId.charAt(9)) == jsLIRemander)
    {
        jsLBFlag = true; // OK!
    }

    return jsLBFlag;
}

function SetMoney(jsPObj)
{
    var jsLIMoney = jsPObj.value.replace(/\D/g, "");
    jsPObj.value = flagAddSet(jsLIMoney, 3, ',');
}

function flagAddSet(jsPSValue, jsPIPosition, jsPSFlag)
{ 
	var jsLSPattern = "(-?[0-9]+)([0-9]{" + jsPIPosition + "})";
	var jsLSFlags = "";
	var re = new RegExp(jsLSPattern, jsLSFlags);
	var jsLSResult = jsPSValue.toString().replace(jsPSFlag, ""); 

	while (re.test(jsLSResult)) 
	{
		jsLSResult = jsLSResult.replace(re, "$1" + jsPSFlag + "$2"); 
	}
		
	return jsLSResult;
} 

function OpenWindow(jsPSUrl, jsPSWindowName, jsPSWidth, jsPSHeight, jsPSWindowStyle)
{
        var jsLSTop = (window.screen.height - jsPSHeight) / 2; 
        var jsLSLeft = (window.screen.width - jsPSWidth) / 2; 
        
        var jsLSWindowSet = "top=" + jsLSTop + " ,left=" + jsLSLeft + ", width=" + jsPSWidth + ", height=" + jsPSHeight; 
        var jsLSWindowStyle = jsLSWindowSet + jsPSWindowStyle; 

        window.open(jsPSUrl, jsPSWindowName, jsLSWindowStyle);
}


function OpenArtHolic()
{
    var jsLSUrl = "/Home/Community/Artholic.aspx";
    var jsLSWindowName = "Artholic";
    var jsLSWidth = "1000";
    var jsLSHeight = "660";
    var jsLSWindowStyle = ", toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no";
    OpenWindow(jsLSUrl, jsLSWindowName, jsLSWidth, jsLSHeight, jsLSWindowStyle)
}

function OpenSittingPlan()
{
    var jsLSUrl = "/Home/EtcInfo/SittingPlanBig.aspx";
    var jsLSWindowName = "SittingPlan";
    var jsLSWidth = "790";
    var jsLSHeight = "600";
    var jsLSWindowStyle = ", toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no";
    OpenWindow(jsLSUrl, jsLSWindowName, jsLSWidth, jsLSHeight, jsLSWindowStyle)
}

function OpenEventApply(jsPSIdEvent)
{
    var jsLSUrl = "/Home/Event/EventApply.aspx?id=" + jsPSIdEvent;
    var jsLSWindowName = "PopEventApply";
    
    var jsLSTop = (window.screen.height - 573) / 2; 
    var jsLSLeft = (window.screen.width - 976) / 2; 
    
    var jsLSWindowSet = "top=" + jsLSTop + " ,left=" + jsLSLeft;
    var jsLSWindowStyle = jsLSWindowSet + ", width=420, height=420, toolbar=no, location=no, status=no, menubar=no, scrollbars=no, resizable=no"; 

    var wini = window.open(jsLSUrl, jsLSWindowName, jsLSWindowStyle);
    
    wini.focus();
}

function MovePlayerDet(jsPSIdArtist)
{
    var jsLSUrl = "/Supreme/KMusic/PlayerMng.aspx?mode=r&MenuTap=1&bid=" + jsPSIdArtist;
    var jsLSWindowName = "PopUpArtist";
    
    var jsLSTop = (window.screen.height - 600) / 2; 
    var jsLSLeft = (window.screen.width - 1024) / 2; 
    
    var jsLSWindowSet = "top=" + jsLSTop + " ,left=" + jsLSLeft;
    var jsLSWindowStyle = jsLSWindowSet + ", width=1024, height=600, toolbar=no, location=no, status=no, menubar=no, scrollbars=auto, resizable=yes"; 

    window.open(jsLSUrl, jsLSWindowName, jsLSWindowStyle);
}

function handlerNum(obj) {

	if(obj){
		var sKey = String.fromCharCode(event.keyCode);
		var reg = new RegExp(obj);
		if(!reg.test(sKey)){
			event.returnValue=false;
		}
	}
}

function noSpace(){
	if(event.keyCode==32){
		event.returnValue=false;
	}
}

function goAlbumInfoDet(jsPSParam)
{
	self.location = "/Home/Classics/ClassicsAlbumRead.aspx" + jsPSParam;
}

function goPurchaseDet(jsPSPurchaseUrl)
{
    if(jsPSPurchaseUrl.length > 10)
    {
		var jsLSWindowName = "PopUpAlbumPurchase";
		
		var jsLSTop = (window.screen.height - 600) / 2; 
		var jsLSLeft = (window.screen.width - 1024) / 2; 
		
		var jsLSWindowSet = "top=" + jsLSTop + " ,left=" + jsLSLeft;
		var jsLSWindowStyle = jsLSWindowSet + ", width=1024, height=600, toolbar=no, location=no, status=no, menubar=no, scrollbars=auto, resizable=yes"; 

		window.open(jsPSPurchaseUrl, jsLSWindowName, jsLSWindowStyle);
	}
	else
	{
	    alert("ÁØºñÁßÀÔ´Ï´Ù.");
	}
}

function goListeningDet(jsPSListeningUrl)
{
    if(jsPSListeningUrl.length > 10)
    {
		var jsLSWindowName = "PopUpAlbumListening";
		
		var jsLSTop = (window.screen.height - 600) / 2; 
		var jsLSLeft = (window.screen.width - 1024) / 2; 
		
		var jsLSWindowSet = "top=" + jsLSTop + " ,left=" + jsLSLeft;
		var jsLSWindowStyle = jsLSWindowSet + ", width=510, height=420, toolbar=no, location=no, status=no, menubar=no, scrollbars=auto, resizable=yes"; 

		window.open(jsPSListeningUrl, jsLSWindowName, jsLSWindowStyle);
	}
	else
	{
	    alert("ÁØºñÁßÀÔ´Ï´Ù.");
	}
}

function MailCheck(email)
{
	var mailexp = /[a-z0-9]{2,}@[a-z0-9-]{2,}\.[a-z0-9]{2,}/i; 
	 if(!mailexp.test(email))
	 {
	  alert("ÀÌ¸ÞÀÏÀ» Á¤È®È÷ ÀÔ·ÂµÇÁö ÇÏ¼¼¿ä.");
	  return;
	 }
}

//ÆË¾÷°ü¸® ½ÃÀÛ
function ClosePopupAd(jsPSDisPlay, jsPSCookieName)
{
    if(jsPSCookieName.length > 0)
    {
	    setCookie( jsPSCookieName, "done", 1);
	}
	
    document.getElementById(jsPSDisPlay).style.display='none';
}		    

function OpenPopupAd(jsPSDisPlay, jsPSIdPopupAd, jsPSIfrmStyle) 
{								
//	document.getElementById(jsPSDisPlay).style.display = (document.getElementById(jsPSDisPlay).style.display == "block") ? "none" : "block";
	document.getElementById(jsPSDisPlay).innerHTML= "<iframe id='popupAd_" + jsPSIdPopupAd + "_ifrm' src='/Common/Element/SiteMgmt/PopupAd/PopupAd.aspx?dpId=" + jsPSDisPlay + "&IdPopupAd=" + jsPSIdPopupAd +"' style='" + jsPSIfrmStyle + "' marginheight=0 marginwidth=0 frameborder=0 scrolling=auto background=buttonface></iframe>";
}

function ClosePopupBnr(jsPSDisPlay, jsPSCookieName)
{
    if(jsPSCookieName.length > 0)
    {
        setCookie( jsPSCookieName, "done", 1);
    }
	
    document.getElementById(jsPSDisPlay).style.display='none';
}		    

function OpenPopupBnr(jsPSDisPlay, jsPSIdPopupBnr, jsPSIfrmStyle) 
{								
//	document.getElementById(jsPSDisPlay).style.display = (document.getElementById(jsPSDisPlay).style.display == "block") ? "none" : "block";
	document.getElementById(jsPSDisPlay).innerHTML= "<iframe id='popupBnr_ifrm' src='/Common/Element/SiteMgmt/PopupBnr/PopupBnr.aspx?dpId=" + jsPSDisPlay + "&IdPopupBnr=" + jsPSIdPopupBnr +"' style='" + jsPSIfrmStyle + "' marginheight=0 marginwidth=0 frameborder=0 scrolling=auto background=buttonface></iframe>";
}
//ÆË¾÷°ü¸® ³¡


//±âÈ¹»ç°Ë»ö½ÃÀÛ
function goSearchOrg(divnm,inputnm,keybox){
	
	var objinput = eval("document.all."+inputnm);
	
	if(objinput.value==''){
		alert('°Ë»öÇÒ ¾÷Ã¼¸íÀ» ÀÔ·ÂÇÏ¼¼¿ä');
		return;
	}
	
	var url = "/Common/Asyn/OrgSearch/OrgSearch.aspx";
	new Ajax.Request(url,{
		asynchronous:true,
		method: "post",
		postBody: "SearText="+objinput.value,

		onSuccess: function(request){
			goSearchOrg_CallBack(divnm,keybox,inputnm,request.responseText);
		},
		onFailure: function(request){
			alert(request.responseText);
		}
	});
}


function goSearchOrg_CallBack(divnm,keybox,inputnm,response){

	var objDiv = eval("document.all."+divnm);
	var IAddress ="";
	
	if(response.indexOf('$$') > 0){
		
		objDiv.innerHTML = "";
		IAddress = "<table border=0 cellpadding=0 cellspacing=0>"
		
		objDiv.style.visibility = "";
		objDiv.style.display = "";
		objDiv.style.height = "120";
		var Cols = response.split('$$');
		for(var i=0;i<Cols.length;i++){
			if(Cols[i].indexOf('$') > 0){
				var Rows = Cols[i].split('$');
				IAddress += "<tr><td>&nbsp;&nbsp;<a href=\"javascript:SelectOrg('"+divnm+"','"+keybox+"','"+inputnm+"','"+Rows[0]+"','"+Rows[1]+"');\"><font color=#000000>"+Rows[1]+"</font></A></td></tr>";  
			}
		}
		IAddress += "</table>";
		objDiv.innerHTML = IAddress;
	}
	else
	{
		document.getElementById(divnm).style.display = "none";
		document.getElementById(divnm).style.visibility = "hidden";
		alert('°Ë»ö °á°ú°¡ ¾ø½À´Ï´Ù');
		return;
	}
}

function SelectOrg(divnm,keybox,inputnm,id,name){
	document.getElementById(keybox).value = id;
	document.getElementById(inputnm).value = name;
	document.getElementById(divnm).style.display = "none";
	document.getElementById(divnm).style.visibility = "hidden";
}

//±âÈ¹»ç°Ë»ö³¡

function flash_movie(src, ids, width, height, wmode)
{
    var wh = "";
    if (parseInt(width) && parseInt(height)) 
        wh = " width='"+width+"' height='"+height+"' ";
    return "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' "+wh+" id="+ids+"><param name=wmode value="+wmode+"><param name=movie value="+src+"><param name=quality value=high><embed src="+src+" quality=high wmode="+wmode+" type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash' "+wh+"></embed></object>";
}

function obj_movie(src, ids, width, height, autostart)
{
    var wh = "";
    if (parseInt(width) && parseInt(height)) 
        wh = " width='"+width+"' height='"+height+"' ";
    if (!autostart) autostart = false;
    return "<embed src='"+src+"' "+wh+" autostart='"+autostart+"'></embed>";
}

function file_download(link, file) 
{    
    document.location.href=link;
}

function image_window(img)
{
    var w = img.tmp_width; 
    var h = img.tmp_height; 
    var winl = (screen.width-w)/2; 
    var wint = (screen.height-h)/3; 

    if (w >= screen.width) { 
        winl = 0; 
        h = (parseInt)(w * (h / w)); 
    } 

    if (h >= screen.height) { 
        wint = 0; 
        w = (parseInt)(h * (w / h)); 
    } 

    var js_url = "<script language='JavaScript1.2'> \n"; 
        js_url += "<!-- \n"; 
        js_url += "var ie=document.all; \n"; 
        js_url += "var nn6=document.getElementById&&!document.all; \n"; 
        js_url += "var isdrag=false; \n"; 
        js_url += "var x,y; \n"; 
        js_url += "var dobj; \n"; 
        js_url += "function movemouse(e) \n"; 
        js_url += "{ \n"; 
        js_url += "  if (isdrag) \n"; 
        js_url += "  { \n"; 
        js_url += "    dobj.style.left = nn6 ? tx + e.clientX - x : tx + event.clientX - x; \n"; 
        js_url += "    dobj.style.top  = nn6 ? ty + e.clientY - y : ty + event.clientY - y; \n"; 
        js_url += "    return false; \n"; 
        js_url += "  } \n"; 
        js_url += "} \n"; 
        js_url += "function selectmouse(e) \n"; 
        js_url += "{ \n"; 
        js_url += "  var fobj      = nn6 ? e.target : event.srcElement; \n"; 
        js_url += "  var topelement = nn6 ? 'HTML' : 'BODY'; \n"; 
        js_url += "  while (fobj.tagName != topelement && fobj.className != 'dragme') \n"; 
        js_url += "  { \n"; 
        js_url += "    fobj = nn6 ? fobj.parentNode : fobj.parentElement; \n"; 
        js_url += "  } \n"; 
        js_url += "  if (fobj.className=='dragme') \n"; 
        js_url += "  { \n"; 
        js_url += "    isdrag = true; \n"; 
        js_url += "    dobj = fobj; \n"; 
        js_url += "    tx = parseInt(dobj.style.left+0); \n"; 
        js_url += "    ty = parseInt(dobj.style.top+0); \n"; 
        js_url += "    x = nn6 ? e.clientX : event.clientX; \n"; 
        js_url += "    y = nn6 ? e.clientY : event.clientY; \n"; 
        js_url += "    document.onmousemove=movemouse; \n"; 
        js_url += "    return false; \n"; 
        js_url += "  } \n"; 
        js_url += "} \n"; 
        js_url += "document.onmousedown=selectmouse; \n"; 
        js_url += "document.onmouseup=new Function('isdrag=false'); \n"; 
        js_url += "//--> \n"; 
        js_url += "</"+"script> \n"; 

    var settings;

    if (cmah_is_gecko) {
        settings  ='width='+(w+10)+','; 
        settings +='height='+(h+10)+','; 
    } else {
        settings  ='width='+w+','; 
        settings +='height='+h+','; 
    }
    settings +='top='+wint+','; 
    settings +='left='+winl+','; 
    settings +='scrollbars=no,'; 
    settings +='resizable=yes,'; 
    settings +='status=no'; 


    win=window.open("","image_window",settings); 
    win.document.open(); 
    win.document.write ("<html><head> \n<meta http-equiv='imagetoolbar' CONTENT='no'> \n<meta http-equiv='content-type' content='text/html; charset="+cmah_charset+"'>\n"); 
    var size = "ÀÌ¹ÌÁö »çÀÌÁî : "+w+" x "+h;
    win.document.write ("<title>"+size+"</title> \n"); 
    if(w >= screen.width || h >= screen.height) { 
        win.document.write (js_url); 
        var click = "ondblclick='window.close();' style='cursor:move' title=' "+size+" \n\n ÀÌ¹ÌÁö »çÀÌÁî°¡ È­¸éº¸´Ù Å®´Ï´Ù. \n ¿ÞÂÊ ¹öÆ°À» Å¬¸¯ÇÑ ÈÄ ¸¶¿ì½º¸¦ ¿òÁ÷¿©¼­ º¸¼¼¿ä. \n\n ´õºí Å¬¸¯ÇÏ¸é ´ÝÇô¿ä. '"; 
    } 
    else 
        var click = "onclick='window.close();' style='cursor:pointer' title=' "+size+" \n\n Å¬¸¯ÇÏ¸é ´ÝÇô¿ä. '"; 
    win.document.write ("<style>.dragme{position:relative;}</style> \n"); 
    win.document.write ("</head> \n\n"); 
    win.document.write ("<body leftmargin=0 topmargin=0 bgcolor=#dddddd style='cursor:arrow;'> \n"); 
    win.document.write ("<table width=100% height=100% cellpadding=0 cellspacing=0><tr><td align=center valign=middle><img src='"+img.src+"' width='"+w+"' height='"+h+"' border=0 class='dragme' "+click+"></td></tr></table>");
    win.document.write ("</body></html>"); 
    win.document.close(); 

    if(parseInt(navigator.appVersion) >= 4){win.window.focus();} 
}

function ShowLeftMenu(b, m, s)
{
	if(b == '1')
	{
		EmbededFlash('/include/swf/navi_left_01.swf?xmlURL=/include/swf/sub_01_link.xml&m='+ m + '&s=' + s,202,465);
	}
	else if(b == '2')
	{
		EmbededFlash('/include/swf/navi_left_02.swf?xmlURL=/include/swf/sub_02_link.xml&m='+ m + '&s=' + s,202,465);
	}
	else if(b == '3')
	{
		EmbededFlash('/include/swf/navi_left_03.swf?xmlURL=/include/swf/sub_03_link.xml&m='+ m + '&s=' + s,202,465);
	}
	else if(b == '4')
	{
		EmbededFlash('/include/swf/navi_left_04.swf?xmlURL=/include/swf/sub_04_link.xml&m='+ m + '&s=' + s,202,465);
	}
	else if(b == '5')
	{
		EmbededFlash('/include/swf/navi_left_05.swf?xmlURL=/include/swf/sub_05_link.xml&m='+ m + '&s=' + s,202,465);
	}
	else if(b == '6')
	{
		EmbededFlash('/include/swf/navi_left_06.swf?xmlURL=/include/swf/sub_06_link.xml&m='+ m + '&s=' + s,202,465);
	}
	else if(b == '7')
	{
		EmbededFlash('/include/swf/navi_left_07.swf?xmlURL=/include/swf/sub_07_link.xml&m='+ m + '&s=' + s,202,465);
	}
	else if(b == '8')
	{
		EmbededFlash('/include/swf/navi_left_08.swf?xmlURL=/include/swf/sub_08_link.xml&m='+ m + '&s=' + s,202,465);
	}
	else if(b == '9')
	{
		EmbededFlash('/include/swf/navi_left_09.swf?xmlURL=/include/swf/sub_09_link.xml&m='+ m + '&s=' + s,202,465);
	}
}