//½ºÅ©·Ñ¾÷´Â »õÃ¢
function newWindowOpen(twidth,theight,url,name) { 
		var temp_width = twidth; // width
		var temp_height= theight; // height
		var temp_left = ( screen.width - temp_width ) / 2;
		var temp_top = ( screen.height - temp_height ) / 2;
		
		window.open(url,name,"resizable=yes, status=yes, scrollbars=no, left="+temp_left+", top="+temp_top+", width="+temp_width+", height="+temp_height);
		return;

    windowName = window.open(url, name, attribute);
    windowName.focus();
}

// ½ºÅ©·ÑÀÖ´Â»õÃ¢
function newWindowOpen2(twidth,theight,url,name) { 
		var temp_width = twidth; // width
		var temp_height= theight; // height
		var temp_left = ( screen.width - temp_width ) / 2;
		var temp_top = ( screen.height - temp_height ) / 2;
		
		window.open(url,name,"resizable=yes, status=yes, scrollbars=yes, left="+temp_left+", top="+temp_top+", width="+temp_width+", height="+temp_height);
		return;

    windowName = window.open(url, name, attribute);
    windowName.focus();
}

function inFocus(i) {
	(i).style.border='1px solid #d55b42';
}

function outFocus(i) {
	(i).style.border='1px solid #cccccc';
}

function showmarry(str) {
	if(str == 'on') {
	    document.getElementById("marrydate").style.display = "block";
	} else {
	    document.getElementById("marrydate").style.display = "none";
	}
}

function direct_email(no) {
		if(no=="3") {
    document.getElementById("email3").style.display = "block";
    document.getElementById("email2").style.display = "none";
		} else {
    document.getElementById("email2").style.display = "block";
    document.getElementById("email3").style.display = "none";
		}
}

//¾ÆÀÌµðÃ¼Å©
function uniquecheck(width,height) {
	var user_id = document.user.id.value;
	if(!user_id) { alert('¾ÆÀÌµð¸¦ Àû¾îÁÖ¼¼¿ä.'); return; }
	newWindowOpen(width,height,"./popup_idcheck.php?user_id="+user_id,'check')
}

//ÁÖ¼ÒÃ£±â
function zipSearch(width,height) {
	newWindowOpen(width,height,'./popup_zipcode.php','zipcode');
}

// ¾ÆÀÌµðÃ£±â
function search_id(width,height) {
	newWindowOpen(width,height,'/join/serach_id.php','search_id');
}

// ÁÖ¼ÒÅ¬¸¯½Ã ºÎ¸ðÃ¢Àü¼Û
function click3(code1,code2,juso1) {
	opener.document.user.zip1.value=code1;
	opener.document.user.zip2.value=code2;
	opener.document.user.addr1.value=juso1;
	opener.document.user.addr2.value='³ª¸ÓÁö ÁÖ¼Ò¸¦ ÀÔ·ÂÇÏ¼¼¿ä';
	window.close();
}

// ÆË¾ÆÀÌµðÃ£±â
function pop_findid(width,height,type) {
	var obj = document.find;
	
	if(type == 'pw') {

		if(!obj.id.value) { alert('¾ÆÀÌµð¸¦ Àû¾îÁÖ¼¼¿ä.'); obj.id.focus(); return; }
		if(!obj.name2.value) { alert('ÀÌ¸§À» Àû¾îÁÖ¼¼¿ä.'); obj.name2.focus(); return; }
		if(!obj.social3.value) { alert('ÁÖ¹Î¹øÈ£ ¾ÕÀÚ¸®¸¦ Àû¾îÁÖ¼¼¿ä.'); obj.social3.focus();return; }
		if(!obj.social4.value) { alert('ÁÖ¹Î¹øÈ£ µÞÀÚ¸®¸¦ Àû¾îÁÖ¼¼¿ä.'); obj.social4.focus(); return; }

		var user_name = obj.name2.value;
		var social1 = obj.social3.value;
		var social2 = obj.social4.value;
		var id = obj.id.value;

	newWindowOpen(width,height,"./popup_idpwfind.php?type="+type+"&name="+user_name+"&social1="+social1+"&social2="+social2+"&id="+id,'findid');

	} else {

		if(!obj.name1.value) { alert('ÀÌ¸§À» Àû¾îÁÖ¼¼¿ä.'); obj.name1.focus(); return; }
		if(!obj.social1.value) { alert('ÁÖ¹Î¹øÈ£ ¾ÕÀÚ¸®¸¦ Àû¾îÁÖ¼¼¿ä.'); obj.social1.focus();return; }
		if(!obj.social2.value) { alert('ÁÖ¹Î¹øÈ£ µÞÀÚ¸®¸¦ Àû¾îÁÖ¼¼¿ä.'); obj.social2.focus(); return; }

		var user_name = obj.name1.value;
		var social1 = obj.social1.value;
		var social2 = obj.social2.value;

	newWindowOpen(width,height,"./popup_idpwfind.php?type="+type+"&name="+user_name+"&social1="+social1+"&social2="+social2,'findid');

	}
}


// flashWrite(ÆÄÀÏ°æ·Î, °¡·Î, ¼¼·Î, ¾ÆÀÌµð, ¹è°æ»ö, º¯¼ö, À©µµ¿ì¸ðµå)
function flashWrite(url,w,h,id,bg,vars,win){

	// ÇÃ·¡½Ã ÄÚµå Á¤ÀÇ
	var flashStr=
	"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' id='"+id+"' align='middle'>"+
	"<param name='allowScriptAccess' value='always' />"+
	"<param name='movie' value='"+url+"' />"+
	"<param name='FlashVars' value='"+vars+"' />"+
	"<param name='wmode' value='"+win+"' />"+
	"<param name='menu' value='false' />"+
	"<param name='quality' value='high' />"+
	"<param name='bgcolor' value='"+bg+"' />"+
	"<embed src='"+url+"' FlashVars='"+vars+"' wmode='"+win+"' menu='false' quality='high' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' name='"+id+"' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
	"</object>";

	// ÇÃ·¡½Ã ÄÚµå Ãâ·Â
	document.write(flashStr);

}

function sms_send(str,phone) {
	if(str == 'no') {
		document.getElementById('sms').style.display= "block";
	}
	
	else if(str == 'nosms') {
		newWindowOpen(300,300,'sms.html?mode='+str,'nosms');
	}

	else if(str == 'smsok') {
		newWindowOpen(188,384,'/admin/manage/sms.html?mode='+str+'&phone='+phone,'smsok');
	}
}

function nextandcopy() {
	var obj = this.document.user;
	if(obj.social1.value.length >= 6) {
		obj.social2.focus();

		var str = obj.social1.value; 
		aa=str.substr(0,2); 
		bb=str.substr(2,2);
		cc=str.substr(4,2);
		
		if(aa < 20) obj.birth1.value = "20"+aa;
			else obj.birth1.value = "19"+aa;

		obj.birth2.value = bb;
		obj.birth3.value = cc;
	}
}

function pop_email(p_email){
	newWindowOpen(590,460,"/admin/manage/admin_pop_mail_insert.html?pop_email="+p_email, "p_email");
}

function ready(msg) {
	window.alert(msg);
}

// ÆÄÀÏÃ£±â
function js_input_file_skin(ta_file,ta_textbox,ta_button, input_width ,btn_width, btn_height){ 
 if(!ta_file||!ta_textbox||!ta_button){return false;} 
 var span = document.createElement('span'); 
 if (ta_file.nextSibling){ ta_file.parentNode.insertBefore(span,ta_file.nextSibling);} 
 else{ ta_file.parentNode.appendChild(span);} 

 ta_textbox.size = ta_file.size ; 
 ta_textbox.value = ta_file.value; 
  
 span.appendChild(ta_file); 
 span.appendChild(ta_textbox); 
 span.appendChild(ta_button); 
  
 ta_file.style.verticalAlign='middle' 
 ta_textbox.style.verticalAlign='middle' 
 ta_button.style.verticalAlign='middle'  

 ta_button.style.width = btn_width+'px'; 
 ta_button.style.height = btn_height+'px'; 
 ta_button.style.position = 'absolute'; 
 ta_button.style.left = input_width+'px'; 
 ta_button.style.top = '0px'; 

 ta_textbox.style.width = input_width+'px'; 
 ta_textbox.style.position = 'relative'; 
 ta_textbox.style.zIndex = '10';

 span.style.position = 'relative'; 
 span.style.top='0px'; 
 span.style.left='0px'; 
   
 ta_textbox.size=ta_file.size; 

with(ta_file.style){ 
  width = parseInt(ta_textbox.style.width)+40+'px'; 
  position = 'absolute'; 
  top='0px';
  cursor='pointer';
  left='50px'; 
  zIndex='99'; 
  if(document.all){ 
  filter="Alpha(opacity=0)"; 
  }else{ 
  opacity='0'; 
	} 
 }

 ta_textbox.onclick=function(){this.blur();} 
 ta_textbox.onkeydown=function(){this.blur();} 
 ta_file.onkeydown=function(){this.blur();} 
}

	function noread() {
		alert("ºñ¹Ð±ÛÀÔ´Ï´Ù.");
	}


function newXMLHttpRequest() {
	  var xmlreq = false; 
	  if (window.XMLHttpRequest) { 
	xmlreq = new XMLHttpRequest(); 
  } else if (window.ActiveXObject) {  
	try { 
	  xmlreq = new ActiveXObject("Msxml2.XMLHTTP"); 
	} catch (e1) { 
	  try { 
		xmlreq = new ActiveXObject("Microsoft.XMLHTTP"); 
	  } catch (e2) { 
		  } 
	} 
  } 
  return xmlreq; 
}

function Select_act(val)	 {
	   	req = newXMLHttpRequest();
		req.onreadystatechange = rv_changemaker_processReqChange;
		req.open("GET", "/chage_select.html?name="+val, true);
		req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");  
		req.send();	    	
	}

function sms_setting(name,val)	 {
	   	req = newXMLHttpRequest();
//		req.onreadystatechange = rv_changemaker_processReqChange;
		req.open("GET", "/admin/manage/sms_setting.html?name="+name+"&value="+val, true);
		req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");  
		req.send();	    	
}

function rv_changemaker_processReqChange() { 
	if(req.readyState == 4 && req.status == 200) {
		document.getElementById("detail").innerHTML = req.responseText;
	}
}

function chk2() {
		var obj = this.document.login2;
		if(!obj.id.value) { alert('¾ÆÀÌµð¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä'); obj.id.focus();  return(false);}
		if(!obj.social1.value) { alert('ÁÖ¹Î¹øÈ£ ¾ÕÀÚ¸®¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä'); obj.social1.focus(); return(false);}
		if(!obj.social2.value) { alert('ÁÖ¹Î¹øÈ£ µÞÀÚ¸®¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä'); obj.social2.focus(); return(false);}
}

function chkinput() {
	var obj = this.document.login;
	if(!obj.name.value) { alert('ÀÌ¸§À» ÀÔ·ÂÇØÁÖ¼¼¿ä'); obj.name.focus();  return(false);}
	if(!obj.social1.value) { alert('ÁÖ¹Î¹øÈ£ ¾ÕÀÚ¸®¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä'); obj.social1.focus(); return(false);}
	if(!obj.social2.value) { alert('ÁÖ¹Î¹øÈ£ µÞÀÚ¸®¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä'); obj.social2.focus(); return(false);}
}

//¼ýÀÚ¸¸ ÀÔ·Â
function onlyNumber(){
if((event.keyCode<48)||(event.keyCode>57))
event.returnValue=false;
}

//·Ñ¿À¹öÀÌ¹ÌÁö ½ºÅ©¸³Æ®
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

// ¸¶¿ì½º ¿À¸¥ÂÊ, Å°º¸µåÅ°, µå·¹±× ¹æÁö
// --> <body> ¼Ó¼º¿¡ oncontextmenu='return false' ondragstart='return false' onselectstart='return false' Ãß°¡.
if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
}
function rtclickcheck(keyp){
  if (document.layers && keyp.which != 1) {
    return false;
  }
  if (document.all && event.button != 1) { 
    return false;
  }
}
document.onmousedown = rtclickcheck

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
	  if ((obj=MM_findObj(args[i]))!=null) {
		v=args[i+2];
	  if (obj.style) {
		obj=obj.style; 
		v=(v=='show')?'visible':(v='hide')?'hidden':v; 
	  }
    obj.visibility=v; 
  }
}

// select
function MM_findObj(n, d) { //v4.0
  var p,i,x;  
  if(!d) d=document; 
  if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
  }
  if(!(x=d[n])&&d.all) x=d.all[n]; 
  for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); 
  return x;
}

function ShowMenu(){
	//Render image code for IE 4+
	if (document.all){
		document.all.menu.style.visibility = "visible";
	}
	else if (document.layers){
		document.namWin.visibility="show"
 	}
}

function HideMenu(){
	//Render image code for IE 4+
	if (document.all){
		document.all.menu.style.visibility = "hidden";
	}
	else if (document.layers){
		document.namWin.visibility="hide"
 	}
}

function na_change_location(url){
  location=url;
}

function na_init_layer_events(){
  if (document.layers) {
    document.layers['menu'].captureEvents(Event.MOUSEOVER|Event.MOUSEOUT|Event.MOUSEUP);
    document.layers['menu'].onmouseout = new Function("HideMenu()");
    document.layers['menu'].onmouseover = new Function("ShowMenu()");
    document.layers['menu'].onmouseup = new Function("na_change_location('http://www.e-phuket.co.kr/');");
  }
}

function events(str) {

if(str=='on') {
	document.getElementById('Events').style.display='block';
	document.getElementById('News').style.display='none';
} else {
	document.getElementById('Events').style.display='none';
	document.getElementById('News').style.display='block';
}



}
