function getReturnURL( url ) {	
	var ret = "";

	for(var i=0; i<url.length; i++) {
		ret += (escape(url.charAt(i)).match(/%u/g) ? "u":"")+url.charCodeAt(i).toString(16).toUpperCase();
	}

	return ret;
}


function getReturnURL2( url )
{
	var idx = 0;
	var cpUrl = new Array();
	cpUrl[idx++]="http://comic.okcashbag.com"	//¸¸È­
	cpUrl[idx++]="http://movie.okcashbag.com"	//¿µÈ­
	cpUrl[idx++]="http://mpienaudio.okcashbag.com"	//AudioBook
	cpUrl[idx++]="http://music.okcashbag.com"	//À½¾Ç
	cpUrl[idx++]="http://japan.okcashbag.com"	//PlayJapan
	cpUrl[idx++]="http://mini.okcashbag.com"	//Mini ¸Þ¼¼Â¡
	cpUrl[idx++]= "http://local.okcashbag.com"	//¸ð¹ÙÀÏÁö¿ªÁ¤º¸
	cpUrl[idx++]= "http://mfortune.okcashbag.com";	//¸ð¹ÙÀÏ¿î¼¼
	cpUrl[idx++]="http://case.okcashbag.com"	//ÄÉÀÌ½ºÇÐ·ÂÁø´Ü
	cpUrl[idx++]="http://mpien.okcashbag.com"	//¿¥ÇÇ¾Ó
	cpUrl[idx++]="http://ebs.okcashbag.com"	//EBS°­ÁÂ
	cpUrl[idx++]="http://school.okcashbag.com"	//Ã¼ÇèÇÐ½À
	cpUrl[idx++]= DCM_URL + "/event/Game_event.jsp";	//¹«ÇÑ°ÔÀÓÁ¸
	cpUrl[idx++]="http://unse.okcashbag.com"	//ÀûÃµ½Å³â¿î¼¼
	cpUrl[idx++]="http://lucky.okcashbag.com"	//Á¤Åë¿î¼¼
	cpUrl[idx++]="http://funwide.okcashbag.com"	//Æù²Ù¹Ì±â
	cpUrl[idx++]="http://itemmall.okcashbag.com"	//Æù²Ù¹Ì±â
	cpUrl[idx++] = "http://gomurim.okcashbag.com";		//°í¹«¸²
	cpUrl[idx++] = "http://joara.okcashbag.com";		//Á¶¾Æ¶ó
	cpUrl[idx++] = "http://anicast.okcashbag.com";		//¾Ö´ÏÄ³½ºÆ®
	cpUrl[idx++]="http://booktopia.okcashbag.com";	//ÀüÀÚÃ¥¼­Á¡
	cpUrl[idx++]="http://tellybox.okcashbag.com";	//ÅÚ¸®¹Ú½º
	cpUrl[idx++]="http://phone.sktpoint.com";			//sktpoint Æù²Ù¹Ì±â
	cpUrl[idx++]="http://zzonge.okcashbag.com/";	//ÂÐÀÌ´åÄÄ

	exUrl = "http://funwide.okcashbag.com"
	/**
	cpUrl[idx++]="http://funwide.okcashbag.com/index_mfun.asp"	//Æù²Ù¹Ì±â
	cpUrl[idx++]="http://funwide.okcashbag.com/index_mbook.asp"	//¸ð¹ÙÀÏºÏ
	**/

	for(i=0; i<cpUrl.length; i++)
	{
		if(url.lastIndexOf(cpUrl[i]) >= 0 && cpUrl[i] != exUrl) {
			url = cpUrl[i];
		}
	}

	/**
	var ret = "";

	for( var i = 0; i < url.length; i++ ) {
		ret = ret + toHex( url.charCodeAt( i ) );
	}
	return ret;
	**/

	var ret = "";

	for(var i=0; i<url.length; i++) {
		ret += (escape(url.charAt(i)).match(/%u/g) ? "u":"")+url.charCodeAt(i).toString(16).toUpperCase();
	}

	return ret;
}

//ÈýÆ®¼ö °ü·Ã Åë°èÃ³¸® ºÎºÐ
function saveState()
{
	//Ä³½¬ Á¦°Å¸¦ À§ÇÑ ºÎºÐ(½Ã°£ ·£´ý)
	var nowDate = new Date();
	var randomNum = nowDate.getTime();

	//ÈýÆ®¼ö Ã³¸®¸¦ À§ÇÑ ºÎºÐ(ÀÌ¹ÌÁö È£Ãâ ¹æ½Ä)
	var statImage = new Image();
	cook_ecuserid = getCookieValue("ec_ecuserid");

	var url = this.location.href;

	var idx = 0;
	var cpUrl = new Array();
	cpUrl[idx++]=DCM_URL;
	cpUrl[idx++]="http://comic.okcashbag.com";	//¸¸È­
	cpUrl[idx++]="http://movie.okcashbag.com";	//¿µÈ­
	cpUrl[idx++]="http://mpienaudio.okcashbag.com";	//AudioBook
	cpUrl[idx++]="http://music.okcashbag.com";	//À½¾Ç
	cpUrl[idx++]="http://japan.okcashbag.com";	//PlayJapan
	cpUrl[idx++]="http://mini.okcashbag.com";	//Mini ¸Þ¼¼Â¡
	cpUrl[idx++]="http://local.okcashbag.com";	//¸ð¹ÙÀÏÁö¿ªÁ¤º¸
	cpUrl[idx++]= "http://mfortune.okcashbag.com";	//¸ð¹ÙÀÏ¿î¼¼
	cpUrl[idx++]="http://case.okcashbag.com"	;//ÄÉÀÌ½ºÇÐ·ÂÁø´Ü
	cpUrl[idx++]="http://mpien.okcashbag.com";	//¿¥ÇÇ¾Ó
	cpUrl[idx++]="http://ebs.okcashbag.com";	//EBS°­ÁÂ
	cpUrl[idx++]="http://school.okcashbag.com";	//Ã¼ÇèÇÐ½À
	cpUrl[idx++]="http://game.okcashbag.com";	//¹«ÇÑ°ÔÀÓÁ¸
	cpUrl[idx++]="http://unse.okcashbag.com"	;//ÀûÃµ½Å³â¿î¼¼
	cpUrl[idx++]="http://lucky.okcashbag.com";	//Á¤Åë¿î¼¼
	cpUrl[idx++]="http://funwide.okcashbag.com";	//Æù²Ù¹Ì±â
	cpUrl[idx++]="http://funwide.okcashbag.com";	//Æù²Ù¹Ì±â, ¸ð¹ÙÀÏºÏ
	cpUrl[idx++]= DCM_URL + "/event/";	//event
	cpUrl[idx++]="http://www.okcashbag.com"; 					//½ºÆÄÀÌÁ¦·Î : http://www.okcashbag.com/contents/SpyzeroMain.jsp
	cpUrl[idx++]="http://itemmall.okcashbag.com";
	cpUrl[idx++]="http://gamedown.okcashbag.com"; 		//´Ù¿î·Îµå°ÔÀÓ
	cpUrl[idx++]="http://live.okcashbag.com"; 				//¶óÀÌºêÄÝ
	cpUrl[idx++]="http://wizwall.okcashbag.com"; 			//À¯ÇØÁ¤º¸Â÷´Ü
	cpUrl[idx++] = "http://zinecafe.okcashbag.com";		//ÀâÁö
  cpUrl[idx++] = "http://100point.okcashbag.com";   //100Pµµ¼­°ü
  cpUrl[idx++] = "http://dpump.okcashbag.com";      //ÆßÇÁ
  cpUrl[idx++] = DCM_URL + "/talk/review"; //ÀÌ¿ë°ø°¨
  cpUrl[idx++] = DCM_URL + "/talk/humor";  //¶ß´ÂÀ¯¸Ó
  cpUrl[idx++] = DCM_URL + "/talk/photo";  //Æ÷Åä¼¼»ó
  cpUrl[idx++] = DCM_URL + "/talk/freeuse.jsp";     //¹«·á°ü
	cpUrl[idx++] = "http://sktzone.okcashbag.com";		//³×ÀÌÆ® Æù²Ù¹Ì±â
	cpUrl[idx++] = "http://gomurim.okcashbag.com";		//°í¹«¸²
	cpUrl[idx++] = "http://joara.okcashbag.com";		//Á¶¾Æ¶ó
	cpUrl[idx++] = "http://anicast.okcashbag.com";		//¾Ö´ÏÄ³½ºÆ®
	cpUrl[idx++]="http://booktopia.okcashbag.com";		//ÀüÀÚÃ¥¼­Á¡
	cpUrl[idx++]="http://tellybox.okcashbag.com";		//ÅÚ¸®¹Ú½º
	cpUrl[idx++]="http://phone.sktpoint.com";			//sktpoint Æù²Ù¹Ì±â
	cpUrl[idx++]="http://zzonge.okcashbag.com";	//ÂÐÀÌ´åÄÄ
	cpUrl[idx++]="http://ddo.okcashbag.com";	//´øÀü¾Øµå·¡°ï
	cpUrl[idx++]="http://dcmp.okcashbag.com/game/gameNews";	//°ÔÀÓ´º½º
	cpUrl[idx++]="http://dcmp.okcashbag.com/game/flashGame.jsp";	//ÇÃ·¡½¬°ÔÀÓ
	cpUrl[idx++]="http://www.cashup.co.kr";	//º¹±Ç
	cpUrl[idx++]="http://dcmp.okcashbag.com/melon.jsp";	//¸á·Ð
	cpUrl[idx++]="http://itemmall.okcashbag.com/gamemall/sun/";	//½ã¿Â¶óÀÎ
	cpUrl[idx++]="http://dcmp.okcashbag.com/enclean/";//¿£Å©¸°
	cpUrl[idx++]="http://toon.okcashbag.com/comic/";//ºÀ¼º´åÄÄ
	cpUrl[idx++]="http://spicus.okcashbag.com";//½ºÇÇÄí½º
	cpUrl[idx++]="http://bobpul.okcashbag.com";//¹äÇ®
	cpUrl[idx++]="http://accro.okcashbag.com";//¾ÆÅ©·Î
	cpUrl[idx++]="http://12sky.okcashbag.com"; //½ÊÀÌÁöÃµ
	cpUrl[idx++]="http://dotori.okcashbag.com"; //µµÅä¸®
	cpUrl[idx++]="http://dcmp.okcashbag.com/dcm/cashfoxy/"; //Ä³½¬Æø½Ã
	cpUrl[idx++]="http://kinomate.okcashbag.com"; //¿ÂÅ°³ë	2008-09-02
	cpUrl[idx++]="http://baduk.okcashbag.com"; //¹ÙµÏ
	cpUrl[idx++]="http://itemmall.okcashbag.com/malls/itemmain.jsp?svc_id=10000001"; //¼¼ÇÇ·ÎÁî
	cpUrl[idx++]="http://itemmall.okcashbag.com/malls/itemmain.jsp?svc_id=10000002"; //´ÙÅ©¿¡µ§
	cpUrl[idx++]="http://itemmall.okcashbag.com/malls/itemmain.jsp?svc_id=10000003";//½Ã¾Æ
	cpUrl[idx++]="http://itemmall.okcashbag.com/malls/itemmain.jsp?svc_id=10000004";//¿µ¿õ¹®
	cpUrl[idx++]="http://itemmall.okcashbag.com/malls/itemmain.jsp?svc_id=10000005";//½Å¿µ¿õ¹®
	cpUrl[idx++]="http://itemmall.okcashbag.com/malls/itemmain.jsp?svc_id=10000006";//¿¡µà¹Ú½º
	cpUrl[idx++]="http://brainon.okcashbag.com";//ºê·¹ÀÎ¿Â



	expUrl = "http://funwide.okcashbag.com";
	mobileBookString = "mbook";
	/**
	cpUrl[idx++]="http://funwide.okcashbag.com/index_mfun.asp"	//Æù²Ù¹Ì±â
	cpUrl[idx++]="http://funwide.okcashbag.com/index_mbook.asp"	//¸ð¹ÙÀÏºÏ
	**/

	var cpIdx = 0;		//CP ¹øÈ£(ÀÓÀÇ)
	for(i=1; i<cpUrl.length; i++)
	{
		if(url.lastIndexOf(cpUrl[i]) >= 0) {
			cpIdx = i;

			//½º¹Ì½º¾Ø ¸ð¹ÙÀÏÀÇ Æù²Ù¹Ì±â¿Í ¸ð¹ÙÀÏºÏ URLÀÌ µ¿ÀÏ ÇÏ¿© ±¸ºÐ Ã³¸®ÇÏ±â À§ÇØ¼­
			if(cpUrl[i] == expUrl && url.lastIndexOf(mobileBookString) >= 0)
				cpIdx += 1;

			break;
		}
	}

	statImage.src = "http://dcmp.okcashbag.com/dcm/stat/stat.jsp?random="+randomNum+"&depth="+cpIdx+"&ecuserid="+cook_ecuserid+"&cpurl="+this.location.href;
}

//saveState();
