
// »ç¿ëÀÚ ¼³Á¤ ºÎºÐ 
Layer_popup_close=2;  //¸Þ´º ´Ý´Â ¹æ¹ý 1(Å¬¸¯À¸·Î ´ÝÀ½ )¶Ç´Â 2(¸¶¿ì½º ¾Æ¿ôÀ¸·Î ´ÝÀ½ )

var satuas; //¸¶¿ì½º°¡ ÆË¾÷Ã¢ À§¿¡ ³õ¿© ÀÖ´ÂÁö¸¦ ¾Ë±â À§ÇÑ Àü¿ªº¯¼ö ¼±¾ð
function popup_Layer(event,popup_name,userid,gourl) {    //ÆË¾÷·¹ÀÌ¾î »ý¼º
     var main,_tmpx,_tmpy,_marginx,_marginy;
     main = document.getElementById(popup_name);
     if(Layer_popup_close==2){
        satuas=1;//Å¬¸¯À¸·Î ÀÎÇÑ ´ÝÈû ¹æÁö¸¦ À§ÇØ
     }
     main.style.display = '';//ÆË¾÷ »ý¼º 
     _tmpx = event.clientX+parseInt(main.offsetWidth);
     _tmpy = event.clientY+parseInt(main.offsetHeight);
     _marginx = document.body.clientWidth - _tmpx;
     _marginy = document.body.clientHeight - _tmpy;

     // ÁÂ¿ì À§Ä¡ ÁöÁ¤
     if(_marginx < 0){//¿ìÃø;
        main.style.left = event.clientX + document.body.scrollLeft + _marginx-2+"px";
     }
     else{
        main.style.left = event.clientX + document.body.scrollLeft-5+"px";
     }
     //³ôÀÌ ÁöÁ¤
     if(_marginy < 0){//¾Æ·¡ºÎºÐ;
        main.style.top = event.clientY + document.body.scrollTop + _marginy-5+"px";
     }  
     else{
        main.style.top = event.clientY + document.body.scrollTop-5+"px";
     } 
     event.returnValue = false;
	 document.id_form.userid.value = userid;
	 document.id_form.gourl.value = gourl;
}  

function mouse_anchor(type){ //¸¶¿ì½ºÀÇ À§Ä¡¿¡ µû¸¥ ÆË¾÷ÀÇ ´ÝÀ½À» °áÁ¤
    if(type=="1"){
       satuas="1";
    }
    if(type=="0"){
       satuas="0";
    }
}

function Layer_popup_Off() { //ÆË¾÷ ´ÝÀ½
  if(satuas=="0"){
     document.getElementById("User_Profile").style.display = "none";
   }
   if(Layer_popup_close==2){
      satuas=null;
   }
} 

function mouseout_close() {
    window.setTimeout('Layer_popup_Off()',500);
}


//if(Layer_popup_close==1){
//	document.onmousedown = Layer_popup_Off;//Å¬¸¯À¸·Î ´Ý±â
//}

if(Layer_popup_close==2){
   document.onmouseover=mouseout_close;//·¹ÀÌ¾î ¹ù¾î³ª¸é ´Ý±â
}

////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////


function login(){	
	var gourl;
	gourl = id_form.gourl.value;
	location.href="/loginform.asp?loginURL="+gourl
}

function userinfo(){	
	var userid;
	var Left_P;
	var Top_P;
	Left_P = (screen.width - 380) / 2;
	Top_P  = (screen.height - 600) / 2;
	userid = id_form.userid.value;
	window.open("/mypage/UserProfile/Usermain.asp?userid="+userid,"info","height=619,width=380,scrollbars=no,resizable=no,left="+Left_P+",top="+Top_P+"");
	//event.returnValue = false;
	document.getElementById("User_Profile").style.display = "none";
}
function Massage(){	
	var userid;
	var Left_P;
	var Top_P;
	Left_P = (screen.width - 380) / 2;
	Top_P  = (screen.height - 425) / 2;
	userid = id_form.userid.value;
	window.open("/Mypage/UserProfile/Message.asp?mess_s=0&mess_a=1&userid=" + userid,"","height=465,width=380,scrollbars=no,resizable=no,left="+Left_P+",top="+Top_P+"");
	//event.returnValue = false;
	document.getElementById("User_Profile").style.display = "none";
}

function SMS(){	
	var userid;
	var Left_P;
	var Top_P;
	Left_P = (screen.width - 300) / 2;
	Top_P  = (screen.height - 326) / 2;
	userid = id_form.userid.value;
	alert('Á¡°ËÁßÀ¸·Î »ç¿ëÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.');
	//window.open("/Mypage/UserProfile/sms.asp?userid=" + userid,"","height=326,width=300,scrollbars=no,resizable=no,left="+Left_P+",top="+Top_P+"");
	//event.returnValue = false;
	document.getElementById("User_Profile").style.display = "none";
}

function Novice(){	
	var userid;
	var Left_P;
	var Top_P;
	Left_P = (screen.width - 360) / 2;
	Top_P  = (screen.height - 230) / 2;
	userid = id_form.userid.value;
	window.open("/Mypage/UserProfile/Novice.asp?userid=" + userid,"","height=230,width=360,scrollbars=no,resizable=no,left="+Left_P+",top="+Top_P+"");
	//event.returnValue = false;
	document.getElementById("User_Profile").style.display = "none";
}

function PMarket(){	
	var userid;
	var Left_P;
	var Top_P;
	Left_P = (screen.width - 800) / 2;
	Top_P  = (screen.height - 500) / 2;
	userid = id_form.userid.value;
	window.open("/Mypage/UserProfile/Pmarket.asp?userid=" + userid,"","height=510,width=820,scrollbars=yes,resizable=no,left="+Left_P+",top="+Top_P+"");
	//event.returnValue = false;
	document.getElementById("User_Profile").style.display = "none";
}
//°ü½ÉÀ¯ÀúÃß°¡
function userplus() {
    var userid;
    var Left_P;
    var Top_P;
    Left_P = (screen.width - 300) / 2;
    Top_P = (screen.height - 300) / 2;
    userid = id_form.userid.value;
    window.open("/Mypage/UserProfile/UserPlus.asp?userid=" + userid, "", "height=100,width=100,scrollbars=yes,resizable=no,left=" + Left_P + ",top=" + Top_P + "");
    //alert(userid);
    document.getElementById("User_Profile").style.display = "none";
}
//°ü½ÉÀ¯Àú»èÁ¦
function userdel() {
    var userid;
    var Left_P;
    var Top_P;
    Left_P = (screen.width - 300) / 2;
    Top_P = (screen.height - 300) / 2;
    userid = id_form.userid.value;
    window.open("/Mypage/UserProfile/Userdel.asp?userid=" + userid, "", "height=100,width=100,scrollbars=yes,resizable=no,left=" + Left_P + ",top=" + Top_P + "");
    //alert(userid);
    document.getElementById("User_Profile").style.display = "none";
}
//°ü½ÉÀ¯ÀúÂ÷´Ü
function userdel2() {
    var userid;
    var Left_P;
    var Top_P;
    Left_P = (screen.width - 300) / 2;
    Top_P = (screen.height - 300) / 2;
    userid = id_form.userid.value;
    window.open("/Mypage/UserProfile/Userdel2.asp?userid=" + userid, "", "height=100,width=100,scrollbars=yes,resizable=no,left=" + Left_P + ",top=" + Top_P + "");
    //alert(userid);
    document.getElementById("User_Profile").style.display = "none";
}
