

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];}
}


/* ÀÌ¸ÞÀÏ ¹Ì¸®º¸±â */
function email_view(em,pc,pv,pd){
	
	window.open("/admin/email_view.php?emailID="+em+"&pcode="+pc+"&pvalue="+pv+"&pdate="+pd,"emailview","width=10,height=10,resizable=yes" );
	
}


/* ¼ýÀÚ¸¸ */
function onlyNumber()
{
	
	e=window.event;
 
	   if (e.keyCode>=48 && e.keyCode<=57  || (e.keyCode==45 || e.keyCode==109 || e.keyCode==189) ) { 
		  
	   }else{
		 e.returnValue = false;  
	   }
  
}


/* ajax È­¸éº¸ÀÌ±â */

 function getHttprequest(URL) {
  var xmlhttp = null;
  if(window.XMLHttpRequest) {
   xmlhttp = new XMLHttpRequest();
  } else {
   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  }
  xmlhttp.open('GET', URL,false);
  xmlhttp.onreadystatechange = function() {
   if(xmlhttp.readyState==4 && xmlhttp.status == 200 && xmlhttp.statusText=='OK') {
    responseText = xmlhttp.responseText;
   }
  }
  xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
  xmlhttp.send('');
  return responseText = xmlhttp.responseText;
 }

/* ajax È­¸éº¸ÀÌ±â */




/* help */
 function msgposit_list(evt){

  if(navigator.appName == "Netscape"){
   helpbox.style.left = evt.pageX + 10;
   helpbox.style.top  = evt.pageY + 20;
  } else {
	  //alert( document.body.offsetWidth+"/"+(event.clientX+100)  );
	  if(document.body.offsetWidth > (event.clientX+100) ){
		helpbox.style.posLeft = event.clientX + 20 ;
		helpbox.style.posTop  = event.clientY + 15 ;
		//alert('a');
	  }else{
		helpbox.style.posLeft = event.clientX - 150 ;
		helpbox.style.posTop  = event.clientY + 10 ;
		//alert('b');
	  }
   
  }

 }

 function msgset_list(str){
  var text;
  text ='<table align="center" border="0" cellpadding="10" cellspacing="0" style="border-width:3; border-color:#cccccc; border-style:solid;font-size:9pt;">';
  text += '<tr><td align=center>'+str+'</td></tr></table>';
  helpbox.innerHTML=text;
 }

 function msghide_list(){helpbox.innerHTML='';}

 if(navigator.appName == "Netscape"){
  document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE | Event.MOUSEUP);
  document.onmousemove = msgposit_list;
 }



/* cancel */
function cancel(){
	history.back();
}


/* °ü¸®ÀÚ ·Î±×ÀÎ */
function sendit(form){

	var mid = form.mid.value; 
	var mpass = form.mpass.value; 

	if(form.mid.value == false)
	{
		alert ("¾ÆÀÌµð¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		form.mid.focus();
		return;
	}
	if(form.mpass.value == false)
	{
		alert ("ºñ¹øÀ» ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		form.mpass.focus();
		return;
	}

	form.submit();
}

/* °ü¸®ÀÚ ·Î±×¾Æ¿ô  */
function admin_logout(){
	if(confirm("·Î±×¾Æ¿ôÀ» ÇÏ½Ã°Ú½À´Ï±î?")){
	location.href="./adminlogin.php?mode=logout";
	}
}	


/* email check */
function isEmail(str) { 
    if (!str.length) { return false; } 
    var MailChk = new RegExp("^([0-9a-zA-Z]|_|-)+@([0-9a-zA-Z]|_|-)+(\\.com|\\.net|\\.org|\\.biz|\\.info|\\.co\\.kr|\\.or\\.kr|\\.pe\\.kr|\\.ne\\.kr|\\.kr|\\.cc|\\.jp|\\.tv|\\.cn)$"); 
    return MailChk.test(str); 
} 

/* ¹öÆ° none */
function checks_button(object){
	//object.style.display = "none";
	object.innerHTML = " Á¶±Ý¸¸ ±â´Ù·Á ÁÖ¼¼¿ä ";
} 










/* **** È®ÀåÀÚ Ã¼Å© ***** */
function chk_img(img_path){
	var f = document.theForm;
	var file = img_path;
	var xfile = file.substring(file.lastIndexOf(".")+1);

	if((xfile.toLowerCase()=="exe") || (xfile.toLowerCase()=="html") ||(xfile.toLowerCase()=="php") ||(xfile.toLowerCase()=="jsp") ||(xfile.toLowerCase()=="dll") ){
		alert(xfile.toLowerCase()+"ÆÄÀÏ ¾÷·Îµµ ÇÒ¼ö ¾ø½À´Ï´Ù.");
		return false;	
	}else{
		return true;
	}
}


/* **** È®ÀåÀÚ Ã¼Å© ***** */




/* È¸¿ø ·Î±×ÀÎ  */
function visit_login(){
			
	 var f = document.cnjform;
	 
	if(f.emailID.value == false)
	{
		alert ("Please enter ID ");
		f.mid.focus();
		return ;
	}
	if(f.pwd.value == false)
	{
		alert ("Please enter password  ");
		f.mpass.focus();
		return ;
	}

	f.submit();
	
	
	
}	



/* È¸¿ø ·Î±×¾Æ¿ô  */
function visit_logout(){
	if(confirm("Would you like to logout? ")){
	location.href="./source/visitlogin.php?mode=logout";
	}
}	




/* ÄíÅ° ¼³Á¤ */

function setCookie(name, value, expires) {
  document.cookie = name + "=" + escape (value) +
    "; path=/; expires=" + expires.toGMTString();
}

function getCookie(Name) {
  var search = Name + "="
  if (document.cookie.length > 0) { // ÄíÅ°°¡ ¼³Á¤µÇ¾î ÀÖ´Ù¸é
    offset = document.cookie.indexOf(search)
    if (offset != -1) { 
      offset += search.length
      end = document.cookie.indexOf(";", offset)
  
      if (end == -1)
        end = document.cookie.length
      return unescape(document.cookie.substring(offset, end))
    }
  }
  return "";
}




/* ¾ÆÀÌµð ÀúÀå */

function saveform() {
  var f = document.cnjform;
  var expdate = new Date();
  if (f.save_cnk.checked) {
  //alert('ID¸¦ ÀúÀåÇÒ °æ¿ì ´ÙÀ½Á¢¼Ó½Ã Ã¼Å©°¡ µË´Ï´Ù.');
    expdate.setTime(expdate.getTime() + 1000 * 3600 * 24 * 30); // 30ÀÏ ==> 30ÀÏµ¿¾È º¸Àü
  } else {
    expdate.setTime(expdate.getTime() - 1);
  }  
  setCookie("saveid", f.emailID.value, expdate); //id ÄíÅ°Ã¼Å©
  //setCookie("savepass", f.cnj_pass.value, expdate);  
}

function getform() {
  var f = document.cnjform;
  f.save_cnk.checked = ((f.emailID.value = getCookie("saveid")) != "");
  //f.save_cnk.checked = ((f.cnj_pass.value = getCookie("savepass")) != "");  
}


function mem_edit(){

location.href= "/source/mem_edit.php";

}


function mem_info(){

location.href= "/source/infollist.php";

}

 

//ÁöÇÏÃ¶ Á¤º¸
function metro_map(){
window.open("http://www.smrt.co.kr/Train/Subwaymap/Eng/Subwaymap.jsp","metro","fullscreen=yes,width=10,height=10");
}

//Áöµµ Á¤º¸
function maps_map(){
window.open("http://emap.visitkorea.or.kr/Scripts/EngMap.aspx","metro","width=10,height=10");
}

//³¯¾¾ Á¤º¸
function weather_map(){
window.open("http://english.visitkorea.or.kr/common/kma_weather/weather.jsp?lang_se=ENG","metro","width=500,height=670");
}




//Yes Ã¼Å©
function check_yes(t,g){
	
	if(confirm("Yes check?")){
		
	window.open("check_listrun.php?mode=yes&tno="+t+"&gubun="+g,"check_maybe","width=10,height=10");
	
	}
	
}



//Maybe Ã¼Å©
function check_maybe(t,g){
	
	if(confirm("Maybe check?")){
		
	window.open("check_listrun.php?mode=maybe&tno="+t+"&gubun="+g,"check_maybe","width=10,height=10");
	
	}
	
}

//No Ã¼Å©
function check_no(t,g){
	
	if(confirm("No check?")){
		
	window.open("check_listrun.php?mode=no&tno="+t+"&gubun="+g,"check_maybe","width=10,height=10");
	
	}
	
}

// yes, maybe, no
function trips_checklist(t,g){
	
	//if(confirm("check list?")){
		
	window.open("/source/trips_detail_check.php?tno="+t+"&gubun="+g,"check_maybe","width=10,height=10");
	
	//}
	
}



// ¿©Çàº¸±â 
function trips_review(t){
	
	//if(confirm("check list?")){
		
	window.open("/source/trips_review.php?tno="+t,"trip_review","width=10,height=10,resizable=1,scrollbars=1");
	
	//}
	
}


//facebook register
function facebook_reg(){
	
	window.open("/source/facebook_register.php","facebook_regWin","width=10,height=10,resizable=1 ");
	
}

//facebook register
function facebook_login(){
	
	window.open("https://www.facebook.com/dialog/oauth?client_id=204373576265317&redirect_uri=http://www.winkadventures.com/source/facebook/facebook_login.php&scope=email,read_stream","facebook_login","width=900,height=500,resizable=1 ");
	
}



/* trip content : korea , english */
function trip_contentview(vid){
		
	if(vid=="ko"){//ÇÑ±ÛÅ¬¸¯½Ã
		document.all.trip_contentko.style.display = "block";
		document.all.trip_content.style.display = "none";
		
				
	}else if (vid=="en"){//¿µ¹®Å¬¸¯½Ã
		document.all.trip_contentko.style.display = "none";
		document.all.trip_content.style.display = "block";
		
		
	
	}		 
	 
}  

/* trip ´ñ±Û :  */
function trip_review(vid){
		
	if(vid=="A"){//ÇÑ±ÛÅ¬¸¯½Ã
		document.all.trip_reA.style.display = "block";
		document.all.trip_reB.style.display = "none";
		
				
	}else if (vid=="B"){//¿µ¹®Å¬¸¯½Ã
		document.all.trip_reA.style.display = "block";
		document.all.trip_reB.style.display = "none";
		
		
	
	}		 
	 
}  


/* */
function trip_refund(vid){
		
	if(vid=="Refund"){//refund ½Ã
		document.all.refund_A.style.display = "block";
		document.all.refund_B.style.display = "none";
		
				
	}else if (vid=="Credit"){//point½Ã
		document.all.refund_B.style.display = "block";
		document.all.refund_A.style.display = "none";
		
		
	
	}		 
	 
}  




function setClassName(objId,cName){
	//id °¡ objIdÀÎ °´Ã¼¸¦ Ã£¾Æ¼­
	var obj = document.getElementById(objId);
	
	//¾øÀ¸¸é Áß´Ü
	if(obj==null) return;
	
	//°´Ã¼ÀÇ classNameÀ» cNameÀ¸·Î..
	obj.className =cName;


}


/* °¢ ? ¹®±¸  */
function help_act(n){
	
	if(n=="1"){
		
	}else if(n=="2"){
		
	
	}else if(n=="3"){
		
		
	}else if(n=="4"){	
		
		
	}
	
	
}


/* My Æ÷ÀÎÆ® Á¤º¸ */
function point_list(){
	
	window.open("/source/point_list.php","point_list","width=10,height=10,resizable=1,scrollbars=1");
	
}




