if(document.all){
  var isie=true; 
}else if(document.layers){
  var isns4=true; 
}else if(document.getElementById){
  var isns6=true; 
} 
 
function ref(id){ 
  if(isie) return document.all[id]; 
  if(isns4) return document.layers[id]; 
  if(isns6) return document.getElementById(id); 
}

function memapply(){
  document.location.href="/shop/shop.php?req=apply_frm";
}

function loginchk(){
  if(!document.login_form.id.value){
    alert("¾ÆÀÌµð¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
    document.login_form.id.focus();
    return false;
  }
  if(!document.login_form.pw.value){
    alert("ÆÐ½º¿öµå¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
    document.login_form.pw.focus();
    return false;
  }
  return true;
}

function sloginchk(){
  if(!document.slogin_form.id.value){
    alert("¾ÆÀÌµð¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
    document.slogin_form.id.focus();        
    return false;    
  }
  if(!document.slogin_form.pw.value){
    alert("ÆÐ½º¿öµå¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
    document.slogin_form.pw.focus();        
    return false;   
  }
  return true;
}

function admloginchk() {
  if(!document.admlogin_form.admid.value) {
    alert("¾ÆÀÌµð¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
    document.admlogin_form.admid.focus();
    return false;
  }
  if(!document.admlogin_form.admpw.value) {
    alert("ÆÐ½º¿öµå¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
    document.admlogin_form.admpw.focus();
    return false;
  }
  return true;
}

function logout(){
  document.logout_form.submit();
}

function sch(fld,form){
  var key=fld.value.replace(/ /g,"");
  if(!key){
    alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");    
    fld.focus();
    return;
  }
  form.submit();
}

function allblur(){
  for (i = 0; i < document.links.length; i++){
    document.links[i].onfocus = document.links[i].blur;
  }
}

function vote(uid,form,mode){
  var i; 
  for(i=0;i<form.answer.length;i++){
    if(form.answer[i].checked==true){
      break;
    } 
  } 
  if(i==form.answer.length){
    alert("Ç×¸ñÀ» ¼±ÅÃÇØÁÖ¼¼¿ä.");
    return;
  }
  window.open("/shop/poll.php?uid="+uid+"&mode="+mode+"&answer="+form.answer[i].value,"","width=400,height=500,toolbar=no,menubar=no,scrollbars=yes,status=no");
}

function view_result(uid,form,mode){
  window.open("/shop/poll.php?uid="+uid+"&mode="+mode,"","width=400,height=500,toolbar=no,menubar=no,scrollbars=yes,status=no");
}