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 goSearch(){
	var objvalue = document.getElementById("SeachField").value;
	//var SelectJenre = "";
	//if(document.all.SelJenre !=null){
	//	SelectJenre = document.getElementById("SelJenre").value;
	//}
	if(objvalue ==''){
		alert('°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä');
		return;
	}else{
		//parent.top.location.href ='/Home/Search/KeywordSearch.aspx?keyword='+objvalue+"&Jenre="+SelectJenre;
		parent.top.location.href ='/Home/PerfInfo/PerfInfoSearch.aspx?SrchTxt=' + escape(objvalue);
	}
}

function goSearchEnter(){
	if(event.keyCode==13){
		goSearch("1");
	}
}

function ParentGo(locurl){
	parent.top.location.href = locurl;
}

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 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 = 620;
	
	var winwidth = (screen.width - openWidth) / 2; 
	var winheight = (screen.height - openHeight) / 2; 
	var 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 = 620;
	
	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 = 620;
	
	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 = 455;
			var openHeight = 550;
			var winwidth = (screen.width - openWidth) / 2; 
			var winheight = (screen.height - openHeight) / 2; 
			window.open('/Home/Member/Login.aspx','LoginPop1','width='+openWidth+',height='+openHeight+',left='+winwidth+',top='+winheight);
			return false;
	}else{
		return false;
	}
}

//·Î±×ÀÎ ÆË¾÷ - º°µµÀÇ ¸Þ¼¼Áö ÀÖÀ½
function goLoginPopupMsg(msg){
	if(confirm(msg)){		
		var openWidth = 455;
		var openHeight = 550;
		var winwidth = (screen.width - openWidth) / 2; 
		var winheight = (screen.height - openHeight) / 2; 
		window.open('/Home/Member/Login.aspx','LoginPop1','width='+openWidth+',height='+openHeight+',left='+winwidth+',top='+winheight);
		return false;
	}else{
		return false;
	}
}

//·Î±×ÀÎ ÆË¾÷ - º°µµÀÇ ¸Þ¼¼Áö ÀÖÀ½
function goLoginPopupMsgSe(msg){
	if(confirm(msg)){		
		var openWidth = 455;
		var openHeight = 550;
		var winwidth = (screen.width - openWidth) / 2; 
		var winheight = (screen.height - openHeight) / 2; 
		window.open('/Home/Member/Login.aspx','LoginPop1','width='+openWidth+',height='+openHeight+',left='+winwidth+',top='+winheight);
	}
}

//·Î±×ÀÎ ÆäÀÌÁö·Î ÀÌµ¿--ÇöÀç »ç¿ë X
function goLoginPage(){
	if(confirm('·Î±×ÀÎÀ» ÇØÁÖ¼¼¿ä.')){		
		opener.location.href = '/Home/Member/Login.aspx?ReturnUrl='+escape(opener.document.URL.replace('#',''));
		self.close();
	}else{
		self.close();
	}
}

//ÆË¾÷¿¡¼­ ·Î±×ÀÎ ÆË¾÷ ÆäÀÌÁö
function goLoginInPopUp(){
	if(confirm('·Î±×ÀÎÀ» ÇØÁÖ¼¼¿ä.')){	
		var openWidth = 455;
		var openHeight = 550;
		var winwidth = (screen.width - openWidth) / 2; 
		var winheight = (screen.height - openHeight) / 2; 	
		window.open('/Home/Member/Login.aspx','LoginPop1','width='+openWidth+',height='+openHeight+',left='+winwidth+',top='+winheight);
	}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/PerfDetailInfo.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 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 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 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";
}

//±âÈ¹»ç°Ë»ö³¡
