
var popup = null;

function goPopup(url){
        var pop
        pop = window.open(url,'','resizable=0,noresize,top=100,left=100,scrollbars=1');
        pop.focus();

}

function openWishBox(){
	
	if(popup == null || popup.closed){
		popup = window.open("./mywishbox.php",'','resizable=0,noresize,top=100,left=100,scrollbars=1');
	}else{
		popup.location.href="./mywishbox.php";
	}
	popup.focus();
	
}

/****** ÆË¾÷Ã¢ ¸®»çÀÌÁî **************************************************************/
function popResize(poss) {
	var thisX = document.getElementById("offsetTable").offsetWidth;
	var thisY = document.getElementById("offsetTable").offsetHeight;
	var headerY = document.getElementById("offsetTableHeader").offsetHeight;
	var footerY = document.getElementById("offsetTableFooter").offsetHeight;
	var maxThisX = screen.width - 50;
	var maxThisY = screen.height - 80;
	var marginY = headerY + footerY + 40; //¸¶Áö¸· ¼ö´Â »óÈ²¿¡µû¶ó ¾Ë¸Â°Ô ³ÖÀ¸¼¼¿ä. (ÅÛÇÃ¸´ÀÇ Çì´õ³ôÀÌ + Ç²ÅÍ ³ôÀÌ + ¾ËÆÄ)
	var scrollbarValue = "no";

        if(!poss)poss=1;
	if (thisX > maxThisX) {
		scrollbarValue = "yes";
		thisX = maxThisX;
	}
	if (thisY > maxThisY - marginY) {
		scrollbarValue = "yes";
		thisX += 19;
		thisY = maxThisY - marginY;
	}
	window.document.body.scroll = scrollbarValue;
	window.resizeTo(thisX+10,thisY+marginY);
	
	var windowX = (screen.width - (thisX+10))/2 + (30 * poss);
	var windowY = (screen.height - (thisY+marginY))/2 - 20 + (30 * poss);
	window.moveTo(windowX,windowY);
	//window.moveTo(0,0);
}

   function f_EmailCheck(target) {
	var t = target.value
	if (t != '') {
		var Alpha = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
		var Digit = '1234567890'
		var Symbol='_-'
		var check = '@.' + Alpha + Digit + Symbol
		   for (i=0; i < t.length; i++){
		       if(check.indexOf(t.substring(i,i+1)) < 0) {
						alert('E-MailÀÌ Á¤È®ÇÏÁö ¾Ê½À´Ï´Ù.');
						target.value = ""
						target.focus();
						return;
					}
				}

		var check = '@'
		var a = 0
		   for (i=0; i < t.length; i++){
		       if(check.indexOf(t.substring(i,i+1)) >= 0) {
						a = 1
					}
				}

		var check = '.'
		var b = 0
		   for (i=0; i < t.length; i++){
		       if(check.indexOf(t.substring(i,i+1)) >= 0) {
						b = 1
					}
				}
			if (a == 1){
				if (b == 1) {
					///////////////////  hanmail ÀÌ³ª ´ÙÀ½ ¸ø¾²°Ô
					var bugsVals = t.split("@");
					if(bugsVals[1]=="daum.net" || bugsVals[1]=="hanmail.com" ||  bugsVals[1]=="hanmail.net"||  bugsVals[1]=="daum.com" ){
						alert("\n\ndaum ÀÌ³ª hanmail·Î µî·ÏÇÏ½Ç ¼ö ¾ø½À´Ï´Ù. \n\nÀ§ ¸ÞÀÏ·Î µî·ÏÇÏ½Å °æ¿ì È®ÀÎ ¸ÞÀÏÀ» ¹ÞÀ¸½Ç¼ö ¾ø½À´Ï´Ù. \n\n");
						target.value = ""
						target.focus();
					}
					if(bugsVals[1]=="test.com" || bugsVals[1]=="asdf.com" ){
						alert("\n\ntest.comÀº µî·ÏÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.\n\n");
						target.value = ""
						target.focus();
					}
                               }else{
					alert('E-MailÀÌ Á¤È®ÇÏÁö ¾Ê½À´Ï´Ù.');
					target.value = ""
					target.focus();
				}
			}else{
					alert('E-MailÀÌ Á¤È®ÇÏÁö ¾Ê½À´Ï´Ù.');
					target.value = ""
					target.focus();
				}
				
	}
}