//µå¸²À§Áî¿¡¼­ ¸¸µé¾îÁØ°Å
/*
function exmple() {
	msg=open("../popup/gunghap_test.html","exmple","scrollbars=no,width=519,height=500,resizable=no");
	msg.focus();
}
function sample() {
	msg=open("sample.htm","sample","scrollbars=yes,width=697,height=550,resizable=no");
	msg.focus();
}
function agree() {
	msg=open("../popup/popup_agree.html","agree","scrollbars=no,width=519,height=510,resizable=no");
	msg.focus();
}
function help() {
	msg=open("../popup/help.html","help","scrollbars=yes,width=534,height=510,resizable=no");
	msg.focus();
}
*/
//µå¸²À§Áî ¹öÆ° ·Ñ¿À¹ö È¿°ú ½ºÅ©¸³Æ®  STARAT

function event_pop(){
	win = window.open('http://fortune2.dreamwiz.com/event/','event_pop','width=500, height=500, menubar=no, toolbar=no, scrollbars=no, resizable=yes');				
	win.focus();
	
}
function event_dream(){
	win = window.open('http://fortune.dreamwiz.com/service/event/20070207/event_input2.asp','event_pop','width=500, height=500, menubar=no, toolbar=no, scrollbars=no, resizable=yes');				
	win.focus();
	
}

function exmple() {
	var f=document.frmBirth;
	url = "/menu/taste/"+f.itemparam.value+".jsp";
	msg=open(url,"exmple","scrollbars=no,width=519,height=500,resizable=no");
	msg.focus();
}

var oldImg;
function img_act() {
	var srcEl = event.srcElement;
	if( srcEl.type == "i1" ) {
		oldImg = srcEl.src;
		srcEl.src = srcEl.onimg;
	}
}
function img_inact() {
	var srcEl = event.srcElement;
	if( srcEl.type == "i1" ) { srcEl.src = oldImg; }
}
//µå¸²À§Áî ¹öÆ° ·Ñ¿À¹ö È¿°ú ½ºÅ©¸³Æ®  END
//ÀÌ¶óÀÌÇÁ¿¡¼­ ¸¸µç°Å.
function openSample() {
	var f=document.frmBirth;
	url = "/sample/"+f.itemparam.value+"_sample.html";
//	url = f.itemparam.value+"_sample.html";
	window.open(url,"","scrollbars=yes,width=700,height=650,resizable=no,left=1,top=1");		
	return;
}
function openSample_tojung() {
	var f=document.frmBirth;
	url = "/sample/tojungguide_sample.html";
//	url = f.itemparam.value+"_sample.html";
	window.open(url,"","scrollbars=yes,width=700,height=650,resizable=no,left=1,top=1");		
	return;
}

function openSample_jrplus() {
	var f=document.frmBirth;
	url = "/elifedata/jrplus/sample/jrplus_sample.html";
//	url = f.itemparam.value+"_sample.html";
	window.open(url,"","scrollbars=no,width=650,height=550,resizable=no,left=1,top=1");		
	return;
}

function gender(sel){
	var f=document.frmBirth;
	if(sel==1){
	mygender=f.mygender.value;
	if(mygender==1) f.pgender.value=2;
	else f.pgender.value=1;
	}
	else{
	pgender=f.pgender.value;
	if(pgender==1) f.mygender.value=2;
	else f.mygender.value=1;
	}	
}

function goFree(type) {
	var f=document.frmBirth;

	f.myname.value=deleteTag(f.myname.value);

	if (f.myname.value=="") {
		alert("ÀÌ¸§À» ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		f.myname.focus();
		return false;
	}

	if (f.myyear.value<1905 || f.myyear.value>2005){
			alert('ÅÂ¾î³­ ³âµµ¸¦ 1905³â¿¡¼­ 2005³â »çÀÌÀÇ °ªÀ» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.');
			f.myyear.value = "";
			f.myyear.focus();
			return false;
	}

	if (type=='gung'){
		if(f.pname.value=="") {
			alert("»ó´ë¹æÀÇ ÀÌ¸§À» ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
			f.pname.focus();
			return false;
		}

		if (f.pyear.value.length!=4){
			alert('ÅÂ¾î³­ ³âµµ¸¦ 1905³â¿¡¼­ 2005³â »çÀÌÀÇ °ªÀ» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.');
			f.pyear.value = "";
			f.pyear.focus();
			return false;
		}
	}
	return true;
}
function goSub(type) {

	var f=document.frmBirth;
	var itemparam=f.itemparam.value;

	f.myname.value=deleteTag(f.myname.value);

	if (f.myname.value=="") {
		alert("ÀÌ¸§À» ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		f.myname.focus();
		return false;
	}

	

	if (f.myyear.value<1905){
			alert('ÅÂ¾î³­ ³âµµ¸¦ 1905³â¿¡¼­ 2008³â »çÀÌÀÇ °ªÀ» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.');
			f.myyear.value = "";
			f.myyear.focus();
			return false;
	}
	
	if (type=="astro"){
		f.myhour.value = f.btime.value + f.bhour.value;
	
	}
	if (type=="gsaju"){
		mycaleap = f.mycaleap.value;
		if(mycaleap=="0"){
			f.myleap.value="0";
			f.mycalendar.value="0";
		}else if(mycaleap =="1"){
			f.myleap.value="0";
			f.mycalendar.value="1";
		}else if(mycaleap =="2"){
			f.myleap.value="1";
			f.mycalendar.value="1";
		}
	}

	if (itemparam=="babysaju"){

		f.surname.value=deleteTag(f.surname.value);

			if(f.surname.value==""){
			alert("¾ÆÀÌÀÇ ¼ºÀ» ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
			f.surname.focus();
			return false;
		}

	}
	if (type=='succgung'){

		f.pname.value=deleteTag(f.pname.value);

		if(f.pname.value==""){
			alert("»ó´ë¹æÀÇ ÀÌ¸§À» ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
			f.pname.focus();
			return false;
		}

		currentDate = new Date();     //½ÇÁ¦ ½Ã°£°ú ³¯Â¥ ¾ò±â

		var year  = currentDate.getYear();
		var month = (currentDate.getMonth() + 1);

		if (parseInt(f.myyear.value) > parseInt(f.wyear.value) || parseInt(f.pyear.value) > parseInt(f.wyear.value) ){
			alert("°áÈ¥³âµµ¿Í ÅÂ¾î³­ ³âµµ¸¦ È®ÀÎÇØÁÖ¼¼¿ä.");
			return false;
		}
		if (parseInt(f.myyear.value) > parseInt(f.cyear.value) || parseInt(f.pyear.value) > parseInt(f.cyear.value) ){
			alert("¸¸³­³âµµ¿Í ÅÂ¾î³­ ³âµµ¸¦ È®ÀÎÇØÁÖ¼¼¿ä.");
			return false;
		}
		if (parseInt(f.cyear.value) > parseInt(f.wyear.value) ){
			alert("°áÈ¥³âµµ¿Í ¸¸³­³âµµ¸¦ È®ÀÎÇØÁÖ¼¼¿ä.");
			return false;
		}
		
		if (parseInt(f.cyear.value) == year){
			if(parseInt(f.cmonth.value) > month){
				alert("¸¸³­ ´ÞÀ» È®ÀÎÇØÁÖ¼¼¿ä.");
				return false;
			}
		}
	}
	if (type=='gung'){

		f.pname.value=deleteTag(f.pname.value);

		if(f.pname.value=="") {
			alert("»ó´ë¹æÀÇ ÀÌ¸§À» ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
			f.pname.focus();
			return false;
		}

		if (f.pyear.value.length!=4){
			alert('ÅÂ¾î³­ ³âµµ¸¦ 1905³â¿¡¼­ 2005³â »çÀÌÀÇ °ªÀ» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.');
			f.pyear.value = "";
			f.pyear.focus();
			return false;
		}
	}

	if(f.agree.checked != true){
		alert('¾à°ü¿¡ µ¿ÀÇ¸¦ ÇÏÁö ¾ÊÀ¸¼Ì½À´Ï´Ù.');
		return false;
	}
	if(dateCheck(f.myyear.value, f.mymonth.value, f.myday.value,  f.mycalendar.value, f.myleap.value) == false)
	{
		alert('Á¤È®ÇÑ »ý³â¿ùÀÏÀ» ÀÔ·ÂÇØÁÖ¼¼¿ä');
		f.myname.focus();
		return false;
	}
	if(type == "gung")
	{
		if(dateCheck(f.pyear.value, f.pmonth.value, f.pday.value,  f.pcalendar.value, f.pleap.value) == false)
		{
			alert('»ó´ë¹æÀÇ Á¤È®ÇÑ »ý³â¿ùÀÏÀ» ÀÔ·ÂÇØÁÖ¼¼¿ä');
			f.pname.focus();
			return false;
		}		
	}
	return true;

}
function goPreview(type)
{
	var f = document.frmBirth;

	if(f.myname.value==""){
			alert('ÀÌ¸§À» ÀÔ·ÂÇØ ÁÖ¼¼¿ä.');
			f.myname.focus();
			return;
		}
	f.myname.value=deleteTag(f.myname.value);
	if(f.itemparam.value=="babysaju")
	{
		if(f.surname.value==""){
			alert('¼ºÀ» ÀÔ·ÂÇØ ÁÖ¼¼¿ä.');
			f.surname.focus();
			return;
		}
	}
	if(type=="gung")
	{
		if(f.pname.value==""){
			alert("»ó´ë¹æ ÀÌ¸§À» ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
			f.pname.focus();
			return;
		}
	f.pname.value=deleteTag(f.pname.value);

		if(f.mygender.value==f.pgender.value)
		{
			alert("¼ºº°À» ´Ù½Ã ¼±ÅÃÇØÁÖ¼¼¿ä.");
			return false;
		}
	}
		
	f.action=f.itemparam.value+"_result.jsp";  
	f.submit();
	
}
function Taro_Coin() {
	var f = document.frmBirth;
	var name = f.itemparam.value + "_coin";
	if(f.agree.checked != true){
		alert('¾à°ü¿¡ µ¿ÀÇ¸¦ ÇÏÁö ¾ÊÀ¸¼Ì½À´Ï´Ù.');
		return;
	}
	if(f.myname.value==""){
		alert('ÀÌ¸§À» ÀÔ·ÂÇØÁÖ¼¼¿ä.');
		return;
	}
	
	window.open('',name,'width=400,height=350,scrollbars=no,menubar=no');
	f.action="/billing/dreamwiz.jsp";
	f.target = name;
	/*f.action="/outdata/lovetaro_result.jsp";
	f.method="get";*/
	f.submit();
}
function goCoin() {
	var f = document.frmBirth;
	var name = f.itemparam.value + "_coin";
//	windowResizeTo();
	window.open('',name,'width=400,height=350,scrollbars=no,menubar=no');
	f.action="/billing/dreamwiz.jsp";
	f.method="get";
	f.target = name;
	f.submit();
}

function goCoin_lovestory() {
	var f = document.frmBirth;
	var name = f.itemparam.value + "_coin";
//	windowResizeTo();
	window.open('',name,'width=400,height=350,scrollbars=no,menubar=no');
	f.action="/outdata/lovestory_code.jsp";
	f.method="get";
	f.target = name;
	f.submit();
}

function goCoin_test() {
	var f = document.frmBirth;
	if(f.itemparam.value=="tojung"){
		f.action="/outdata/"+f.itemparam.value + "_value.jsp";
	}else if(f.itemparam.value=="unsei"){
		f.action="/outdata/daily_today.jsp";
	}else if(f.itemparam.value=="saju"){
		f.action="/outdata/sajuguide_result.jsp";
	}else if(f.itemparam.value=="gung"){
		f.action="/outdata/gungguide_result.jsp";
	}else if(f.itemparam.value=="love"){
		f.action="/outdata/loveguide_result.jsp";
	}else if(f.itemparam.value=="myhalf"){
		f.action="/elifedata/myhalf/myhalf_result.jsp";
	}else if(f.itemparam.value=="jrplus"){
		f.action="/elifedata/jrplus/jrplus_value.jsp";
	}else if(f.itemparam.value=="jinro"){
		f.action="/outdata/jinroguide_result.jsp";
	}else if(f.itemparam.value=="baby"){
		f.action="/outdata/babyguide_self.jsp";
	}else{
		f.action="/outdata/"+f.itemparam.value + "_result.jsp";
	}
	f.method="get";
	f.submit();
}

function randomValue() {
	var
	iStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; // ·£´ýÀ¸·Î Ç¥½ÃµÉ ¹®ÀÚ
	var n=0;
	var i=0;
	var s="";
	len=8; //±æÀÌ

	for (x=1;x<=len;x++) {
		n=Math.random()*62;
		i=Math.round(n);
		s+=iStr.charAt(i);
	}
	return s;
}

function changePage(p) {
	var f=document.frmBirth;
	f.page.value=p;
	f.method="get"
	f.target="_self";		
	f.action= f.act.value + "_result.jsp";
	f.submit();
}

function webPrint(){
	var f=document.frmBirth;
	win=window.open('','printOP','width=700, height=650, menubar=no, toolbar=no, scrollbars=yes, resizable=yes');	
	f.target="printOP";
	f.action= f.act.value + "_print.jsp";	
	f.method="get"
	f.submit();
	win.focus();
	 return;
}

function onlyNumber() {//¼ýÀÚ¸¸À» ±âÀÔ¹Þ°Ô ÇÏ´Â ¹æ¹ý
   if((event.keyCode<48)||(event.keyCode>57)){
    event.returnValue=false;
	}	
}

function Agree() {
	window.open("/menu/agree.html","openAgree","scrollbars=no,width=519,height=480,resizable=no")
}

function openWindow(url, width, height, winName, scl) {
  var win;
  var window_left = (screen.width - width)/2;
  var window_top = (screen.height - height)/2;
  if (scl==null) scl='0';
  if (width==null) width='500';
  if (height==null) height='500';
  win = window.open(url, winName, 'toolbar=0, directories=0, location=0, menubar=0, resizable=0, scrolling=0, status=0, statusbar=0, scrollbars='+scl+', width='+width+', height='+height+', top=' + window_top + ',left= ' + window_left + '');
  win.focus();
}


function openError() {
	window.open('/menu/error_mail.jsp?companyparam=dreamwiz','mail','width=585, height=640, scrollbars=yes, left=1, top=1');
	return;
}
function openErro() {
	window.open('/menu/error_mail.jsp?companyparam=dreamwiz','mail','width=585, height=640, scrollbars=yes, left=1, top=1');
	return;
}
function goTasting() {
	var f=document.frmBirth;
	var targeturl = "/tasting/"+f.itemparam.value+".jsp";

	window.open(targeturl,'tasting','width=560, height=320, menubar=no, toolbar=no, scrollbars=no');
	return;
}

function dateCheck(tyear, tmonth, tday, isLunar, isLeap)/*³â ¿ù ÀÏ ¾çÀ½(0,1), À±´Þ¿©ºÎ(0,1)*/
	{


		var lunarMonthTable = [[1, 2, 4, 1, 1, 2, 1, 2, 1, 2, 2, 1],   /* 1841 */
			 [2, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1],
			 [2, 2, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1],
			 [2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2],
			 [1, 2, 1, 2, 2, 1, 2, 1, 2, 1, 2, 1],
			 [2, 1, 2, 1, 5, 2, 1, 2, 2, 1, 2, 1],
			 [2, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2],
			 [1, 2, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1],
			 [2, 1, 2, 3, 2, 1, 2, 1, 2, 1, 2, 2],
			 [2, 1, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2],
			 [2, 2, 1, 2, 1, 1, 2, 1, 2, 1, 5, 2],   /* 1851 */
			 [2, 1, 2, 2, 1, 1, 2, 1, 2, 1, 1, 2],
			 [2, 1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2],
			 [1, 2, 1, 2, 1, 2, 5, 2, 1, 2, 1, 2],
			 [1, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2, 1],
			 [2, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2],
			 [1, 2, 1, 1, 5, 2, 1, 2, 1, 2, 2, 2],
			 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2, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1],
			 [2, 2, 1, 2, 5, 2, 1, 2, 1, 2, 1, 1],
			 [2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 2, 1],
			 [2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2],   /* 2041 */
			 [1, 5, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2],
			 [1, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 2]];
		var lastday;

		if(tyear < 1841 || tyear > 2040)
		{
			return false;
		}
		if(isLunar == false) //¾ç·ÂÀÏ°æ¿ì
		{
			if(isLeap == true)	//¾ç·Â½Ã À±´ÞÀÏ°æ¿ì´Â false
			{
				return false;
			}
			var solMonthDay = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
			if (tyear % 400 == 0 || ( tyear % 4 == 0 && tyear % 100 != 0 )) solMonthDay[1] += 1;


			if(tday > solMonthDay[tmonth - 1])//¾ç·Â½Ã ÀÏÃ¼Å©
			{
				return false;
			}
		}else
		{
			if(isLeap == false)
			{
				if(lunarMonthTable[tyear - 1841][tmonth - 1] == 1 || lunarMonthTable[tyear - 1841][tmonth - 1] == 3 || lunarMonthTable[tyear - 1841][tmonth - 1] == 4 )//Æò´ÞÀÌ°Å³ª À±´ÞÀÌÀÖÀ¸¸é¼­ Æò´ÞÀÌ 29ÀÏ±îÁöÀÖ°Å³ª ÇÒ°æ¿ì
				{
					lastday = 29;
				}else
				{
					lastday = 30;
				}
			}else
			{
				if(lunarMonthTable[tyear - 1841][tmonth - 1] == 3 || lunarMonthTable[tyear - 1841][tmonth - 1] == 5 )//À±´ÞÀÌ 29ÀÏ±îÁöÀÖÀ»°æ¿ì
				{
					lastday = 29;
				}else if(lunarMonthTable[tyear - 1841][tmonth - 1] == 4 || lunarMonthTable[tyear - 1841][tmonth - 1] == 6 )//À±´ÞÀÌ 30ÀÏ±îÁöÀÖÀ»°æ¿ì
				{
					lastday = 30;
				}else //À±´ÞÀÌ ¾ø´Â°æ¿ì
				{
					lastday = 0;
				}
			}

			if(tday > lastday)
			{
				return false;
			}

		}
		return true;
	}
//***SQL injectionÃ³¸®***//

function deleteTag(str)
{
	
	if(str != ""){	
			
		str=replaceAll(str,"'","");
		str=replaceAll(str,"or","");
		str=replaceAll(str,"and","");
		str=replaceAll(str,"--","");
		str=replaceAll(str,";","");
		str=replaceAll(str,"/*","");
		str=replaceAll(str,"*/","");
		str=replaceAll(str,"@@","");
		str=replaceAll(str,"select","");
		str=replaceAll(str,"alert","");
		str=replaceAll(str,"insert","");
		str=replaceAll(str,"update","");
		str=replaceAll(str,"delete","");
		str=replaceAll(str,"drop","");
		str=replaceAll(str,"create","");
		str=replaceAll(str,"exec","");
		str=replaceAll(str,"union","");
		str=replaceAll(str,"declare","");
		str=replaceAll(str,"alter","");
		str=replaceAll(str,"dbcc","");
		str=replaceAll(str,"set","");
		str=replaceAll(str,"exec","");
		str=replaceAll(str,"-shutdown","");
		str=replaceAll(str,"truncate table","");
		str=replaceAll(str,"union","");
		str=replaceAll(str,"xp_","");
		str=replaceAll(str,"sp_","");
		str=replaceAll(str,"sysobject","");
		str=replaceAll(str,"1=1","");
		str=replaceAll(str,"javascript","");
		str=replaceAll(str,"script","");
		str=replaceAll(str,"<","");
		str=replaceAll(str,">","");
		str=replaceAll(str,"(","&#40");
		str=replaceAll(str,")","&#41");
		str=replaceAll(str,"\"","");
		
	}
	
	return str;

}
function replaceAll(str,orgStr,repStr)
{
    return str.split(orgStr).join(repStr);
} 
