function event_join(fkboard){
	WinPopup("/pappa/event/event_popup.asp?fkboard="+fkboard,"event", 560, 640,0) 
//	RequestData("GET" , "/pappa/event/event_popup.asp?fkboard="+fkboard, true , 'modal' , "inner");
}
function pop_person(){
	WinPopup("/pappa/person.html", 530, 628,0) 
//	RequestData("GET" , "/pappa/event/event_popup.asp?fkboard="+fkboard, true , 'modal' , "inner");
}
 
function event_view(fkboard,intSeq){
	WinPopup("/pappa/event/event_view_popup.asp?fkboard="+fkboard+"&intSeq="+intSeq,"event", 560, 640,0) 
	//modal_open();
	//RequestData("GET" , "/pappa/event/event_view_popup.asp?fkboard="+fkboard+"&intSeq="+intSeq, true , 'modal' , "inner");
}
function event_lastview(fkboard,intSeq){
	WinPopup("/pappa/event/event_view_popup.asp?mode=last&fkboard="+fkboard+"&intSeq="+intSeq,"event", 560, 640,0) 
	//modal_open();
	//RequestData("GET" , "/pappa/event/event_view_popup.asp?fkboard="+fkboard+"&intSeq="+intSeq, true , 'modal' , "inner");
}

function event_edit(fkboard,intSeq){
WinPopup("/pappa/event/event_view_popup.asp?mode=edit&fkboard="+fkboard+"&intSeq="+intSeq,"event", 560, 640,0) 
//	modal_open();
//	RequestData("GET" , "/pappa/event/event_popup.asp?mode=edit&fkboard="+fkboard+"&intSeq="+intSeq, true , 'modal' , "inner");
}

 

   function starPoint(ea)
  {
	var ea1 = eval(ea);
	for (var i=1;i<=ea1;i++)
	{
	  document.getElementById("star"+i).src = "/pappa/images/product/ic_star.gif";
	}
	for (i=5;i>ea1 ;i-- )
	{
	 document.getElementById("star"+i).src = "/pappa/images/product/ic_star_gray.gif";
	}
	document.theComment.intPoint.value = ea1;
  }

function product_scrap(seq,strCate)
	{
	       OpenFixWindow("/pappa/product/scrap_popup.asp?intSeq="+seq+"&strCate="+strCate, "PopUpCheck", "500", "300", "277", "300", "", "");
 	}

	function OpenFixWindow(url, winNm, x, y, frmW, frmH, option, isRtn) {
            x = parent.window.screenLeft;
            y = parent.window.screenTop;

            if (!option) option = "scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no"

            winprops = "left=" + x + ", top=" + y + ", width=" + frmW + ", height=" + frmH + "," + option;
            win = window.open(url, winNm, winprops);
            if (parseInt(navigator.appVersion) >= 4) {
                win.window.focus();
            }
            
            return false;
        }
function online(){
	//location.href="/pappa/franchise/establish.asp";
	divclose('total_menu');
	modal_open();
	RequestData("GET" , "/pappa/franchise/online_popup.asp", true , 'modal' , "inner");
}
function zipcode(){
	modal_open();
	RequestData("GET" , "/pappa/membership/innerLayer.asp?mode=zip", true , 'modal' , "inner");
}
function mypoint(){
	modal_open();
	RequestData("GET" , "/pappa/membership/innerLayer.asp?mode=point", true , 'modal' , "inner");
}
function check_zipcode(){
	var k=1; 
	if(k==9) 
		k=0; 
	key=event.keyCode; 
	if(key==13) 
	{ 
		k++; 
		zipcodesch();
	} 
	

}

function store_search(str){
	modal_open();
	RequestData("GET" , "/pappa/store/store_map.asp?sto_cd="+str, true , 'modal' , "inner");
}
 
function exponline(){
	str=document.getElementById('name').value;
	str1=document.getElementById('fran_tel1').value;
	str2=document.getElementById('fran_tel2').value;
	str3=document.getElementById('fran_tel3').value;
	str4=document.getElementById('exp_date').value;
	str5=document.getElementById('zone').value;
	if (str=="" )
	{
		alert("ÀÌ¸§À» ÀÔ·ÂÇÏ¼¼¿ä.");
		document.getElementById('name').focus();
		return
	}
		if (str1=="" || str2=="" || str3=="")
	{
		alert("¿¬¶ôÃ³¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
		document.getElementById('fran_tel1').focus();
		return
	}
		if (str4=="" )
	{
		alert("¼³¸íÈ¸ ÀÏ½Ã¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
		document.getElementById('exp_date').focus();
		return
	}
		if (str5=="" )
	{
		alert("¿øÇÏ½Ã´Â Áö¿ªÀ» ÀÔ·ÂÇÏ¼¼¿ä.");
		document.getElementById('zone').focus();
		return
	}
	RequestData("GET" , "/pappa/franchise/online_popup.asp?mode=ok&name="+str+"&tel1="+str1+"&tel2="+str2+"&tel3="+str3+"&exp_date="+str4+"&zone="+str5, true , 'modal' , "inner");
}


function zipcodesch(){

	str1=document.getElementById('zipword').value;
	if(str1==""){
		alert("µ¿ÀÌ¸§À» ÀÔ·ÂÇÏ¼¼¿ä.");
		document.getElementById('zipword').focus();
		return;
	}
	RequestData("GET" , "/pappa/membership/innerLayer.asp?mode=zip&str1="+str1, true , 'modal' , "inner");
}
function modal_open()
{ 
  jQuery.noConflict();
  jQuery('#modal').modal();
} 

function setClipBoard(x)
{
 window.clipboardData.setData('Text', x);
 alert('ÀÌ¹ÌÁö ÁÖ¼Ò°¡ Å¬¸³º¸µå·Î º¹»ç µÇ¾ú½À´Ï´Ù. ¸Þ½ÅÁ®,ºí·Î±×,¹Ì´ÏÈ¨ÇÇ µî¿¡ \nCtrl + V·Î ºÙ¿©³Ö±â ÇÏ¼¼¿ä.');
}
 
function copyURL(obj) {
	var copyURL =eval("document.getElementById('copyURL_"+obj+"')").value ;
	window.clipboardData.setData("Text",copyURL);
	alert("º¹»ç°¡ ¿Ï·áµÇ¾ú½À´Ï´Ù.\n»ç¿ëÇÏ½Ç ÁÖ¼ÒÃ¢ÀÌ³ª »çÀÌÆ®¿¡ ºÙ¿©³Ö±â(Ctrl+V)ÇÏ¼¼¿ä.");
	 
}

function copyHTML(obj) {
	
	var copyHtml =eval("document.getElementById('copyHtml_"+obj+"')").value ;
	
	window.clipboardData.setData("Text", copyHtml);
	alert("º¹»ç°¡ ¿Ï·áµÇ¾ú½À´Ï´Ù.\n»ç¿ëÇÏ½Ç ÁÖ¼ÒÃ¢ÀÌ³ª »çÀÌÆ®¿¡ ºÙ¿©³Ö±â(Ctrl+V)ÇÏ¼¼¿ä.");
	 
}
function LayerView( idx , type , vitem ){
	alert(type);
	divopen(vitem);
	RequestData("GET" , "/pappa/membership/innerLayer.asp?idx="+ idx +"&type="+ type +"&vitem="+ vitem, true , vitem , "inner");
 
}
 



function popupsize(width,height)
{
  var divEl = document.createElement("div");
  divEl.style.position = "absolute";
  divEl.style.left = "0px";
  divEl.style.top = "0px";
  divEl.style.width = "100%";
  divEl.style.height = "100%";
  document.body.appendChild(divEl);
  window.resizeBy(width-divEl.offsetWidth, height-divEl.offsetHeight);
  document.body.removeChild(divEl);
}
function openWindow(url,target,w,h,top,left,resize,scroll){
	opt="width="+w+",height="+h+",top="+top+",left="+left+",resizable="+resize+",scrollbars="+scroll;
	window.open(url,target,opt);
}
function openwindow(url){
	window.open(url,'','scrollbars=no,width=670,height=520');
}
function top_search(){
	var frm= document.top_search;
	if(frm.top_search.value==""){
		alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
		frm.top_search.focus();
		return;
	}else{
		frm.action="/sc/other/search_result.php";
		frm.submit();
	}

}
function close1(){

 
self.opener= self;

window.close();

}

function top_search1(){
	var frm= document.top_search;
	if(frm.top_search.value==""){
		alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
		frm.top_search.focus();
		return false;
	}
}
function resizeimg(target_img)
{
	var newX, newY;
	var newHeight, newWidth;
	var newImg;

	var maxWidth = 600;
	var maxHeight = 500;

	newImg = new Image();
	newImg.src = target_img.src;
	imgw = newImg.width;
	imgh = newImg.height;

	if (imgw*1.2 >= imgh) {
		//return false;
	}

	if (imgw > maxWidth || imgh > maxHeight) {
		if(imgw > imgh) {
			if(imgw > maxWidth)
				newWidth = maxWidth;
			else
				newWidth = imgw;
			newHeight = Math.round((imgh*newWidth)/imgw);
		} else {
			if(imgh > maxHeight)
				newHeight = maxHeight;
			else
				newHeight = imgh;
			newWidth = Math.round((imgw*newHeight)/imgh);
		}
	} else {
		newWidth = imgw;
		newHeight = imgh;
	}

	newX = maxWidth/2 - newWidth/2;
	newY = maxHeight/2 - newHeight/2;

	target_img.onload = null;
	target_img.src = newImg.src;
	target_img.width = newWidth;
	target_img.height = newHeight;
}


 
function goUrl(str){	
	
	parent.document.location.href=str;
//	self.close();
}

function changeUrl(selBox){
  var optionValue = selBox.options[selBox.selectedIndex].value;
  location.href = optionValue;
 } 
 

function resizeimg()
 {
  var target = document.getElementsByName('board_img');
  var image_width = parseInt('600')
  var image_height = 0;

  for (i = 0;i < target.length; i++)
  {
   target[i].tmp_width = target[i].width;
   target[i].tmp_height = target[i].height;

   if (target[i].width > image_width)
   {
    image_height = parseFloat(target[i].width / target[i].height)
    target[i].width = image_width;
    target[i].height = parseInt(image_width / image_height);
   }
  }

}

function initToggle(tabContainer) {
	triggers = tabContainer.getElementsByTagName("a");

	for(i = 0; i < triggers.length; i++) {
		if (triggers.item(i).href.split("#")[1])
			triggers.item(i).targetEl = document.getElementById(triggers.item(i).href.split("#")[1]);

		if (!triggers.item(i).targetEl)
			continue;

		triggers.item(i).targetEl.style.display = "none";
		triggers.item(i).onclick = function () {
			if (tabContainer.current == this) {
				this.targetEl.style.display = "none";
				this.className = "";
				tabContainer.current = null;
			} else {
				if (tabContainer.current) {
					tabContainer.current.targetEl.style.display = "none";
					tabContainer.current.className = "";
				}
				this.targetEl.style.display = "block";
				this.className = "selected";
				tabContainer.current = this;
			}
			return false;
		}
	}
}

// ·¹ÀÌ¾î
function divopenclose(item,item1) { 
	obj=document.getElementById(item);
	obj.style.display="block";
	obj1=document.getElementById(item1);
	obj1.style.display="none";
}
 
function divopen(item) { 
	obj=document.getElementById(item);
	obj.style.display="";
}
function divclose(item) { 
	obj=document.getElementById(item);
	obj.style.display="none";
}
function divtoggle(item){
	
	obj=document.getElementById(item);
	 
	if (obj.style.display == "") {
		obj.style.display = "none"

	}else {
		obj.style.display = ""	 
	}
	 
}
function activationActiveX(obj){ 
  document.write(obj); 
} 
	
 /* ¸®½ºÆ®¸¦ Å¬¸¯ÇßÀ» ¶§ ½ÇÇàµÈ´Ù */
function popup_modal(url, W, H, scroll) {

	    	
 	var arrVal = new Array();
 	var feature = "dialogWidth:"+W+"px; dialogHeight:"+H+"px; center:yes; resizable:no; help:no; scroll:"+scroll+"; status:no";
 	window.showModalDialog(url, arrVal, feature);
}

 
function WinPopup(mypage,myname, w, h,scroll) { //v2.0
//	alert("·Î±×ÀÎ");
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;

	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable=0,status=0,scrollbars='+scroll+'';
	popWin = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { popWin.window.focus(); }
}
function WinPopup_main(mypage,myname, w, h,wint,winl,scroll) { //v2.0
//	alert("·Î±×ÀÎ");
	//var winl = (screen.width - w) / 2;
	//var wint = (screen.height - h) / 2;

	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable=0,status=0,scrollbars='+scroll+'';
	popWin = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { popWin.window.focus(); }
}

function goMenu(str){
	var frm = document.theMenu;
	frm.UCode.value=str;
	frm.submit();
}

 
var cur0bj;
  
  function toggleMultimedia() {
  	if (textFade.filters(0).status == 2) {
  		  textFade.filters(0).stop();
  	if (textFade.style.visibility == "hidden")
  			textFade.style.visibility = "visivle";
  			else
  					textFade.style.visibility = "hidden";
  					window.setTimeout("toggleMultimedia()", 1); }
  					textFade.filters(0).Apply();
  	if (textFade.style.visibility == "hidden")
  			textFade.style.visibility = "visible";
  			else
  					textFade.style.visibility = "hidden";
  		  		textFade.filters(0).Play(); }

 
 
function toggleMenu(currMenu) {
	
	if (document.getElementById) {
		thisMenu = eval("getObject('" + currMenu + "').style")
		if (thisMenu.display == "") {
			thisMenu.display = "none"

		}
		else {
			thisMenu.display = ""
			document.theForm.strPwd.focus();
		}
		return false;
	}
	else {
		return true;
	}
	
}
function getStyleObject(objectId) {
  // checkW3C DOM, then MSIE 4, then NN 4.
  //
  if(document.getElementById && document.getElementById(objectId)) {
	return document.getElementById(objectId).style;
   }
   else if (document.all && document.all(objectId)) {  
	return document.all(objectId).style;
   } 
   else if (document.layers && document.layers[objectId]) { 
	return document.layers[objectId];
   } else {
	return false;
   }
}

function getObject(objectId) {
  // checkW3C DOM, then MSIE 4, then NN 4.
  //
  if(document.getElementById && document.getElementById(objectId)) {
	return document.getElementById(objectId);
   }
   else if (document.all && document.all(objectId)) {  
	return document.all(objectId);
   } 
   else if (document.layers && document.layers[objectId]) { 
	return document.layers[objectId];
   } else {
	return false;
   }
}

function changeObjectVisibility(objectId, newVisibility) {
    // first get a reference to the cross-browser style object 
    // and make sure the object exists
    var styleObject = getStyleObject(objectId);
    if(styleObject) {
	styleObject.visibility = newVisibility;
	return true;
    } else {
	// we couldn't find the object, so we can't change its visibility
		return false;
    }
}

 function down(str,str1){
	 var frm = document.theDown;
		frm.strFile.value=str;
		frm.strFileName.value=str1;
		frm.target="hframe";
		frm.submit();
 }
 

 
function doCheckAll(all,chkname) {
    var obj = document.getElementsByName(chkname);
    var val = true;
    if( all.checked == false ) {        // °ªÀÌ Ã¼Å©°¡ ¾ÈµÇ¾îÁ®ÀÖÀ¸¸é
        val = false;                            // ÀüÃ¼¼±ÅÃÀ» ÇØÁ¦ ÇÏ°Ô..
    }
    for (var i =0 ; i < obj.length ; i++ ) {
        obj[i].checked = val;
    }
}

function delcomma(fvalue) {
	var str = fvalue;
  str=str.replace(/,/g,'');
	str=parseInt(str);
	return str;
}

function delfieldcomma(field) {
  //var str = eval("document.forms[0].test.value");
	var str = field.value;
  str=str.replace(/,/g,'');
	field.value=str;
  //document.forms[0].test.value = str;
}

function setComma(str){
 var returnVal = String(str);
 while(returnVal.match(/^(-?\d+)(\d{3})/)){
  returnVal = returnVal.replace(/^(-?\d+)(\d{3})/,'$1,$2');
 }
 return returnVal;
}
function setComma2(obj){
	var  s = parseFloat(obj.value.replace(/\,/g,""));
	var ns = s.toString();
	var dp;
	if(isNaN(ns)) return "";
	dp = ns.search(/\./);
	if(dp<0) dp = ns.length;
	dp-=3;
	while(dp>0){
		ns = ns.substr(0,dp)+","+ns.substr(dp);
		dp-=3;
	}
	obj.value = ns;
	return true;
}

function onlyNum(objtext1) { //¼ýÀÚ¸¸À» ±âÀÔ¹Þ°Ô ÇÏ´Â ¹æ¹ý
	var inText= objtext1.value;
	var ret;
	for(var i=0; i<inText.length;i++){
	ret=inText.charCodeAt(i);
		if((ret<48)||(ret>57)){
			alert("¼ýÀÚ·Î ÀÔ·ÂÇÏ½Ê½Ã¿À");
			objtext1.value="";
			objtext1.focus();
			return false;
		}
	}
	return true;
}
/*============================================================================
 * ÀÔ·Â¹Ú½º ÀÚ¸®¼ö°¡ Â÷¸é ´ÙÀ½ ÀÔ·Â¹Ú½º·Î Æ÷Ä¿½º ÀÌµ¿, (value°ªÀÌ ¼±ÅÃµÇ¾îÁü)
 Function : nextFocus(arg1, arg2)
 Input    : arg1   : this
  Return   : arg2   : ÀÚ¸´¼ö
  examples : onKeyUp="nextFocus(this, 3)"
============================================================================*/
function nextFocus (thisObj, max) {
 var frm = thisObj.form;
 var i;
 var obj;
 
 // ÀÎÀÚ°¡ ¾øÀ¸¸é »çÀÌÁî¸¦ max·Î ÇÑ´Ù.
 if(!max) max = thisObj.maxlength;
 
 // tabÅ°¸é ¹ÝÀÀ¾øÀ½
 if(window.event.keyCode == 9) {
     return;
 }
 
 if(thisObj.value.length == max){
     for(i=0; i<frm.elements.length; i++){
         if(thisObj == frm.elements[i]) {
             break;
         }
     }
     
     obj = frm.elements[i+1];
     
     if(obj != undefined && (obj.type=="text" || obj.type=="radio" || obj.type=="select-won") && obj.readmode != undefined){
      //frm.elements[i+1].select();
         frm.elements[i+1].focus();
     }
    }
} 
function onlytxt(objtext1) { 
	var intxt=objtext1.value;
	var ret;
	for(var i=0; i<intxt.length;i++){
		ret=intxt.charCodeAt(i);
		if(ret<48 || (ret>57 && ret<97 && ret!=95) || ret>122){
			if(ret==45 || ret==46){
			}else{
			alert("¿µ¹® ¼Ò¹®ÀÚ a~z, ¼ýÀÚ 0~9, Æ¯¼ö¹®ÀÚ _,-,. ¸¸À» »ç¿ëÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.");
			objtext1.value="";
			objtext1.focus();
			return false;
			}
		}
	}
	return true; 
} 
function onlytel(objtext1) { 
	var intxt=objtext1.value;
	var ret;
	for(var i=0; i<intxt.length;i++){
		ret=intxt.charCodeAt(i);
		if((ret<48 && ret!=45) || ret>57){
			alert("¼ýÀÚ 0~9, Æ¯¼ö¹®ÀÚ - ¸¸À» »ç¿ëÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.");
			objtext1.value="";
			objtext1.focus();
			return false;
		}
	}
	return true; 
} 
function chktel(objtext1) { 
	var intxt=objtext1;
	var ret;
	var chki=0;
	for(var i=0; i<intxt.length;i++){
		ret=intxt.charCodeAt(i);
		if(ret==45){
			chki++;
		}
	}
	return chki; 
} 
function isID(id){
 var re=/^[a-z0-9_]+$/i;
 return re.test(id);
}
function isemail(email) {
	var re = /^(\w|[^_]\.[^_]|[\-])+(([^_])(\@){1}([^_]))(([a-z]|[\d]|[_]|[\-])+|([^_]\.[^_])*)+\.[a-z]{2,3}$/i
	return re.test(email);
}
 
					// ÁÖ¹Îµî·Ï¹øÈ£ Ã¼Å©
function juminCheck(num1,num2) {

	var j1=num1;
	var j2=num2;
	if(j1.length != 6) {
		return false;
	}
	// ÁÖ¹Îµî·Ï¹øÈ£ ¾Õ  ºÎºÐ¿¡¼­ »ý³â¿ùÀÏÀ» ¾Ë¾Æ³¿
	var year = j1.substring(0,2);
	var month = j1.substring(2,4);
	var day = j1.substring(4,6);
	// ÁÖ¹Îµî·Ï¹øÈ£ µÞ  ºÎºÐ¿¡¼­ ³²³à ¼ºº°  Á¤º¸ Ã£¾Æ³¿
	var sex = j2.substring(0,1);

	if(sex != 5 && sex != 6) {
	
		// ÁÖ¹Îµî·Ï¹øÈ£ ¾Õ  ºÎºÐ Ã¼Å©ÇÏ±â
		if ((month<1 || month>12 ||day<1) ) {
			return false;
		}
		
		// ÁÖºóµî·Ï¹øÈ£ µÞ  ºÎºÐ Ã¼Å©ÇÏ±â
		if ( (sex != 1 && sex != 2 && sex != 3 && sex != 4) || (j2.length != 7 ) ) {
			return false;
		}
		// ÁÖ¹Îµî·Ï¹øÈ£ ¾Ë°í¸®Áò  Ã¼Å©
		var val = 0;
		for (var i = 0; i <=5;  i++) {
			val = val + ((i%8+2) * parseInt(j1.substring(i,i+1)));
		}
		
		for (var i = 6; i <=11;  i++) {
			val = val + ((i%8+2) * parseInt(j2.substring(i-6,i-5)));
		}
		
		val = 11 - (val %11);
		val = val % 10;
		
		if (val != j2.substring(6,7)) {
			return false;
		}
		return true;
	} else {
		var reg_no = j1 + j2;
		if(fgn_no_chksum(reg_no)) {
			return true;
		} else {
			return false;
		}
	}
}


// ¿Ü±¹ÀÎµî·Ï¹øÈ£ Ã¼Å©
function fgn_no_chksum(reg_no) {
    var sum = 0;
    var odd = 0;
    
    buf = new Array(13);
    for (i = 0; i < 13; i++) buf[i] = parseInt(reg_no.charAt(i));

    odd = buf[7]*10 + buf[8];
    
    if (odd%2 != 0) {
      return false;
    }

    if ((buf[11] != 6)&&(buf[11] != 7)&&(buf[11] != 8)&&(buf[11] != 9)) {
      return false;
    }
     
    multipliers = [2,3,4,5,6,7,8,9,2,3,4,5];
    for (i = 0, sum = 0; i < 12; i++) sum += (buf[i] *= multipliers[i]);


    sum=11-(sum%11);
    
    if (sum>=10) sum-=10;

    sum += 2;

    if (sum>=10) sum-=10;

    if ( sum != buf[12]) {
        return false;
    }
    else {
        return true;
    }
}

// innerHTML Type
function setInnerHTML(target, code)
{ 
	document.getElementById(target).innerHTML=code; 
	 
}		
var xmlHttp;

function createXMLHttpRequest() {
	if (window.ActiveXObject) {
		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	}else if (window.XMLHttpRequest) {
		xmlHttp = new XMLHttpRequest();
	}
}


/*
##########################################################################
##########################################################################
@@ funtion name : RequestData
@@ parameter
	method		: Àü¼Û ¹æ¹ý(post , get)
	url				: Àü¼Û URL
	status		: µ¿±â ºñµ¿±â ¿©ºÎ(true : ºñµ¿±â , false : µ¿±â)
	ele_name	: Ã³¸®ÇÒ element name
	action		: Ã³¸®ÇÒ action(inner : innerHTML , value : element value change
##########################################################################
##########################################################################
*/
function RequestData( method , url , status , ele_name , action ) {
	createXMLHttpRequest();
	if(xmlHttp){
		xmlHttp.onreadystatechange = handleStateChange;
		xmlHttp.open(method, url, status);
		xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;charset=euc-kr'); 
		xmlHttp.onreadystatechange = function(){handleStateChange(xmlHttp , ele_name , action)}
		xmlHttp.send(null);
	}
}
    
function handleStateChange(xmlRequest , ele_name , action) {
	if(xmlHttp == null | xmlHttp.readyState !=4) return;
	if(xmlHttp.responseText.length == 0) return;
	var vals = xmlHttp.responseText;

	if(document.getElementById(ele_name)){
		if(action == "inner"){
			document.getElementById(ele_name).innerHTML = xmlHttp.responseText;
		}else if(action == "value"){
			document.getElementById(ele_name).value = xmlHttp.responseText;
		}else if(action == "alert"){
			alert(xmlHttp.responseText)
		}else if (action == "function"){
			eval( ele_name );
		}
	}
}

//¾ÆÀÌµð Áßº¹Ã¼Å©
function id_check(){
	var u_id = document.theForm.u_id.value;
	if (u_id =="")
	{
		alert("¾ÆÀÌµð¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		document.getElementById("u_id").focus();
		return;
	}else{
	//alert(u_id);
	modal_open();
	RequestData("GET" , "/pappa/membership/innerLayer.asp?mode=id_check&u_id="+u_id, true , 'modal' , "inner");
	}
}
//Áßº¹µÇ´Â ¾ÆÀÌµð ÀÖÀ»¶§
function id_back(){
	document.getElementById("u_id").value = "";
	document.getElementById("u_id").focus();
	jQuery.modal.close();
}
//Áßº¹µÇ´Â ¾ÆÀÌµð ¾øÀ»¶§
function id_in(){
	document.getElementById("id_confirm").value = "1";
	//document.getElementById("u_id").focus();
	jQuery.modal.close();
}
//ÁÖ¼Ò Àû¿ë
function addr_in(post1,post2,addr){
	document.getElementById("postnum1").value=post1;
	document.getElementById("postnum2").value=post2;
	document.getElementById("addr01").value=addr;
	jQuery.modal.close();
}

//È¸¿ø°¡ÀÔ ÀÔ·Â°ªÃ¼Å©
function chk_member(){
	if (document.getElementById("u_id").value=="")
	{
		alert("¾ÆÀÌµð´Â ÇÊ¼ö ÀÔ·Â»çÇ×ÀÔ´Ï´Ù.");
		document.getElementById("u_id").focus();
		return false;
	}
	if (document.getElementById("id_confirm").value=="0")
	{
		alert("¾ÆÀÌµð Áßº¹Ã¼Å©¸¦ ÇØÁÖ¼¼¿ä.");
		document.getElementById("u_id").focus();
		return false;
	}
	if (document.getElementById("u_pass1").value=="")
	{
		alert("ºñ¹Ð¹øÈ£´Â ÇÊ¼ö ÀÔ·Â»çÇ× ÀÔ´Ï´Ù.");
		document.getElementById("u_pass1").focus();
		return false;
	}
	if (document.getElementById("u_pass2").value=="")
	{
		alert("ºñ¹Ð¹øÈ£ È®ÀÎÀº ÇÊ¼ö ÀÔ·Â»çÇ× ÀÔ´Ï´Ù.");
		document.getElementById("u_pass2").focus();
		return false;
	}
	if (document.getElementById("u_pass1").value != document.getElementById("u_pass2").value)
	{
		alert("ºñ¹Ð¹øÈ£°¡ ¼­·Î ´Ù¸¨´Ï´Ù.");
		document.getElementById("u_pass1").value="";
		document.getElementById("u_pass2").value="";
		return false;
	}
	if (document.getElementById("tel1").value=="" || document.getElementById("tel2").value=="" || document.getElementById("tel3").value=="")
	{
		alert("ÀüÈ­¹øÈ£´Â ÇÊ¼ö ÀÔ·Â»çÇ× ÀÔ´Ï´Ù.");
		document.getElementById("tel1").focus();
		return false;
	}
	if (document.getElementById("hp1").value=="" || document.getElementById("hp2").value=="" || document.getElementById("hp3").value=="")
	{
		alert("ÈÞ´ëÆù¹øÈ£´Â ÇÊ¼ö ÀÔ·Â»çÇ× ÀÔ´Ï´Ù.");
		document.getElementById("hp1").focus();
		return false;
	}
	if (document.getElementById("postnum1").value=="" || document.getElementById("postnum2").value=="")
	{
		alert("¿ìÆí¹øÈ£´Â ÇÊ¼ö ÀÔ·Â»çÇ× ÀÔ´Ï´Ù.");
		return false;
	}
	if (document.getElementById("addr01").value=="" || document.getElementById("addr02").value=="")
	{
		alert("ÁÖ¼Ò´Â ÇÊ¼ö ÀÔ·Â»çÇ× ÀÔ´Ï´Ù.");
		document.getElementById("addr02").focus();
		return false;
	}
	if (document.getElementById("email1").value=="")
	{
		alert("ÀÌ¸ÞÀÏÀº ÇÊ¼ö ÀÔ·Â»çÇ× ÀÔ´Ï´Ù.");
		document.getElementById("email1").focus();
		return false;
	}
	if (document.getElementById("email2").value=="")
	{
		alert("ÀÌ¸ÞÀÏÀº ÇÊ¼ö ÀÔ·Â»çÇ× ÀÔ´Ï´Ù.");
		document.getElementById("email2").focus();
		return false;
	}
	else{
		return true;
	}
}


function host_chk()	{
	if (document.theForm.email_host.value!="") {
		document.theForm.email2.value=document.theForm.email_host.value;
		document.theForm.email2.readOnly=true;
		//document.f_regist.password.focus();
	} else {
		document.theForm.email2.value="";
		document.theForm.email2.readOnly=false;
		document.theForm.email2.focus();
	}
}

function search_id(){
	var user_name = document.theForm.user_name.value;
	var jumin1 = document.theForm.jumin1.value;
	var jumin2 = document.theForm.jumin2.value;
	if (user_name =="")
	{
		alert("ÀÌ¸§¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		document.theForm.user_name.focus();
		return;
	}
	else if(jumin1 == "" || jumin2 == ""){
		alert("ÁÖ¹Îµî·Ï ¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		document.theForm.jumin1.focus();
		return;
	}
	else{
	//alert(u_id);
	modal_open();
	RequestData("GET" , "/pappa/membership/innerLayer.asp?mode=search_id&user_name="+user_name+"&jumin1="+jumin1+"&jumin2="+jumin2, true , 'modal' , "inner");
	}
}

function search_pw(){
	var user_id = document.theForm2.user_id.value;
	var user_name = document.theForm2.user_name.value;
	var jumin1 = document.theForm2.jumin1.value;
	var jumin2 = document.theForm2.jumin2.value;
	if (user_id =="")
	{
		alert("¾ÆÀÌµð¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		document.theForm2.user_id.focus();
		return;
	}
	else if (user_name =="")
	{
		alert("ÀÌ¸§¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		document.theForm2.user_name.focus();
		return;
	}
	else if(jumin1 == "" || jumin2 == ""){
		alert("ÁÖ¹Îµî·Ï ¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		document.theForm2.jumin1.focus();
		return;
	}
	else{
	//alert(u_id);
	modal_open();
	RequestData("GET" , "/pappa/membership/innerLayer.asp?mode=search_pw&user_id="+user_id+"&user_name="+user_name+"&jumin1="+jumin1+"&jumin2="+jumin2, true , 'modal' , "inner");
	}
}

function search_out(){
	var frm = document.theForm;
	var comment = frm.out_comment.value;
	if (frm.out_comment.value =="")
	{
		alert("Å»Åð»çÀ¯¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		frm.out_comment.focus();
		return;
	}
	else{
		modal_open();
		RequestData("GET" , "/pappa/membership/innerLayer.asp?mode=out&out_comment="+comment, true , 'modal' , "inner");
	}
}

// ÇÃ·¡½Ã object ÄÚµå Ãâ·Â ÇÔ¼ö  Á¶¼º¿ì Ãß°¡
function flash(flashid, flashfilename, flashwidth, flashheight, flashvars) {
	document.write('<object id="' + flashid + '" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+ flashwidth +'" height="'+ flashheight +'">');
	document.write('<param name="allowScriptAccess" value="always" />');
	document.write('<param name="movie" value="'+ flashfilename +'">');
	if (flashvars) document.write('<param name="flashVars" value="'+ flashvars +'">');
	document.write('<param name="wmode" value="transparent">');
	document.write('<embed name="' + flashid + '"');
	if (flashvars) document.write(' flashVars="'+ flashvars +'" ');
	document.write(' src="'+ flashfilename +'" width="'+ flashwidth +'" height="'+ flashheight +'" ');
	document.write(' allowScriptAccess="always" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" >');
	document.write('</embed>');
	document.write('</object>');
}

