document.write("<script src='http://www.melon.com/js/common_buy.js'></script>");
/*******************************************************************************
 * 2006.11.15 - ¿©Ã¢Çö
 ******************************************************************************/
var host = "http://www.melon.com";

function popResizeTo(width, height) {

    var tmp_MSIE = window.navigator.userAgent.indexOf("MSIE");
	width = parseInt(width);
	height = parseInt(height);


	if(tmp_MSIE >0) {
				// CASE of Internet Explorer 7.
			if (window.navigator.userAgent.indexOf("MSIE 7") > 0)
			{
					height = height+40;
			} else  {
				// CASE of Internet Explorer with SP2.
				if (window.navigator.userAgent.indexOf("SV1") > 0)
				{
					height = height+25;
				}
			}
	}

	window.resizeTo(width, height);
}



/*******************************************************************************
 * 2005.10.27 -  ¿©Ã¢Çö.
 ******************************************************************************/
/**
** function :  writeAlbumImgMain()
** »ç¿ë¿ëµµ : ¾Ù¹üÀÌ¹ÌÁö À§¿¡ HOT Ç¥½Ã ÇÏ±â.
*/

/*
function writeAlbumImgMain(albumImg, hotFlag)
{
	var strBuf = '';
	if (hotFlag) {
	strBuf = strBuf.concat('<div id=vcharacter style="position:relative; width:60; height:60; overflow:hidden">');
	strBuf = strBuf.concat('<div id=vlayer1 style="position:absolute; width:32px; heigth:31px; left:33; top:0; z-index:100">');
	strBuf = strBuf.concat('<embed src=http://image.melon.co.kr/flash/album_hot.swf quality=high width=27 height=27 type=application/x-shockwave-flash pluginspage=http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash WMode=Transparent></embed></div>');
	strBuf = strBuf.concat('<div id=vlayer2 style="position:absolute; left:0; top:0; z-index:1">');
	strBuf = strBuf.concat('<img id=vlayerimg1 src="'+albumImg +'" width=60 height=60 ONERROR="javascript:imgOneStepCheck(this);">');
	strBuf = strBuf.concat('</div></div>');
	} else {
	strBuf = strBuf.concat('<img id=vlayerimg1 src="'+albumImg +'" width=60 height=60 ONERROR="javascript:imgOneStepCheck(this);">');
	}
	document.write(strBuf);
}
*/


/**
** function :  writeAlbumImgMain(¾Ù¹üÀÌ¹ÌÁö, HOT Ç¥½Ã¿©ºÎ, ·çÅ°¾Ù¹ü¿©ºÎ)
** »ç¿ë¿ëµµ : ¾Ù¹üÀÌ¹ÌÁö À§¿¡ HOT ¶Ç´Â rookie Ç¥½Ã ÇÏ±â.
*/
function writeAlbumImgMain(albumImg, hotFlag, recmdValue)
{
	var strBuf = '';

	if(recmdValue == undefined || recmdValue == null) recmdValue = "";

    //·çÅ° ¾Ù¹üÀÎ °æ¿ì
	if(recmdValue.length == 10 && recmdValue.charAt(0) == '1'){

		strBuf = strBuf.concat('<div id=vcharacter style="position:relative; width:60; height:60; overflow:hidden">');
		strBuf = strBuf.concat('<div id=vlayer1 style="position:absolute; width:32px; heigth:31px; left:33; top:0; z-index:100">');
		strBuf = strBuf.concat('<img src=http://image.melon.co.kr/images/common/rookie_27.gif width=27 height=27 border=0></div>');
		strBuf = strBuf.concat('<div id=vlayer2 style="position:absolute; left:0; top:0; z-index:1">');
		strBuf = strBuf.concat('<img id=vlayerimg1 src="'+albumImg +'" width=60 height=60 ONERROR="javascript:imgOneStepCheck(this);">');
		strBuf = strBuf.concat('</div></div>');

	}else{
		if (hotFlag) {
			strBuf = strBuf.concat('<div id=vcharacter style="position:relative; width:60; height:60; overflow:hidden">');
			strBuf = strBuf.concat('<div id=vlayer1 style="position:absolute; width:32px; heigth:31px; left:33; top:0; z-index:100">');
			strBuf = strBuf.concat('<embed src=http://image.melon.co.kr/flash/album_hot.swf quality=high width=27 height=27 type=application/x-shockwave-flash pluginspage=http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash WMode=Transparent></embed></div>');
			strBuf = strBuf.concat('<div id=vlayer2 style="position:absolute; left:0; top:0; z-index:1">');
			strBuf = strBuf.concat('<img id=vlayerimg1 src="'+albumImg +'" width=60 height=60 ONERROR="javascript:imgOneStepCheck(this);">');
			strBuf = strBuf.concat('</div></div>');
		} else {
			strBuf = strBuf.concat('<img id=vlayerimg1 src="'+albumImg +'" width=60 height=60 ONERROR="javascript:imgOneStepCheck(this);">');
		}
	}
	document.write(strBuf);
}


/**
** function :  writeAlbumImgList()
** »ç¿ë¿ëµµ : ¾Ù¹üÀÌ¹ÌÁö À§¿¡ HOT Ç¥½Ã ÇÏ±â.
*/

/*
function writeAlbumImgList(albumImg, hotFlag)
{
	var strBuf = '';
	if (hotFlag) {
	strBuf = strBuf.concat('<div id=vcharacter style="position:relative; width:80; height:82; overflow:hidden">');
	//strBuf = strBuf.concat('<div id=vlayer1 style="position:absolute; width:57px; heigth:65px; left:50; top:0; z-index:100">');
	strBuf = strBuf.concat('<div id=vlayer1 style="position:absolute; width:57px; heigth:65px; left:46; top:4; z-index:100">');
	strBuf = strBuf.concat('<embed src=http://image.melon.co.kr/flash/album_hot.swf quality=high width=29 height=29 type=application/x-shockwave-flash pluginspage=http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash WMode=Transparent></embed></div>');
	strBuf = strBuf.concat('<div id=vlayer2 style="position:absolute; left:0; top:0; z-index:1">');
	strBuf = strBuf.concat('<table cellspacing=1 cellpadding=4 border=0 bgcolor=#D9D9D9><tr><td bgcolor=#FFFFFF>');
	strBuf = strBuf.concat('<img id=vlayerimg1 src="'+albumImg +'" width=70 height=70 ONERROR="javascript:defaultImg_album(this);">');
	strBuf = strBuf.concat('</td></tr></table>');
	strBuf = strBuf.concat('</div></div>');
	} else {
		strBuf = strBuf.concat('<table cellspacing=1 cellpadding=4 border=0 bgcolor=#D9D9D9><tr><td bgcolor=#FFFFFF>');
		strBuf = strBuf.concat('<img id=vlayerimg1 src="'+albumImg +'" width=70 height=70 ONERROR="javascript:defaultImg_album(this);">');
		strBuf = strBuf.concat('</td></tr></table>');
	}
	document.write(strBuf);
}
*/


/**
** function :  writeAlbumImgList(¾Ù¹üÀÌ¹ÌÁö, HOT Ç¥½Ã¿©ºÎ, ·çÅ°¾Ù¹ü¿©ºÎ)
** »ç¿ë¿ëµµ : ¾Ù¹üÀÌ¹ÌÁö À§¿¡ HOT ¶Ç´Â rookie Ç¥½Ã ÇÏ±â.
*/
function writeAlbumImgList(albumImg, hotFlag, recmdValue){

	var strBuf = '';

	if(recmdValue == undefined || recmdValue == null) recmdValue = "";

	//·çÅ° ¾Ù¹üÀÎ °æ¿ì
	if(recmdValue.length == 10 && recmdValue.charAt(0) == '1'){

		strBuf = strBuf.concat('<div id=vcharacter style="position:relative; width:80; height:82; overflow:hidden">');
		strBuf = strBuf.concat('<div id=vlayer1 style="position:absolute; width:57px; heigth:65px; left:46; top:4; z-index:100">');
		strBuf = strBuf.concat('<img src=http://image.melon.co.kr/images/common/rookie_29.gif width=29 height=29 border=0></div>');
		strBuf = strBuf.concat('<div id=vlayer2 style="position:absolute; left:0; top:0; z-index:1">');
		strBuf = strBuf.concat('<table cellspacing=1 cellpadding=4 border=0 bgcolor=#D9D9D9><tr><td bgcolor=#FFFFFF style=cursor:hand>');
		strBuf = strBuf.concat('<img id=vlayerimg1 src="'+albumImg +'" width=70 height=70 ONERROR="javascript:defaultImg_album(this);" >');
		strBuf = strBuf.concat('</td></tr></table>');
		strBuf = strBuf.concat('</div></div>');

	}else {
		if (hotFlag) {
			strBuf = strBuf.concat('<div id=vcharacter style="position:relative; width:80; height:82; overflow:hidden">');
			strBuf = strBuf.concat('<div id=vlayer1 style="position:absolute; width:57px; heigth:65px; left:46; top:4; z-index:100">');
			strBuf = strBuf.concat('<embed src=http://image.melon.co.kr/flash/album_hot.swf quality=high width=29 height=29 type=application/x-shockwave-flash pluginspage=http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash WMode=Transparent></embed></div>');
			strBuf = strBuf.concat('<div id=vlayer2 style="position:absolute; left:0; top:0; z-index:1">');
			strBuf = strBuf.concat('<table cellspacing=1 cellpadding=4 border=0 bgcolor=#D9D9D9><tr><td bgcolor=#FFFFFF  style=cursor:hand>');
			strBuf = strBuf.concat('<img id=vlayerimg1 src="'+albumImg +'" width=70 height=70 ONERROR="javascript:defaultImg_album(this);">');
			strBuf = strBuf.concat('</td></tr></table>');
			strBuf = strBuf.concat('</div></div>');
		} else {
			strBuf = strBuf.concat('<table cellspacing=1 cellpadding=4 border=0 bgcolor=#D9D9D9><tr><td bgcolor=#FFFFFF>');
			strBuf = strBuf.concat('<img id=vlayerimg1 src="'+albumImg +'" width=70 height=70 ONERROR="javascript:defaultImg_album(this);">');
			strBuf = strBuf.concat('</td></tr></table>');
		}
	}
	document.write(strBuf);
}


/**
** function :  writeAlbumImgList(¾Ù¹üÀÌ¹ÌÁö, HOT Ç¥½Ã¿©ºÎ, ·çÅ°¾Ù¹ü¿©ºÎ, ¹è°æwidth, ¹è°æheight, ¾Ù¹üwidth, ¾Ù¹üheight)
** »ç¿ë¿ëµµ : ¾Ù¹üÀÌ¹ÌÁö À§¿¡ HOT ¶Ç´Â rookie Ç¥½Ã ÇÏ±â.
*/
function writeAlbumImgList2(albumImg, hotFlag, recmdValue, bgWidth, bgHeight, imgWidth, imgHeight){

	var strBuf = '';

	if(recmdValue == undefined || recmdValue == null) recmdValue = "";

	//·çÅ° ¾Ù¹üÀÎ °æ¿ì
	if(recmdValue.length == 10 && recmdValue.charAt(0) == '1'){

		strBuf = strBuf.concat('<div id=vcharacter style="position:relative; width:'+bgWidth+'; height:'+bgHeight+'; overflow:hidden">');
		strBuf = strBuf.concat('<div id=vlayer1 style="position:absolute; width:57px; heigth:65px; left:'+(imgWidth-70+46)+'; top:4; z-index:100">');
		strBuf = strBuf.concat('<img src=http://image.melon.co.kr/images/common/rookie_29.gif width=29 height=29 border=0></div>');
		strBuf = strBuf.concat('<div id=vlayer2 style="position:absolute; left:0; top:0; z-index:1">');
		strBuf = strBuf.concat('<table cellspacing=1 cellpadding=4 border=0 bgcolor=#D9D9D9><tr><td bgcolor=#FFFFFF style=cursor:hand>');
		strBuf = strBuf.concat('<img id=vlayerimg1 src="'+albumImg +'" width="'+imgWidth +'" height="'+imgHeight+'" ONERROR="javascript:defaultImg_album(this);" >');
		strBuf = strBuf.concat('</td></tr></table>');
		strBuf = strBuf.concat('</div></div>');

	}else {
		if (hotFlag) {
			strBuf = strBuf.concat('<div id=vcharacter style="position:relative; width:'+bgWidth+'; height:'+bgHeight+'; overflow:hidden">');
			strBuf = strBuf.concat('<div id=vlayer1 style="position:absolute; width:57px; heigth:65px; left:'+(imgWidth-70+46)+'; top:4; z-index:100">');
			strBuf = strBuf.concat('<embed src=http://image.melon.co.kr/flash/album_hot.swf quality=high width=29 height=29 type=application/x-shockwave-flash pluginspage=http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash WMode=Transparent></embed></div>');
			strBuf = strBuf.concat('<div id=vlayer2 style="position:absolute; left:0; top:0; z-index:1">');
			strBuf = strBuf.concat('<table cellspacing=1 cellpadding=4 border=0 bgcolor=#D9D9D9><tr><td bgcolor=#FFFFFF  style=cursor:hand>');
			strBuf = strBuf.concat('<img id=vlayerimg1 src="'+albumImg +'" width="'+imgWidth +'" height="'+imgHeight+'" ONERROR="javascript:defaultImg_album(this);">');
			strBuf = strBuf.concat('</td></tr></table>');
			strBuf = strBuf.concat('</div></div>');
		} else {
			strBuf = strBuf.concat('<table cellspacing=1 cellpadding=4 border=0 bgcolor=#D9D9D9><tr><td bgcolor=#FFFFFF>');
			strBuf = strBuf.concat('<img id=vlayerimg1 src="'+albumImg +'" width="'+imgWidth +'" height="'+imgHeight+'" ONERROR="javascript:defaultImg_album(this);">');
			strBuf = strBuf.concat('</td></tr></table>');
		}
	}
	document.write(strBuf);
}


/*******************************************************************************
 * 2005.01.06 - POC ¿©Ã¢Çö.
 ******************************************************************************/
/**
** function :  popSvcNoti()
** »ç¿ë¿ëµµ : ¾Ù¹ü³ëÃâ°Ç¿¡¼­ ºñ¾Ù¹üÀÎ°æ¿ì ¾È³»Ã¢
*/
function popSvcNoti()
{
	window.open('/inc/svcNoti.html','svcNoti','height=200,width=370');
//	svcNoti.focus();
}
/**
** function :  popEventReg()
** »ç¿ë¿ëµµ : ValentineÀÀ¸ð
*/
function popEventReg()
{
	window.open('/PIMS/event/list/event_copa.jsp','eventCopa','height=400,width=320');
//	svcNoti.focus();
}

/*******************************************************************************
 * 2004.10.13 - POC
 ******************************************************************************/

function defaultImg(obj){
    /*
	var chk = Math.random();
     	var altSrc = 'http://image.melon.co.kr/images/common/@tmp20.gif';

	if (chk <= 0.2) {
	   	altSrc = 'http://image.melon.co.kr/images/common/noimage01.gif';
    } else { if (chk <= 0.3) {
	   	altSrc = 'http://image.melon.co.kr/images/common/noimage09.gif';
    } else { if (chk <= 0.4) {
	   	altSrc = 'http://image.melon.co.kr/images/common/noimage02.gif';
    } else { if (chk <= 0.5) {
	   	altSrc = 'http://image.melon.co.kr/images/common/noimage03.gif';
    } else { if (chk <= 0.6) {
	   	altSrc = 'http://image.melon.co.kr/images/common/noimage04.gif';
    } else { if (chk <= 0.7) {
	   	altSrc = 'http://image.melon.co.kr/images/common/noimage05.gif';
    } else { if (chk <= 0.8) {
	   	altSrc = 'http://image.melon.co.kr/images/common/noimage06.gif';
    } else { if (chk <= 0.9) {
	   	altSrc = 'http://image.melon.co.kr/images/common/noimage07.gif';
    } else {
	   	altSrc = 'http://image.melon.co.kr/images/common/noimage08.gif';
	}}}}}}}}
    */
    //081007 ¸ÞÅ¸¿¡¼­ µðÆúÆ® ÀÌ¹ÌÁö Àü´Þ
    var altSrc = 'http://image.melon.co.kr/svc/images/common/noimage.gif';       
    obj.src = altSrc;
}

/****
 * Ãß°¡ : 2006-01-09 chyeo
 * ¾Ù¹ü»ó¼¼ ±âº»ÀÌ¹ÌÁö 3°³·Î.
 ******/
function defaultImg_album(obj){
    /*
	var chk = Math.random();
     	var altSrc = 'http://image.melon.co.kr/images/common/album_noimage04.jpg';

	if (chk <= 0.3) {
	   	altSrc = 'http://image.melon.co.kr/images/common/album_noimage01.jpg';
    	} else if (chk <= 0.6) {
	   	altSrc = 'http://image.melon.co.kr/images/common/album_noimage02.jpg';
    	}
    */
    //081007 ¸ÞÅ¸¿¡¼­ µðÆúÆ® ÀÌ¹ÌÁö Àü´Þ
    var altSrc = 'http://image.melon.co.kr/svc/images/common/album_small.gif';
    if(obj.width>60){
        altSrc = 'http://image.melon.co.kr/svc/images/common/album_big.gif';
    }
    obj.src = altSrc;
}

/****
 * Ãß°¡ : 2006-01-09 chyeo
 * ¾ÆÆ¼½ºÆ®»ó¼¼ ±âº»ÀÌ¹ÌÁö 4°³·Î.
 ******/
function defaultImg_artist(obj){
    /*
	var chk = Math.random();
     	var altSrc = 'http://image.melon.co.kr/images/common/artist_noimage04.jpg';

	if (chk <= 0.3) {
	   	altSrc = 'http://image.melon.co.kr/images/common/artist_noimage01.jpg';
    	} else if (chk <= 0.6) {
	   	altSrc = 'http://image.melon.co.kr/images/common/artist_noimage02.jpg';
    	} else if (chk <= 0.8) {
	   	altSrc = 'http://image.melon.co.kr/images/common/artist_noimage03.jpg';
    	}
    */
    //081007 ¸ÞÅ¸¿¡¼­ µðÆúÆ® ÀÌ¹ÌÁö Àü´Þ    
    var altSrc = 'http://image.melon.co.kr/svc/images/common/artist_small.gif';
    if(obj.width>60){
        altSrc = 'http://image.melon.co.kr/svc/images/common/artist_big.gif';
    }
    obj.src = altSrc;
}

/****
 * Ãß°¡ : 2008-10-08 whitedream
 * »ç¿ëÀÚ ±âº»ÀÌ¹ÌÁö
 ******/
function defaultImg_user(obj){
    var chk = Math.random();
        var altSrc = 'http://image.melon.co.kr/svc/images/common/user_small.gif';
        
    if (chk <= 0.2) {
        altSrc = 'http://image.melon.co.kr/svc/images/common/user_small.gif';
    } else if (chk <= 0.4) {
        altSrc = 'http://image.melon.co.kr/svc/images/common/user_small_01.gif';
    } else if (chk <= 0.5) {
        altSrc = 'http://image.melon.co.kr/svc/images/common/user_small_02.gif';
    } else if (chk <= 0.6) {
        altSrc = 'http://image.melon.co.kr/svc/images/common/user_small_03.gif';
    } else if (chk <= 0.7) {
        altSrc = 'http://image.melon.co.kr/svc/images/common/user_small_04.gif';
    } else if (chk <= 0.8) {
        altSrc = 'http://image.melon.co.kr/svc/images/common/user_small_05.gif';
    } else if (chk <= 0.9) {
        altSrc = 'http://image.melon.co.kr/svc/images/common/user_small_06.gif';
    }
    
    //081007 ¸ÞÅ¸¿¡¼­ µðÆúÆ® ÀÌ¹ÌÁö Àü´Þ
    //var altSrc = 'http://image.melon.co.kr/svc/images/common/user_big.gif';
    if(obj.width>60){
        altSrc = altSrc.replace("small","big");
    }
    obj.src = altSrc;
}

/****
 * Ãß°¡ : 2008-10-08 whitedream
 * »ç¿ëÀÚ ±âº»ÀÌ¹ÌÁö
 ******/
function defaultImg_oalbum(obj){
    //081007 ¸ÞÅ¸¿¡¼­ µðÆúÆ® ÀÌ¹ÌÁö Àü´Þ
    var altSrc = 'http://image.melon.co.kr/svc/images/common/openalbum_small.gif';
    if(obj.width>60){
        altSrc = 'http://image.melon.co.kr/svc/images/common/openalbum_big.gif';
    }
    obj.src = altSrc;
}

function defaultImg_M(obj){
    var altSrc = 'http://image.melon.co.kr/images/common/img_ready_L_02.gif';
    obj.src = altSrc;
}
function defaultImg_L(obj){
    var altSrc = 'http://image.melon.co.kr/images/common/img_ready_XL_01.gif';
    obj.src = altSrc;
}

function defaultImg_T(obj){	//Å×¸¶¿¡¼­ »ç¿ëÇÔ..
    var altSrc = 'http://image.melon.co.kr/images/common/leaf01.jpg';
    obj.src = altSrc;
}

/**
** function :  checkTextLength()
** »ç¿ë¿ëµµ : ±ÛÀÚ¼ö Á¦ÇÑ
** param : length_limit, objForm, objName
** param ¼³¸í : Á¦ÇÑ±ÛÀÚ¼ö, Æû ¸í, intput ¸í
*/

function checkTextLength(length_limit, objForm, objName, doFunction)
{
	var obj = "";
	obj = document.all[objForm][objName];
	var length = getTextLength(obj.value);
	
	if(doFunction){
		doFunction(length);
	}

	if (length > length_limit)
	{
		alert("ÀÔ·ÂÇÏ½Å ³»¿ëÀÌ ÇÑ±Û±âÁØÀ¸·Î " + length_limit + "Byte¸¦ ³ÑÀ» ¼ö ¾ø½À´Ï´Ù.");
		obj.value = obj.value.replace(/\r\n$/, "");
		obj.value = assert_msglen(obj.value, length_limit);
		obj.focus();
	}

}

function getTextLength(message)
{
	var nbytes = 0;

	for (i=0; i<message.length; i++)
	{
		var ch = message.charAt(i);
		if(escape(ch).length > 4)
		{
			nbytes += 2;
		}
		else if (ch == '\n')
		{
			if (message.charAt(i-1) != '\r')
			{
				nbytes += 1;
			}
		}
		else if (ch == '<' || ch == '>')
		{
			nbytes += 4;
		}
		else
		{
			nbytes += 1;
		}
	}

	return nbytes;
}

function assert_msglen(message, maximum)
{
	var inc = 0;
	var nbytes = 0;
	var msg = "";
	var msglen = message.length;

	for (i=0; i<msglen; i++)
	{
		var ch = message.charAt(i);
		if (escape(ch).length > 4)
		{
			inc = 2;
		}
		else if (ch == '\n')
		{
			if (message.charAt(i-1) != '\r')
			{
				inc = 1;
			}
		}
		else if (ch == '<' || ch == '>')
		{
			inc = 4;
		}
		else
		{
			inc = 1;
		}

		if ((nbytes + inc) > maximum)
		{
			break;
		}
		nbytes += inc;
		msg += ch;
	}
	//document.getElementById("textlimit").innerHTML = nbytes;
	return msg;
}

/**
 ** function :  toggleAll()
 ** »ç¿ë¿ëµµ : Ã¼Å© ¹Ú½º ÀüÃ¼ ¼±ÅÃ
 ** param : chkbox
 ** param ¼³¸í : ÆûÀÇ °´Ã¼, ex) document.[FormName].[objectName]
 */
function toggleAll(chkbox)
{
	toggleCheckboxes(chkbox);
}

function toggleCheckboxes(chkbox)
{
	if(!chkbox)
	{
		return;
	}


	if(chkbox.length > 0)
	{
		for(i = 0; i < chkbox.length; i++)
		{
			chkbox[i].checked= !chkbox[i].checked;
		}
	}
	else
	{
		chkbox.checked=!chkbox.checked;
	}
}



/**
 ** function :  setAlbumScrap()
 ** »ç¿ë¿ëµµ : ¾Ù¹ü ½ºÅ©·¦
 ** param : album_id
 ** param ¼³¸í : ¾Ù¹üÀÇ ¾ÆÀÌµð
 */
function setAlbumScrap(album_id)
{
	var urlStr = '/PIMS/myFolder/scrap/regScrapAlbum_act.jsp?ALBUM_ID='+album_id
	window.open(urlStr,'cart','height=200,width=300');
}

function popMyAlbum()
{
	window.open('/PIMS/myFolder/readAlbum.jsp','album','height=530,width=790');
	album.focus();
}


function string2ASC(str) {
	var asc = "";
	for(var i = 0; i < str.length; i++) {
		if(str.charAt(i) == '?')		asc += "%3F";
		else if(str.charAt(i) == '&')	asc += "%26";
//		else if(str.charAt(i) == '/')	asc += "%2F";
		else							asc += str.charAt(i);
	}

	return asc;
}

function popLyric(songId)
{
	if(songId == 0)
	{
	    alert("°î¾ÆÀÌµð°¡ 0?");
	    return;
	}
	var URL = '/gnb2/popupBox/lyric_p.jsp?p_songId='+songId
	window.open(URL,'lyric','height=530,width=390');
}
function popLyricReq(songId)
{
	if(songId == 0)
	{
	    alert("error 0?");
	    return;
	}
	var URL = '/gnb2/popupBox/lyric_req.jsp?p_songId='+songId
	window.open(URL,'lyric','height=530,width=390');
}


function popPhoneDeco(songId)
{
	if(songId == 0)
	{
	    alert("°î¾ÆÀÌµð°¡ ¾ø½À´Ï´Ù.");
		return;
	}
	var URL = '/gnb2/popupBox/phone_deco_p.jsp?p_songId='+songId+'&truepage='+'/gnb2/popupBox/phone_deco_p.jsp%3Fp_songId='+songId;

	window.open(URL,'phone','height=330,width=452');
}


function popPhoneDecorate(tumsFlg, songId)
{
	if(songId == 0)
	{
	    alert("°î¾ÆÀÌµð°¡ ¾ø½À´Ï´Ù.");
		return;
	}
//	var URL = '/gnb2/popupBox/phone_deco_p.jsp?p_tumsFlg='+tumsFlg+'&p_songId='+songId+'&truepage='+'/gnb2/popupBox/phone_deco_p.jsp%3Fp_songId='+songId+'%26p_tumsFlg='+tumsFlg;

	var URL = '/decophone/player/decop_player.jsp?p_tumsFlg='+tumsFlg+'&p_songId='+songId+'&truepage='+'/gnb2/popupBox/phone_deco_p.jsp%3Fp_songId='+songId+'%26p_tumsFlg='+tumsFlg;
	show=window.open(URL,'phone','height=330,width=452,scrollbars=yes');
		show.focus();
}

function popPhoneDecoTran(tranId, songId)
{
	if(songId == 0)
	{
	    alert("°î¾ÆÀÌµð°¡ ¾ø½À´Ï´Ù.");
		return;
	}
//	var URL = '/gnb2/popupBox/phone_deco_p.jsp?p_tranId='+tranId+'&p_songId='+songId+'&truepage='+'/gnb2/popupBox/phone_deco_p.jsp%3Fp_songId='+songId+'%26p_tranId='+tranId;
	var URL = '/gnb2/popupBox/cuttingbell_remake.jsp?p_tranId='+tranId+'&p_songId='+songId+'&truepage='+'/gnb2/popupBox/phone_deco_p.jsp%3Fp_songId='+songId+'%26p_tranId='+tranId;
	window.open(URL,'phone','height=330,width=452');
}

/*
 * ±Ý¾×ÀÇ ÄÞ¸¶¸¦ ³Ö¾îÁØ´Ù.
 * @param val ¼ýÀÚ¸¦ ³ÖÀ» ±Ý¾×
 * @return ¼ýÀÚ°¡ µé¾î°£ ±Ý¾×
 */
function comma(val)
{
	var num = val;

	if (val.length >= 4)
	{
		re = /^$|,/g;

		// "$" and "," ÀÔ·Â Á¦°Å
		num = num.replace(re, "");

		fl=""
		if(isNaN(num))
		{
			alert("¹®ÀÚ´Â »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.");
			return 0;
		}

		if(num==0)
		{
			return num;
		}

		if(num<0)
		{
			num = num*(-1);
			fl="-";
		}
		else
		{
			num=num*1;	//Ã³À½ ÀÔ·Â°ªÀÌ 0ºÎÅÍ ½ÃÀÛÇÒ¶§ ÀÌ°ÍÀ» Á¦°ÅÇÑ´Ù.
		}

		num = new String(num);
		temp="";
		co=3;
		num_len=num.length;

		while (num_len>0)
		{
			num_len=num_len-co;
			if(num_len<0)
			{
				co=num_len+co;num_len=0;
			}
			temp=","+num.substr(num_len,co)+temp;
		}

		return fl+temp.substr(1);
	}
	else
	{
		return num;
	}
}

function IsAlphaNumeric(checkStr)
{
	var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
	for (i = 0;  i < checkStr.length;  i++)
	{
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
		{
			if (ch == checkOK.charAt(j))
			{
				break;
			}
		}

		if (j == checkOK.length)
		{
			return (false);
			break;
		}
	}
	return (true);
}

function IsAlphaNum(dirname)
{
	var ch, ch2=1;
	for ( k = 0; k < dirname.length; k++ )
	{
		ch = dirname.charAt(k);
		if ( !(('0' <= ch && '9' >= ch ) || ('A' <= ch && 'Z' >= ch ) || ('a' <= ch && 'z' >= ch ) || ( ch == '_' )) )
		{
			if ( ch == ' ' )
			{
				alert("°ø¹éÀ» »ç¿ëÇÒ¼ö ¾ø½À´Ï´Ù.");
			}
			
			else
			{
				alert("¿µ¹®ÀÚ, ¼ýÀÚ, '_' ¿ÜÀÇ ¹®ÀÚ´Â »ç¿ëÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.");
				//alert(ch);
			}
			return (false);
		}
	}
	return (true);
}

function IsNumeric(value)
{
	var ch, ch2=1;
	for ( k = 0; k < value.length; k++ )
	{
		ch = value.charAt(k);
		if ( ch < '0' || ch > '9' )
		{
			return (false);
		}
	}
	return (true);
}

function IsValidString(string)
{
	var ch;
	for ( k = 0; k < string.length; k++ )
	{
		ch = string.charAt(k);
		if ( ch == ' ' )
		{
			alert("°ø¹éÀ» »ç¿ëÇÒ¼ö ¾ø½À´Ï´Ù..");
			return (false);
		}
	}
	return (true);
}

function GetLength(string)
{
	var ch;
	var length = 0;
	if(string == "")
	{
		return 0;
	}
	browserName = navigator.appName;
	browserVer = navigator.appVersion.indexOf("5.");
	if (browserName == "Netscape")
	{
		return string.length;
	}
	else
	{
		for ( k = 0; k < string.length; k++ )
		{
			ch = string.charAt(k);
			if ( ch >= '¤¡'  )
			{
				length += 2;
			}
			else if ( ch > 128)
			{
				length += 2;
			}
			else
			{
				length++;
			}
		}
		return length;
	}
}

function getStln(OrgS)
{
	var Cntkr=0;
	var outLength;
	for (var i=0; i<OrgS.length; i++)
	{
		if (OrgS.charAt(i)>'~')
		{
			Cntkr = Cntkr+1;
		}
	}
	outLength = OrgS.length + Cntkr;
	return outLength;
}

function string_trim(checkStr)
{
	var returnValue;

	if (checkStr != "")
	{
		var search = 0;

		while ( checkStr.charAt(search) == " " || checkStr.charAt(search) == "\t" )
		{
			search = search + 1;
		}

		checkStr = checkStr.substring(search, (checkStr.length));
		search = checkStr.length - 1;

		while ( checkStr.charAt(search) == " " || checkStr.charAt(search) == "\t" )
		{
			search = search - 1;
		}

		returnValue = checkStr.substring(0, search + 1);
	}
	else
	{
		returnValue = checkStr;
	}
	return returnValue;
}


////////////////////////////////////////////////////////////////////////////////

function com_check_login()
{
	var LOGIN_KEY_CHECK = getComCookieMemberKey();
	var LOGIN_ID_CHECK = getComCookieMemberId();

	if(LOGIN_KEY_CHECK == 'null' || LOGIN_KEY_CHECK == '')
	{
		return false;
	}
	else
	{
		return true;
	}
}

function getComCookieMemberId()
{
	var LOGIN_ID_CHECK = getComCookie("idCookie");

	if (LOGIN_ID_CHECK == null)
	{
		return "";
	}

	return LOGIN_ID_CHECK;
}

function getComCookieMemberKey()
{
	var LOGIN_KEY_CHECK = getComCookie("keyCookie");

	if (LOGIN_KEY_CHECK == null)
	{
		return "";
	}

	return LOGIN_KEY_CHECK;
}

function getComCookieMemberName()
{
	var LOGIN_NAME_CHECK = getComCookie("nameCookie");

	if (LOGIN_NAME_CHECK == null)
	{
		return "";
	}

	return decodeURL(decode69(LOGIN_NAME_CHECK));
}

function getComCookieMemberNickname()
{
	var LOGIN_NICK_CHECK = getComCookie("nicknameCookie");

	if (LOGIN_NICK_CHECK == null)
	{
		return "";
	}

	return decodeURL(decode69(LOGIN_NICK_CHECK));
}

function getComCookieCach()
{
	var LOGIN_CASH_CHECK = getComCookie("cash");

	if (LOGIN_CASH_CHECK == null)
	{
		return "0";
	}

	return decode69(LOGIN_CASH_CHECK);
}

function getComCookieGiftCnt()
{
	var LOGIN_GIFTCNT_CHECK = getComCookie("giftcnt");

	if (LOGIN_GIFTCNT_CHECK == null)
	{
		return "0";
	}

	return decode69(LOGIN_GIFTCNT_CHECK);
}

function getComCookieSvcName()
{
	var LOGIN_SVCNAME_CHECK = getComCookie("serviceName");

	if (LOGIN_SVCNAME_CHECK == null)
	{
		return "";
	}

	return decodeURL(decode69(LOGIN_SVCNAME_CHECK));
}

function getComCookieSvcOn()
{
	var LOGIN_SVCON_CHECK = getComCookie("serviceOn");

	if (LOGIN_SVCON_CHECK == null)
	{
		return "";
	}

	return decodeURL(decode69(LOGIN_SVCON_CHECK));
}

function getComCookie(name)
{
	var dc = document.cookie;
	var prefix = name + "=";
	var begin = dc.indexOf("; " + prefix);

	if (begin == -1)
	{
		begin = dc.indexOf(prefix);
		if (begin != 0)
		{
			return null;
		}
  	}
  	else
  	{
		begin += 2;
	}

	var end = document.cookie.indexOf(";", begin);
	if (end == -1)
	{
		end = dc.length;
	}

	return unescape(dc.substring(begin + prefix.length, end));
}

////////////////////////////////////////////////////////////////////////////////

var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + // all caps
			 "abcdefghijklmnopqrstuvwxyz" + // all lowercase
			 "0123456789+/=%$-_";			// all numbers plus +/=%$-_

function encode69(inp)
{
	var out = "";							// This is the output
	var chr1, chr2, chr3 = "";				// These are the 3 bytes to be encoded
	var enc1, enc2, enc3, enc4 = ""; 		// These are the 4 encoded bytes
	var i = 0;								// Position counter

	do										// Set up the loop here
	{
		chr1 = inp.charCodeAt(i++);			// Grab the first byte
		chr2 = inp.charCodeAt(i++);			// Grab the second byte
		chr3 = inp.charCodeAt(i++);			// Grab the third byte

		// Here is the actual base64 encode part.
		// There really is only one way to do it.
		enc1 = chr1 >> 2;
		enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
		enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
		enc4 = chr3 & 63;

		if (isNaN(chr2))
		{
			enc3 = enc4 = 64;
		}
		else if (isNaN(chr3))
		{
			enc4 = 64;
		}

		// Lets spit out the 4 encoded bytes
		out = out + keyStr.charAt(enc1) + keyStr.charAt(enc2) + keyStr.charAt(enc3) +
		keyStr.charAt(enc4);

		// OK, now clean out the variables used.
		chr1 = chr2 = chr3 = "";
		enc1 = enc2 = enc3 = enc4 = "";

	} while (i < inp.length);
	// And finish off the loop

	// Now return the encoded values.
	return out;
}

function decode69(inp)
{
	var out = "";							// This is the output
	var chr1, chr2, chr3 = "";				// These are the 3 decoded bytes
	var enc1, enc2, enc3, enc4 = "";		// These are the 4 bytes to be decoded
	var i = 0; //Position counter

	// remove all characters that are not A-Z, a-z, 0-9, +, /, =, %, $, -, _
	var base64test = /[^A-Za-z0-9+/=%$-_]/g;

	if (base64test.exec(inp))				// Do some error checking
	{
		alert("There were invalid base64 characters in the input text.n" +
		"Valid base64 characters are A-Z, a-z, 0-9, ?+?, ?/?, and ?=?n" +
		"Expect errors in decoding.");
	}
	inp = inp.replace(/[^A-Za-z0-9+/=%$-_]/g, "");

	do	// Here¡¯s the decode loop.
	{
		// Grab 4 bytes of encoded content.
		enc1 = keyStr.indexOf(inp.charAt(i++));
		enc2 = keyStr.indexOf(inp.charAt(i++));
		enc3 = keyStr.indexOf(inp.charAt(i++));
		enc4 = keyStr.indexOf(inp.charAt(i++));

		// Heres the decode part. There¡¯s really only one way to do it.
		chr1 = (enc1 << 2) | (enc2 >> 4);
		chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
		chr3 = ((enc3 & 3) << 6) | enc4;

		// Start to output decoded content
		out = out + String.fromCharCode(chr1);

		if (enc3 != 64)
		{
			out = out + String.fromCharCode(chr2);
		}
		if (enc4 != 64)
		{
			out = out + String.fromCharCode(chr3);
		}

		// now clean out the variables used
		chr1 = chr2 = chr3 = "";
		enc1 = enc2 = enc3 = enc4 = "";

	} while (i < inp.length);				// finish off the loop

	// Now return the decoded values.
	return out;
}

////////////////////////////////////////////////////////////////////////////////


/*	Function Equivalent to java.net.URLEncoder.encode(String, "UTF-8")
	Copyright (C) 2002, Cresc Corp.
	Version: 1.0
*/
function encodeURL(str)
{
	var s0, i, s, u;
	s0 = "";								// encoded str
	for (i = 0; i < str.length; i++)		// scan the source
	{
		s = str.charAt(i);
		u = str.charCodeAt(i);				// get unicode of the char
		if (s == " "){s0 += "+";}			// SP should be converted to "+"
		else
		{
			// check for escape
			if ( u == 0x2a || u == 0x2d || u == 0x2e || u == 0x5f
				|| ((u >= 0x30) && (u <= 0x39)) || ((u >= 0x41) && (u <= 0x5a))
				|| ((u >= 0x61) && (u <= 0x7a)))
			{
				s0 = s0 + s;			// don't escape
			}
			else					// escape
			{
				// single byte format
				if ((u >= 0x0) && (u <= 0x7f))
				{
					s = "0"+u.toString(16);
					s0 += "%"+ s.substr(s.length-2);
				}
				else if (u > 0x1fffff)		// quaternary byte format (extended)
				{
					s0 += "%" + (oxf0 + ((u & 0x1c0000) >> 18)).toString(16);
					s0 += "%" + (0x80 + ((u & 0x3f000) >> 12)).toString(16);
					s0 += "%" + (0x80 + ((u & 0xfc0) >> 6)).toString(16);
					s0 += "%" + (0x80 + (u & 0x3f)).toString(16);
				}
				else if (u > 0x7ff)		// triple byte format
				{
					s0 += "%" + (0xe0 + ((u & 0xf000) >> 12)).toString(16);
					s0 += "%" + (0x80 + ((u & 0xfc0) >> 6)).toString(16);
					s0 += "%" + (0x80 + (u & 0x3f)).toString(16);
				}
				else						// double byte format
				{
					s0 += "%" + (0xc0 + ((u & 0x7c0) >> 6)).toString(16);
					s0 += "%" + (0x80 + (u & 0x3f)).toString(16);
				}
			}
		}
	}
	return s0;
}

/*	Function Equivalent to java.net.URLDecoder.decode(String, "UTF-8")
	Copyright (C) 2002, Cresc Corp.
	Version: 1.0
*/
function decodeURL(str)
{
	var s0, i, j, s, ss, u, n, f;
	s0 = "";				// decoded str
	for (i = 0; i < str.length; i++)	// scan the source str
	{
		s = str.charAt(i);
		if (s == "+") {s0 += " ";}		// "+" should be changed to SP
		else
		{
			if (s != "%") {s0 += s;}		// add an unescaped char
			else{				// escape sequence decoding
				u = 0;			// unicode of the character
				f = 1;			// escape flag, zero means end of this sequence
				while (true)
				{
					ss = "";		// local str to parse as int
					for (j = 0; j < 2; j++ )	// get two maximum hex characters for parse
					{
						sss = str.charAt(++i);
						if (((sss >= "0") && (sss <= "9"))
							|| ((sss >= "a") && (sss <= "f"))
							|| ((sss >= "A") && (sss <= "F")))
						{
							ss += sss;		// if hex, add the hex character
						}
						else
						{
							--i;
							break;
						}	// not a hex char., exit the loop
					}
					n = parseInt(ss, 16);			// parse the hex str as byte
					if (n <= 0x7f){u = n; f = 1;}	// single byte format
					if ((n >= 0xc0) && (n <= 0xdf)){u = n & 0x1f; f = 2;}	// double byte format
					if ((n >= 0xe0) && (n <= 0xef)){u = n & 0x0f; f = 3;}	// triple byte format
					if ((n >= 0xf0) && (n <= 0xf7)){u = n & 0x07; f = 4;}	// quaternary byte format (extended)
					if ((n >= 0x80) && (n <= 0xbf)){u = (u << 6) + (n & 0x3f); --f;}	// not a first, shift and add 6 lower bits
					if (f <= 1){break;}			// end of the utf byte sequence
					if (str.charAt(i + 1) == "%"){ i++ ;}					// test for the next shift byte
					else {break;}					// abnormal, format error
				}
			s0 += String.fromCharCode(u);			// add the escaped character
			}
		}
	}
	return s0;
}

/**
* ÀÌ¹ÌÁö ÆÄÀÏÀÎÁö¸¦ Ã¼Å©
* ÀÌ¹ÌÁö ÆÄÀÏÀÌ ¾Æ´Ï¸é false ¹ÝÈ¯
*/
function CkImageVal(fileName)
{
	var isImgFile = false;
	if((/(.jpg|.jpeg|.gif|.png)$/i).test(fileName))
	{
		isImgFile = true;
	}
	else
	{
		isImgFile = false;
	}

	return isImgFile;
}

/**
* °æ·Î ÀüÃ¼¸¦ °¡Á®¿Í¼­ , ÆÄÀÏ ÀÌ¸§¸¸ ¹ÝÈ¯
*/
function getUrltoFileName(url) {
	var fileName = "";
	var index = url.lastIndexOf("\\");
	if(index == -1)
		return url;
	else {
		fileName = url.substring(index+1);
		return fileName;
	}
}


function isAlphaNumeric2( checkStr ) {
	//var reg = /^[a-zA-Z0-9]+$/;
	var ch;
	var fullFileName, fileName, imgName;
	fullFileName = getUrltoFileName(checkStr);
	fileName = fullFileName.split('.')[0];

	for ( k = 0; k < fileName.length; k++ )
	{
		ch = fileName.charAt(k);
		if ( !(('0' <= ch && '9' >= ch ) || ('A' <= ch && 'Z' >= ch ) || ('a' <= ch && 'z' >= ch ) || ( ch == '_' )) )
		{
			if ( ch == ' ' ) {
				alert("ÀÌ¹ÌÁö ÆÄÀÏ¸íÀº °ø¹éÀ» »ç¿ëÇÒ¼ö ¾ø½À´Ï´Ù.");
			} else {
				alert("ÀÌ¹ÌÁö ÆÄÀÏ¸íÀº ¿µ¹®ÀÚ, ¼ýÀÚ, '_' ¿ÜÀÇ ¹®ÀÚ´Â »ç¿ëÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.");
			}
			return (false);
		}
	}
	return (true);
}



//Æù²Ù¹Ì±â(svc_tums_flg, songId)
function decoratePhone(val, songId){
	var phoneValue = val;
	var phoneImgStr = "";
	var p_value="";

	/* ÇöÀç ¿î¿µ¿¡¼­ »ç¿ëÇÏ´Â °Í
	if(phoneValue != "" && phoneValue != null && phoneValue.length >= 2){
		p_value =  phoneValue.substring(0,2);

		if(p_value != '00'){

			phoneImgStr = "<a href=\"javascript:popPhoneDecorate('"+p_value+"','"+songId+"');\"><img src=http://image.melon.co.kr/images/kpop/lit_phone_btn_on.gif width=12 height=18></a>";
		}else {
			phoneImgStr = "<img src=http://image.melon.co.kr/images/kpop/lit_phone_btn_off.gif width=12 height=18>";
		}
	}else {
		phoneImgStr = "<img src=http://image.melon.co.kr/images/kpop/lit_phone_btn_off.gif width=12 height=18>";
	}
	*/


	/*  ³ªÁß¿¡ Àû¿ëµÉ °Í  */
	//Ã¹Â° ÀÚ¸®´Â ÄÃ·¯¸µ,  µÎ¹øÂ° ÀÚ¸®´Â ¶óÀÌºêº§,  ¼¼¹øÂ° ÀÚ¸®´Â Ä¿ÆÃº§
	if(phoneValue == "" || phoneValue == null || phoneValue.length < 4){
		phoneImgStr = "<img src=http://image.melon.co.kr/images/kpop/lit_phone_btn_off.gif width=12 height=18>";

    } else if(phoneValue.length >=4 && phoneValue.length < 16) {

		if(phoneValue.substring(0,4) == '0000' || phoneValue.substring(0,4) == '0001'){
			phoneImgStr = "<img src=http://image.melon.co.kr/images/kpop/lit_phone_btn_off.gif>";

		//À½Ç¥ÇÏ³ª(ÄÆÆÃº§¸¸ Á¦°øÀÌ µÉ¶§)
		}else if(phoneValue.substring(0,4) == '0010'){
			phoneImgStr = "<a href=\"javascript:popPhoneDecorate('"+phoneValue+"','"+songId+"');\"><img src=http://image.melon.co.kr/images/kpop/icon_cutting.gif  alt='ÄÆÆÃº§'></a>";

		}else {
            	var phoneAltStr = "";
            	if (phoneValue.substring(0,1)==1) phoneAltStr += "ÄÃ·¯¸µ/";
            	if (phoneValue.substring(1,2)==1) phoneAltStr += "¶óÀÌºêº§/";
            	if (phoneValue.substring(2,3)==1) phoneAltStr += "ÄÆÆÃº§";

        		//ºÐÈ¤»öÀÌ¹ÌÁö(¶óÀÌºêº§°ú ÄÃ·¯¸µ, ¶Ç´Â ¾î´À ÇÑÂÊ¸¸ Á¦°øÀÌ µÉ¶§)
                if (phoneValue.substring(2,3)==0)
                {
        			phoneImgStr = "<a href=\"javascript:popPhoneDecorate('"+phoneValue+"','"+songId+"');\"><img src=http://image.melon.co.kr/images/kpop/lit_phone_btn_on.gif width=12 height=18  alt='"+phoneAltStr+"'></a>";
        		//À½Ç¥µÑ(ÄÆÆÃº§°ú ¶óÀÌºêº§ ¶Ç´Â ÄÃ·¯¸µ ¶Ç´Â 3°¡Áö ´Ù Á¦°øµÉ¶§ )
                } else {
        			phoneImgStr = "<a href=\"javascript:popPhoneDecorate('"+phoneValue+"','"+songId+"');\"><img src=http://image.melon.co.kr/images/kpop/icon_cutting_live.gif  alt='"+phoneAltStr+"'></a>";
                }
		}

	} else {

		if(phoneValue.substring(0,7) == '0000000' || phoneValue.substring(0,7) == '0001000'){
			phoneImgStr = "<img src=http://image.melon.co.kr/images/kpop/lit_phone_btn_off.gif>";

		//À½Ç¥ÇÏ³ª(ÄÆÆÃº§¸¸ Á¦°øÀÌ µÉ¶§)
		}else if(phoneValue.substring(0,7) == '0010000'){
			phoneImgStr = "<a href=\"javascript:popPhoneDecorate('"+phoneValue+"','"+songId+"');\"><img src=http://image.melon.co.kr/images/kpop/icon_cutting.gif  alt='ÄÆÆÃº§'></a>";

		}else {
            	var phoneAltStr = "";
            	if (phoneValue.substring(0,1)==1) phoneAltStr += "ÄÃ·¯¸µ/";
            	if (phoneValue.substring(1,2)==1) phoneAltStr += "¶óÀÌºêº§/";
            	if (phoneValue.substring(2,3)==1) phoneAltStr += "ÄÆÆÃº§/";
		        if (phoneValue.substring(5,6)==1) phoneAltStr += "µ¿¿µ»óº§/";
		        if (phoneValue.substring(6,7)==1) phoneAltStr += "Æù³ë·¡¹æ";

        		//ºÐÈ¤»öÀÌ¹ÌÁö(¶óÀÌºêº§°ú ÄÃ·¯¸µ, ¶Ç´Â ¾î´À ÇÑÂÊ¸¸ Á¦°øÀÌ µÉ¶§)
                if (phoneValue.substring(2,3)==0)
                {
        			phoneImgStr = "<a href=\"javascript:popPhoneDecorate('"+phoneValue+"','"+songId+"');\"><img src=http://image.melon.co.kr/images/kpop/lit_phone_btn_on.gif width=12 height=18  alt='"+phoneAltStr+"'></a>";
        		//À½Ç¥µÑ(ÄÆÆÃº§°ú ¶óÀÌºêº§ ¶Ç´Â ÄÃ·¯¸µ ¶Ç´Â 3°¡Áö ´Ù Á¦°øµÉ¶§ )
                } else {
        			phoneImgStr = "<a href=\"javascript:popPhoneDecorate('"+phoneValue+"','"+songId+"');\"><img src=http://image.melon.co.kr/images/kpop/icon_cutting_live.gif  alt='"+phoneAltStr+"'></a>";
                }
		}


	}


	document.write(phoneImgStr);
}


//Æù¿¡ ´ëÇÑ ¼³¸í(³»¿ëÀº ¾øÁö¸¸ ¾ø¾Ö¸é ½ºÅ©¸³Æ® ¿¡·¯³³´Ï´Ù.)
function viewPhoneImg(){
	document.write("");
}


//Web to Phone ¼­ºñ½º
function goSongInfo(songId, menuId)
{
	var url="/gnb2/popupBox/phone_song_down.jsp?p_songid="+songId+"&p_menuid="+menuId;
	//var url="/gnb2/popupBox/wtp_check.jsp?p_songid="+songId+"&p_menuid="+menuId;
	wWidth = 390;
	wHeight = 580;
	var x = wWidth;
	var y = wHeight;
	var sx = window.screen.width  / 2 - x / 2;
	var sy = window.screen.height / 2 - y / 2  - 40;
	var option = "location=no,menubar=no,toolbar=no,scrollbars=no,resizable=no,status=no,width=" + x + ",height=" + y + ",top=" + sy + ",left=" + sx ;
	newWin = window.open(url, "songInfo", option);
	newWin.focus();
}



//¾Ù¹ü»ó¼¼È­¸éÀ¸·Î ÀÌµ¿
function goAlbum(url){
	document.location.href=url;
}


//¹ÂÁ÷ºñµð¿À W2P µ¿ÀÛ
function openMvDown(mvId, menuId){

    var url= host + "/gnb2/popupBox/phone_mv_down.jsp?pageGubun=normal&p_mvid="+mvId;
	wWidth = 390;
	wHeight = 580;
	var x = wWidth;
	var y = wHeight;
	var sx = window.screen.width  / 2 - x / 2;
	var sy = window.screen.height / 2 - y / 2  - 40;
	var option = "location=no,menubar=no,toolbar=no,scrollbars=no,resizable=no,status=no,width=" + x + ",height=" + y + ",top=" + sy + ",left=" + sx ;
	newWin = window.open(url, "wtpMvDown", option);
	newWin.focus();
}

//function goLottePage(){
//	var URL = 'PIMS/event/lottecard/noMelon_ProductSelect.jsp';
//	window.open(URL,'height=330,width=452');
//}

function imgOneStepCheck(obj){
   var strIdx = 0;

   if(obj.src.indexOf("_th.jpg") > 0){
		strIdx = obj.src.indexOf("_th.jpg");
		obj.src = obj.src.substring(0, strIdx)+ ".jpg";

   }else if(obj.src.indexOf(".jpg") > 0){
		strIdx = obj.src.indexOf(".jpg");
		obj.src = obj.src.substring(0, strIdx)+ ".JPG";

   }else{
		defaultImg(obj);
   }
	return;
}

function getXhrPageInfo(addParam, actionMethodName) {
	var req;
	if (window.ActiveXObject) {
		req = new ActiveXObject("Microsoft.XMLHTTP");
	}
	else if (window.XMLHttpRequest) {
		req = new XMLHttpRequest();
	}

	req.open("GET", addParam, true);

	req.onreadystatechange = function() {
	// only if req shows "loaded"

		if (req.readyState == 4) {
			// only if "OK"
			if (req.status == 200) {
				//alert(req.responseText);
				// ¼º°øÀûÀ¸·Î È­¸éÀ» ¹Þ¾Æ¿Ã°æ¿ì ÃëÇÒ action Á¤ÀÇ
				actionMethodName(req.responseText);
			} else {
				alert("There was a problem retrieving the XML data:\n" + req.statusText);
			}

		}

	}

	req.send(null);
}

/* ¹ÂÁ÷ºñµð¿À ¸®½ºÆ®È­¸é¿ë ±â´É¹öÆ° ¼±ÅÃ½Ã ÀÛµ¿ÇÏ´Â ÇÔ¼öµé */
//checkbox ÀüÃ¼¼±ÅÃ, ÇØÁ¦
var str=false;
function allChk(obj){

	if( !str ) str = true;
    else str = false;

	for( var i=0;i<obj.elements.length; i++){
		var e= obj.elements[i];
		if(e.type == "checkbox")e.checked = str;
	}
}

//ÀüÃ¼º¸±â
function allView(obj){

	var mvId = "";

	for( var i=0;i<obj.elements.length; i++){
		var e= obj.elements[i];
		if(e.type == "checkbox"){
			e.checked = true;
			mvId += e.value + ",";
		}
	}
	mvId = mvId.substring(0, mvId.length -1); //¸¶Áö¸· ','´Â »èÁ¦
	//alert("mvId>>>" + mvId);

	play_melon_vod2('', mvId);

}


//¼±ÅÃº¸±â
function selectView(obj){

	var returnValue = false;
	var idx=0;
	var mvId = "";
	for(var i=0; i < obj.elements.length; i++){
		var e = obj.elements[i];
		if(e.checked){
		    if(e.name != "" && e.value != null && IsNumeric(e.value)){

    			mvId += e.value + ",";
    			returnValue = true;
    		}
		}
	}

	if(!returnValue){
		alert("¹ÂÁ÷ºñµð¿À¸¦ ¼±ÅÃÇØ ÁÖ½Ê½Ã¿À");
	}else{
		mvId = mvId.substring(0, mvId.length -1); //¸¶Áö¸· ','´Â »èÁ¦
		//alert("mvId>>>" + mvId);
		play_melon_vod2('', mvId);

	}
}
/* ¹ÂÁ÷ºñµð¿À ¸®½ºÆ®È­¸é¿ë ±â´É¹öÆ° ¼±ÅÃ½Ã ÀÛµ¿ÇÏ´Â ÇÔ¼öµé ³¡ */

/* °¢Á¾ ÆË¾÷Ã¢¿¡¼­ openerÆäÀÌÁö Á¦¾î½Ã »ç¿ëÇÏ´Â ÇÔ¼ö */
var pUtil = new popupPageUtil();
function popupPageUtil(){

	////
	this.openerControl = function(pageName){
		/* opener°¡ APPÀÏ°æ¿ì´Â »õÃ¢À» ¶ç¿ò.
		   ±×¿Ü¿¡´Â openerÃ¢ º¯°æ */
		var fromMPS = getCookie("MPS");
		var opn;

		try{
			opn = opener.location.href;
			
		}catch(e){
//			alert(e);
			opener = null;
		}

		if(fromMPS != null && fromMPS.indexOf("MELONPLAYER")>=0){
			window.open(pageName,"","");
			opener=window;
			self.close();
		}else{
			if (opener == null || typeof(opener) == 'undefined') {
				window.open(pageName,"","");
				opener=window;
				self.close();
			} else if (opener.closed) {
				window.open(pageName,"","");
				self.close();
			} else if(opn.indexOf("ext/ocb")>-1){
				// OCBÀÏ°æ¿ì »õÃ¢
				window.open(pageName,"","");
				self.close();
			}else {

				if( opener.name=='album' || opener.name=='cart'){
					opener.opener.location.href = pageName;
				}
				else if(opener.name=='fr_artist'){
					opener.top.location.href = pageName;
				}
				else if( opener.name=='melonVOD'){
					opener.opener.location.href = pageName;
					opener.close();
				}
				else{
					opener.location.href = pageName;
				}
				self.close();
			}
		}

	}
    ////

}



/*
	Ã¼Å©¹Ú½ºÀÇ ¼±ÅÃ¿©ºÎ¸¦ °Ë»çÇÑ´Ù.
	@param obj
	@return true - ¾Æ¹«°Íµµ ¼±ÅÃ¾ÈµÊ, false - ¼±ÅÃµÊ
 */
function IScheck_All2(obj) {
	var returnVal = true;

	if(obj != null) {

		if(obj.length > 1) {

			for(var i = 0; i < obj.length; i++) {
				if(obj[i].checked) {
					returnVal = false;
					break;
				} else {
					returnVale = true;
				}
			}
		} else {
			returnVal = !obj.checked;
		}
	}

	return returnVal;
}




