﻿/////////////////////////////////////////////////////////////////////////////////
//닭장 닷컴                              ////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////

//var domain = "darkjang.com";

//var isDOM = (document.getElementById ? true : false);
//var isIE4 = ((document.all && !isDOM) ? true : false);
//var isNS4 = (document.layers ? true : false);

function IsParent()
{
	if(typeof parent.footer == 'undefined'){
		top.location.href = '/default.html';
		return false;
	}else
		return true;
		
}


function IsLogin()
{
	if(typeof parent.footer.footer.Updater == 'undefined')
	{
		alert('현재 세션이 끝났거나 채팅 페이지가 비정상적으로 작동하고 있습니다.\n 다시 로긴해주세요');
		document.location.href = '../log_out.aspx';
		return false;
	}else
		return true;
	
}
		
function makeVirtualForm(){

	var str = '<form name="virtualFrm" method="post">'
	+' <input type="hidden" name="id"> '
	+' <input type="hidden" name="data"> '
	+' <input type="hidden" name="title"> '
	+' <input type="hidden" name="msg"> '
	+' <input type="hidden" name="btype"> '
	+' <input type="hidden" name="obj"> '
	+' <input type="hidden" name="refresh"> '
	+'</form>';
	
	try{
		document.body.insertAdjacentHTML("afterBegin", str);
		attachEvent("onload", makeVirtualForm);
	}catch(Exception){}
	
}


var djMenu = null;
var djList = null;

function makeAvata(layer, img)
{
	var tag ="<DIV ID=avt_lay" + layer + " STYLE='position:absolute; left:0; top:0; z-index:" + layer + ";'>"
			+"<img id=avt_img" + layer + " src='/avata_image/" + img + "' border=0></DIV>";
	
	document.write(tag);		
	
}

function initializeMenu(){

	var initHTML ='<div id="djMenu" style="position:absolute; left:0px; top:0px; z-index:2; visibility: hidden ; " onblur="hideMenu();" onmouseout="hideMenu();"></div>'; 
	
	document.body.insertAdjacentHTML("afterBegin", initHTML);
	djMenu = document.getElementById('djMenu');
	
	
	//var initHTML2 ='<div id="djList" style="position:absolute; left:0px; top:0px; z-index:2; visibility: hidden ; " onblur="hideMpop();"></div>' ;
	var initHTML2 ='<div id="djList" style="position:absolute; left:0px; top:0px; z-index:2; visibility: hidden ; " ></div>' ;
	document.body.insertAdjacentHTML("afterBegin", initHTML2);
	djList = document.getElementById('djList');
	
	
	
}

attachEvent("onload", initializeMenu);

function hideMenu(force)
{
	if(typeof force != "undefined" && force != "") {
		djMenu.style.visibility = 'hidden';
		return;
	}
	if( djMenu.componentFromPoint( event.x, event.y ) != '' )
		djMenu.style.visibility = 'hidden';
}

function trim(tmpStr) {
  var atChar;
  if (tmpStr.length > 0) atChar = tmpStr.charAt(0);
  while (isSpace(atChar)) {
    tmpStr = tmpStr.substring(1, tmpStr.length);
    atChar = tmpStr.charAt(0);
  }
  if (tmpStr.length > 0) atChar = tmpStr.charAt(tmpStr.length-1);
  while (isSpace(atChar)) {
    tmpStr = tmpStr.substring(0,( tmpStr.length-1));
    atChar = tmpStr.charAt(tmpStr.length-1);
  }
  return tmpStr;
}

function isSpace(inChar) {
  return (inChar == ' ' || inChar == '\t' || inChar == '\n');
}

function checkEmail(str)
{
  str = str.toLowerCase();
  
  var supported = 0;
  if (window.RegExp) {
    var tempStr = "a"
    var tempReg = new RegExp(tempStr);
    if (tempReg.test(tempStr)) supported = 1
  }
  if (!supported) 
    return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
  var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
  var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
  
  var r3 = new RegExp("daum.net");
  var r4 = new RegExp("hanmail.net");
  if(r3.test(str) || r4.test(str))
		return -2;
  
  return (!r1.test(str) && r2.test(str));
	
}


function checkSearch(obj)
{
	var numPattern = /([^%])/;
    
  numPattern = obj.value.match(numPattern);
    
	if(numPattern != null){
		return true;
	}else{
		obj.value="";
		obj.focus();
		return false;
	}	
	
}


function checkValidID(obj)
{
	var numPattern = /([^a-z|A-Z|0-9])/;
    
  numPattern = obj.value.match(numPattern);
    
	if(numPattern != null){
		alert("숫자와 영문 소문자로만 입력해 주세요!");
		obj.value="";
		obj.focus();
		return false;
	}else
		return true;
	
}

function checkValidName()
{
	if( (event.keyCode>90||event.keyCode<97) || (event.keyCode>122)) {
		alert('한글로만 입력해주세요');
		event.returnValue=false;
	}
}

function checkValidNumber(obj)
{
	var numPattern = /([^0-9])/;
    
  numPattern = obj.value.match(numPattern);
    
	if(numPattern != null){
		alert("숫자로만 입력해 주세요!");
		obj.value="";
		obj.focus();
		return false;
	}else
		return true;
	
}


function checkValidStr(str)
{

	var numPattern = /(['%@`&;])/;
    
  numPattern = str.match(numPattern);
    
  if(numPattern != null){
		alert("허용할 수 없는 문자열을 입력하셨습니다.");
		return false;
	}else
		return true;

}

function replaceComment(str)
{
	str = str.replace("--", "&#06;&#06;");
	str = str.replace("/*", "&#47;&#42;");
	return str.replace("*/", "&#42;&#47;");

}

function getLength(str)
{
  return(str.length+(escape(str)+"%u").match(/%u/g).length-1);
}

function hidestatus()
{
	window.status='';
	return true;
}


if (document.layers)
	document.captureEvents(Event.mouseover | Event.mouseout);
	document.onmouseover=hidestatus;
	document.onmouseout=hidestatus;
	
//로그아웃
function LogOut(){ document.location.href = '../log_out.aspx'; }

function LogIn(){ document.location.href = '../register/login.aspx'; }

function GoMain(){ document.location.href = '../default.aspx'; }


function GoChatSearch(){ document.location.href = '../etc/chat_search.aspx'; }

function GoFAQ(){ document.location.href = '../faq/faq_main.aspx'; }


function GoChat(){ document.location.href = '../chat/chat_list.aspx'; }

function GoGame(){ document.location.href = '../game/flash_main.aspx'; }
function GoFlash(){ document.location.href = '../game/flash_main.aspx'; }
function GoItem(){ document.location.href = '../item/item_list.aspx'; }

function GoCommunity(){ document.location.href = '../community/community_main.aspx'; }
function GoKingNQueen(){ document.location.href = '../community/kingandqueen.aspx'; }

function GoBoard(type){ document.location.href = '../community/board_list.aspx?type=' + type; }

function GoChannel1(){ document.location.href = '../cp/bananating.aspx'; }

function GoRegister(){ document.location.href = '../register/register1.aspx'; }
function GoUnRegister(){ document.location.href = '../mypage/unregister.aspx'; }

function GoMyInfo() {document.location.href = '../mypage/my_info.aspx'; }
function GoMyChatImage() {document.location.href = '../mypage/my_chat_image.aspx'; }
function GoMyProductInfo(){	document.location.href = '../mypage/my_product_buy_info.aspx';}
function GoMyItem(){	document.location.href = '../mypage/my_item.aspx';}
function GoMsgBox(){ document.location.href = '../mypage/my_msg_box.aspx'; }
function GoMyEnvironment(){ document.location.href = '../mypage/my_environment.aspx'; }
function GoMyFriend(){ document.location.href = '../mypage/my_friend.aspx'; }
function GoMyEgg(){ document.location.href = '../mypage/my_egg_info.aspx'; }

function GoAlbaMsg(){ document.location.href = '../alba/msg_receive_list.aspx'; }
function GoAlbaGate(){ document.location.href = '../alba/gate.aspx'; }

function GoEvent(){ document.location.href = '../event_dakjang/event1.aspx'; }
//음악방송 도움말
function popUpMusicHelp()
{
	w = 571;
	h = 400;
	lp = (screen.width) ? (screen.width-w)/2 : 0;
	tp = (screen.height) ? (screen.height-h)/2 : 0;
	
	var oWin = window.open('../help/help_music.htm','help_music','scrollbars=1, resizable=no,width=' + w + ',height=' + h + ', status=no, top='+tp+',left='+lp);
	try{oWin.focus(); }catch(Exception){}
	
}

//인기도 올리기
function popUpPopularUpgrade()
{
	w = 501;
	h = 610;
	lp = (screen.width) ? (screen.width-w)/2 : 0;
	tp = (screen.height) ? (screen.height-h)/2 : 0;
	
	var oWin = window.open('../help/popular_up.htm','popular_up','scrollbars=no, resizable=no,width=' + w + ',height=' + h + ', status=no, top='+tp+',left='+lp);
	try{oWin.focus(); }catch(Exception){}
	
}

//DirectX 다운로드
function downloadDirectX(obj)
{
	obj.location.href = '../downprogram/dxwebsetup.exe';
}
	
//공지사항
function popUpNoticeView(id){
	w = 520;
	h = 375;
	lp = (screen.width) ? (screen.width-w)/2 : 0;
	tp = (screen.height) ? (screen.height-h)/2 : 0;
	
	if(typeof document.all.virtualFrm == 'undefined')
			makeVirtualForm();
	doc = document.all;
	doc.virtualFrm.id.value = id;
	doc.virtualFrm.target= 'viewNotice';
	doc.virtualFrm.action = '../notice/notice_view.aspx';
	
	var oWin = window.open('','viewNotice','scrollbars=no,resizable=no,width=' + w + ',height=' + h + ', status=no, top='+tp+',left='+lp);
	try{ oWin.focus(); }catch(Exception){}

	doc.virtualFrm.submit();
	
}

//공지사항
function popUpNoticeList(id){
	w = 520;
	h = 375;
	lp = (screen.width) ? (screen.width-w)/2 : 0;
	tp = (screen.height) ? (screen.height-h)/2 : 0;
	
	if(typeof document.all.virtualFrm == 'undefined')
			makeVirtualForm();
	doc = document.all;
	doc.virtualFrm.id.value = id;
	doc.virtualFrm.target= 'viewNoticeList';
	doc.virtualFrm.action = '../notice/notice_list.aspx';
	
	var oWin = window.open('','viewNoticeList','scrollbars=no,resizable=no,width=' + w + ',height=' + h + ', status=no, top='+tp+',left='+lp);
	try{ oWin.focus(); }catch(Exception){}

	doc.virtualFrm.submit();
	
}

//아이디찾기장 띄우기
function popUpFindId(){
	w = 350;
	h = 195;
	url = '../register/find_id.aspx';
	lp = (screen.width) ? (screen.width-w)/2 : 0;
	tp = (screen.height) ? (screen.height-h)/2 : 0;
	var oWin = window.open(url,'find_id','resizable=no,width=' + w + ',height=' + h + ', status=no, top='+tp+',left='+lp);
	try{ oWin.focus(); }catch(Exception){}
	
}

//비밀번호찾기장 띄우기
function popUpFindPassword(){
	w = 350;
	h = 245;
	url = '../register/find_password.aspx';
	lp = (screen.width) ? (screen.width-w)/2 : 0;
	tp = (screen.height) ? (screen.height-h)/2 : 0;
	var oWin = window.open(url,'find_id','resizable=no,width=' + w + ',height=' + h + ', status=no, top='+tp+',left='+lp);
	try{ oWin.focus(); }catch(Exception){}
	
}

//로긴창 띄우기
function popUpLogin(){
	w = 396;
	h = 332;
	url = '../register/login_popup.aspx';
	lp = (screen.width) ? (screen.width-w)/2 : 0;
	tp = (screen.height) ? (screen.height-h)/2 : 0;
	var oWin = window.open(url,'pop_login','resizable=no,width=' + w + ',height=' + h + ', status=no, top='+tp+',left='+lp);
	try{ oWin.focus(); }catch(Exception){}
	
}

//로긴창 띄우기
function popUpLogin(opener1){
	
	try{
		w = 396;
		h = 332;
		url = '../register/login_popup.aspx';
		lp = (screen.width) ? (screen.width-w)/2 : 0;
		tp = (screen.height) ? (screen.height-h)/2 : 0;
		var oWin = window.open(url,'pop_login','resizable=no,width=' + w + ',height=' + h + ', status=no, top='+tp+',left='+lp);
		oWin.opener = opener1;
	}catch(Exception){
	
		popUpLogin();
	}
	
}

//메시지창 띄우기
function popUpMessage(title, msg, type){
	w = 350;
	h = 240;
	lp = (screen.width) ? (screen.width-w)/2 : 0;
	tp = (screen.height) ? (screen.height-h)/2 : 0;
	
	if(typeof document.all.virtualFrm == 'undefined')
			makeVirtualForm();
	doc = document.all;
	doc.virtualFrm.title.value = title;
	doc.virtualFrm.msg.value = msg;
	doc.virtualFrm.btype.value = type;
	doc.virtualFrm.target= 'pop_msg';
	doc.virtualFrm.action = '../etc/popup_message.aspx';
	
	var oWin = window.open('','pop_msg','resizable=no,width=' + w + ',height=' + h + ', status=no, top='+tp+',left='+lp);
	try{ oWin.focus(); }catch(Exception){ alert('error');}
	
	doc.virtualFrm.submit();
	
}




//메시지창 띄우기
function popUpMessage(title, msg, type, refresh){
	w = 350;
	h = 240;
	lp = (screen.width) ? (screen.width-w)/2 : 0;
	tp = (screen.height) ? (screen.height-h)/2 : 0;
	
	if(typeof document.all.virtualFrm == 'undefined')
			makeVirtualForm();
	doc = document.all;
	doc.virtualFrm.title.value = title;
	doc.virtualFrm.msg.value = msg;
	doc.virtualFrm.btype.value = type;
	doc.virtualFrm.refresh.value = refresh;
	doc.virtualFrm.target= 'pop_msg';
	doc.virtualFrm.action = '../etc/popup_message.aspx';
	
	var oWin = window.open('','pop_msg','resizable=no,width=' + w + ',height=' + h + ', status=no, top='+tp+',left='+lp);
	try{ oWin.focus(); }catch(Exception){ alert('error');}
	
	doc.virtualFrm.submit();
	
	if(refresh == 'on')
		oWin.opener = opener;
	
}





//친구등록 창 띄우기
function popUpAddFriend(id){
	w = 350;
	h = 240;
	lp = (screen.width) ? (screen.width-w)/2 : 0;
	tp = (screen.height) ? (screen.height-h)/2 : 0;
	
	if(typeof document.all.virtualFrm == 'undefined')
			makeVirtualForm();
	doc = document.all;
	doc.virtualFrm.id.value = id;
	doc.virtualFrm.target= 'addfriend';
	doc.virtualFrm.action = '../etc/add_friend.aspx';
	
	var oWin = window.open('','addfriend','resizable=no,width=' + w + ',height=' + h + ', status=no, top='+tp+',left='+lp);
	try{ oWin.focus(); }catch(Exception){}

	doc.virtualFrm.submit();
	
}


//블랙리스트 등록 창 띄우기
function popUpBadFriend(id){
	w = 350;
	h = 240;
	lp = (screen.width) ? (screen.width-w)/2 : 0;
	tp = (screen.height) ? (screen.height-h)/2 : 0;
	
	if(typeof document.all.virtualFrm == 'undefined')
			makeVirtualForm();
	doc = document.all;
	doc.virtualFrm.id.value = id;
	doc.virtualFrm.target= 'badfriend';
	doc.virtualFrm.action = '../etc/add_bad_friend.aspx';
	
	var oWin = window.open('','badfriend','resizable=no,width=' + w + ',height=' + h + ', status=no, top='+tp+',left='+lp);
	try{ oWin.focus(); }catch(Exception){}

	doc.virtualFrm.submit();
	
}


//아이템 선물하기
function popUpPresentItem(id)
{
		w = 351;
		if(window.navigator.userAgent.indexOf("MSIE 7.0") == 25) // IE 7.0
			h = 500;
		else
			h = 445;
		
		if(typeof document.all.virtualFrm == 'undefined')
			makeVirtualForm();
		doc = document.all;
		doc.virtualFrm.id.value = id;
		doc.virtualFrm.target= 'present_item';
		doc.virtualFrm.action = '../item/present_item.aspx';
	
		lp = (screen.width) ? (screen.width-w)/2 : 0;
		tp = (screen.height) ? (screen.height-h)/2 : 0;
		var oWin = window.open('','present_item','resizable=no,width=' + w + ',height=' + h + ', status=no, top='+tp+',left='+lp);
		try{ oWin.focus(); }catch(Exception){}
		
		doc.virtualFrm.submit();
	
}

//아이템 선물하기
function popUpPresentDJItem(id, refresh, obj)
{

		w = 331;
		//if(window.navigator.userAgent.indexOf("MSIE 7.0") == 25) // IE 7.0
		//	h = 550;
		//else
		h = 530;
		
		if(typeof document.all.virtualFrm == 'undefined')
			makeVirtualForm();
		doc = document.all;
		doc.virtualFrm.id.value = id;
		doc.virtualFrm.obj.value = obj;
		doc.virtualFrm.refresh.value = refresh;
		doc.virtualFrm.target= 'present_dj_item';
		doc.virtualFrm.action = '../item/present_dakjang_item.aspx';
	
		lp = (screen.width) ? (screen.width-w)/2 : 0;
		tp = (screen.height) ? (screen.height-h)/2 : 0;
		var oWin = window.open('','present_dj_item','resizable=no,width=' + w + ',height=' + h + ', status=no, top='+tp+',left='+lp);
		try{ oWin.focus(); }catch(Exception){}
		
		doc.virtualFrm.submit();

}

//아이템 특정 아이디에게 선물하기
function popUpPresentItemTo(id, toid)
{
		w = 311;
		h = 500;
		
		if(typeof document.all.virtualFrm == 'undefined')
			makeVirtualForm();
		doc = document.all;
		doc.virtualFrm.id.value = id;
		doc.virtualFrm.data.value = toid;
		doc.virtualFrm.target= 'present_to_item';
		doc.virtualFrm.action = '../item/present_item.aspx';
	
		lp = (screen.width) ? (screen.width-w)/2 : 0;
		tp = (screen.height) ? (screen.height-h)/2 : 0;
		var oWin = window.open('','present_to_item','resizable=no,width=' + w + ',height=' + h + ', status=no, top='+tp+',left='+lp);
		try{ oWin.focus(); }catch(Exception){}
		
		doc.virtualFrm.submit();
	
}

//아이템을 특정 아이디에게 선물하기
function popUpPresentDJItemTo(id, toid)
{

		w = 331;
		h = 514;

		
		if(typeof document.all.virtualFrm == 'undefined')
			makeVirtualForm();
		doc = document.all;
		doc.virtualFrm.id.value = id;
		doc.virtualFrm.data.value = toid;
		doc.virtualFrm.target= 'present_to_item';
		doc.virtualFrm.action = '../item/present_dakjang_item.aspx';
	
		lp = (screen.width) ? (screen.width-w)/2 : 0;
		tp = (screen.height) ? (screen.height-h)/2 : 0;	

		//var oWin = window.open('','present_to_item','resizable=no,width=' + w + ',height=' + h + ', status=no, top='+tp+',left='+lp);
		var oWin = window.open('','present_to_item','resizable=no,width=' + w + ',height=514, status=no, top='+tp+',left='+lp);
		try{ oWin.focus(); }catch(Exception){}
		
		doc.virtualFrm.submit();
	
	
}


//아이템 조르기
function popUpWishItem(id)
{
		w = 351;
		h = 368;
		lp = (screen.width) ? (screen.width-w)/2 : 0;
		tp = (screen.height) ? (screen.height-h)/2 : 0;
		
		if(typeof document.all.virtualFrm == 'undefined')
			makeVirtualForm();
		doc = document.all;
		doc.virtualFrm.id.value = id;
		doc.virtualFrm.target= 'wish_item';
		doc.virtualFrm.action = '../item/wish_item.aspx';
		
		var oWin = window.open('','wish_item','resizable=no,width=' + w + ',height=' + h + ', status=no, top='+tp+',left='+lp);
		try{ oWin.focus(); }catch(Exception){}
		
		doc.virtualFrm.submit();
}

//아이템 찜
function popUpZzimitem(id)
{
		w = 351;
		h = 190;
		lp = (screen.width) ? (screen.width-w)/2 : 0;
		tp = (screen.height) ? (screen.height-h)/2 : 0;
		
		if(typeof document.all.virtualFrm == 'undefined')
			makeVirtualForm();
		doc = document.all;
		doc.virtualFrm.id.value = id;
		doc.virtualFrm.target= 'zzim_item';
		doc.virtualFrm.action = '../item/zzim_item.aspx';
		
		var oWin = window.open('','zzim_item','resizable=no,width=' + w + ',height=' + h + ', status=no, top='+tp+',left='+lp);
		try{ oWin.focus(); }catch(Exception){}
		
		doc.virtualFrm.submit();
		
}

//아이템 구입
function popUpBuyItem(id, refresh, obj)
{
		w = 351;
		h = 411;
		lp = (screen.width) ? (screen.width-w)/2 : 0;
		tp = (screen.height) ? (screen.height-h)/2 : 0;
		
		
		if(typeof document.all.virtualFrm == 'undefined')
			makeVirtualForm();
		
		doc = document.all;
		doc.virtualFrm.id.value = id;
		doc.virtualFrm.obj.value = obj;
		doc.virtualFrm.refresh.value = refresh;
		
		doc.virtualFrm.target= 'buy_item';
		doc.virtualFrm.action = '../item/buy_item.aspx';
		
		var oWin = window.open('','buy_item','resizable=no,width=' + w + ',height=' + h + ', status=no, top='+tp+',left='+lp);
		try{ oWin.focus(); }catch(Exception){}
		
		doc.virtualFrm.submit();
}

//아이템 구입
function popUpBuyMagicItem(id, refresh, obj)
{
		w = 311;
		h = 420;
		lp = (screen.width) ? (screen.width-w)/2 : 0;
		tp = (screen.height) ? (screen.height-h)/2 : 0;
		
		
		if(typeof document.all.virtualFrm == 'undefined')
			makeVirtualForm();
		
		doc = document.all;
		doc.virtualFrm.id.value = id;
		doc.virtualFrm.obj.value = obj;
		doc.virtualFrm.refresh.value = refresh;
		
		doc.virtualFrm.target= 'buy_magic_item';
		doc.virtualFrm.action = '../item/buy_magic_item.aspx';
		
		var oWin = window.open('','buy_magic_item','resizable=no,width=' + w + ',height=' + h + ', status=no, top='+tp+',left='+lp);
		try{ oWin.focus(); }catch(Exception){}
		
		doc.virtualFrm.submit();
}

//아이템 상세정보
function popUpItemDetail(id)
{
		w = 400;
		h = 250;
		lp = (screen.width) ? (screen.width-w)/2 : 0;
		tp = (screen.height) ? (screen.height-h)/2 : 0;
		
		
		if(typeof document.all.virtualFrm == 'undefined')
			makeVirtualForm();
		
		doc = document.all;
		doc.virtualFrm.id.value = id;
		
		doc.virtualFrm.target= 'item_detail';
		doc.virtualFrm.action = '../item/item_detail_popup.aspx';
		
		var oWin = window.open('','item_detail','resizable=no,width=' + w + ',height=' + h + ', status=no, top='+tp+',left='+lp);
		try{ oWin.focus(); }catch(Exception){}
		
		doc.virtualFrm.submit();
}


function popUpFreeEggCharge()
{
	w = 350;
	h = 290;
	lp = (screen.width) ? (screen.width-w)/2 : 0;
	tp = (screen.height) ? (screen.height-h)/2 : 0;
	
	var oWin = window.open('../item/free_charge.aspx','free_charge','resizable=no,width=' + w + ',height=' + h + ', status=no, top='+tp+',left='+lp);
	try{oWin.focus(); }catch(Exception){}

}

function popUpEggCharge()
{
	w = 400;
	h = 462;
	lp = (screen.width) ? (screen.width-w)/2 : 0;
	tp = (screen.height) ? (screen.height-h)/2 : 0;
	
	var oWin = window.open('../item/eggs_charge.aspx','eggs_charge','resizable=no,width=' + w + ',height=' + h + ', status=no, top='+tp+',left='+lp);
	try{oWin.focus(); }catch(Exception){}
	
	oWin.opener = opener;

}


//쪽지 보내기 창 띄우기
function popUpSendMessage(id){

	w = 381;
	h = 260;
	//h = 310; // ie7.0 때문에...
	
	lp = (screen.width) ? (screen.width-w)/2 : 0;
	tp = (screen.height) ? (screen.height-h)/2 : 0;
		
	if(typeof document.all.virtualFrm == 'undefined')
			makeVirtualForm();
			
	doc = document.all;
	doc.virtualFrm.id.value = id;
	doc.virtualFrm.target= 'send_message';
	doc.virtualFrm.action = '/XVMMain/message/send_message.aspx';
		
	var oWin = window.open('','send_message','resizable=no,width=' + w + ',height=' + h + ', status=no, top='+tp+',left='+lp);
		
	try{ oWin.focus(); }catch(Exception){}
	
	doc.virtualFrm.submit();
}

//쪽지 보내기 창 띄우기
function popUpSendMessage2(str){

	w = 381;
	h = 260;
	lp = (screen.width) ? (screen.width-w)/2 : 0;
	tp = (screen.height) ? (screen.height-h)/2 : 0;
		
	if(typeof document.all.virtualFrm == 'undefined')
			makeVirtualForm();
			
	doc = document.all;
	doc.virtualFrm.data.value = str;
	doc.virtualFrm.target= 'send_message';
	doc.virtualFrm.action = '../message/send_message.aspx';
		
	var oWin = window.open('','send_message','resizable=no,width=' + w + ',height=' + h + ', status=no, top='+tp+',left='+lp);
		
	try{ oWin.focus(); }catch(Exception){}
	
	doc.virtualFrm.submit();
}



function popUpInfo(info, url, w, h)
{
	
	lp = (screen.width) ? (screen.width-w)/2 : 0;
	tp = (screen.height) ? (screen.height-h)/2 : 0;
	
	var oWin = window.open(url,info,'scrollbars=yes, resizable=no,width=' + w + ',height=' + h + ', status=no, top='+tp+',left='+lp);
	try{oWin.focus(); }catch(Exception){}
	

}


//미니홈피 창 띄우기
function popUpHompy(id){
	
	target = 'mini_hompy' + id;
	
	w = 902;
	h = 650;
	lp = (screen.width) ? (screen.width-w)/2 : 0;
	tp = (screen.height) ? (screen.height-h)/2 : 0;
	
	/*
	if(typeof document.all.virtualFrm == 'undefined')
			makeVirtualForm();
			
	doc = document.all;
	doc.virtualFrm.id.value = id;
	doc.virtualFrm.target = target;
	doc.virtualFrm.action = '/hompy/hompy.aspx';
	*/
	
	var oWin = window.open('/XVMMain/hompy/hompy.aspx?id=' + id,target,'resizable=no,width=' + w + ',height=' + h + ', status=no, top='+tp+',left='+lp);
	//var oWin = window.open('',target,'resizable=no,width=' + w + ',height=' + h + ', status=no, top='+tp+',left='+lp);
	try{oWin.focus(); }catch(Exception){}
	
	//doc.virtualFrm.submit();
	
	
}

//형광펜창 띄우기
function popUpNeon(url){
	var oWin = window.open(url,'neon','resizable=no,width=350,height=350, status=no');
	try{ oWin.focus(); }catch(Exception){ alert('error');}
}

function InviteUser(id, roomid, senderid)
{
	try{
		if(typeof opener.parent.footer.Updater != 'undefined')
			opener.parent.footer.Updater.InviteRequest(id, roomid);
		alert(id + '님에게 초대 메시지를 보냈습니다.');	
	
		hideMenu('1');
	
	}catch(Exception)
	{
		alert('초대 메시지를 보내는중 오류가 발생 하였습니다.');
	}
	
}

function InviteUserToRoom(id, roomid)
{
	try{
	if(typeof opener.parent.footer.Updater != 'undefined')
		opener.parent.footer.Updater.InviteRequest(id, roomid);
		alert(id + '님에게 초대 메시지를 보냈습니다.');
		
	}catch(Exception)
	{
		alert('초대 메시지를 보내는중 오류가 발생 하였습니다.');
	}
	
}


function InviteOk(id, roomid, pwd, n)
{
	if(typeof opener.parent.footer.Updater != 'undefined')
		opener.parent.footer.Updater.InviteAck(id, roomid, pwd, n);
	self.close();
	
}



//방참가
/*
function JoinToRoom(rid, chkMask)
{	

	ret = parent.footer.footer.Updater.IsChating(); 
	
	if(ret == true)
	{
		alert('이미 채팅중입니다.');
		hideMpop('1');
		return;
		
	}	
	
	if(chkMask == '1'){
		
		if(typeof ifrVt.document.chk_item_at_join.rid != 'undefined'){
		
			ifrVt.document.chk_item_at_join.rid.value = rid;
			ifrJoinVt.document.join_room_ok.rid.value = rid;
			
			ifrVt.document.chk_item_at_join.id.value = 'ITEMMASK';
			ifrVt.document.chk_item_at_join.blind.value = '4';
				
			ifrJoinVt.document.join_room_ok.id.value = 'ITEMMASK';
			ifrJoinVt.document.join_room_ok.blind.value = '4';
			
			ifrVt.document.chk_item_at_join.submit();	
			
		}else{
		
			alert('잠시후 다시 실행해 주세요');
			return;
		}
		
	}else{
	
		if(typeof ifrVt.document.chk_item_at_join.rid != 'undefined'){
		
			ifrVt.document.chk_item_at_join.rid.value = rid;
			ifrJoinVt.document.join_room_ok.rid.value = rid;
			
			ifrVt.document.chk_item_at_join.id.value = '';
			ifrJoinVt.document.join_room_ok.id.value = '';
			
			ifrVt.document.chk_item_at_join.submit();	
			
		}else{
			
			alert('잠시후 다시 실행해 주세요');
			return;
		
		}
	
	}
	
}
*/

function JoinSuccess(rid)
{
	hideMpop('1');
	ifrVt.document.chk_item_at_join.rid.value = '';
	ifrVt.document.chk_item_at_join.id.value = '';
	ifrVt.document.chk_item_at_join.blind.value = '';
	
	if(typeof ifrJoinVt.document.join_room_ok != 'undefined'){		
		ifrJoinVt.document.join_room_ok.submit();
	}		
	
	
}


//음악방 참가
function JoinToMcastRoom(rid)
{
	if(typeof ifrVt.document.chk_item_at_join.rid != 'undefined'){
		ifrVt.document.chk_item_at_join.rid.value = rid;
		ifrVt.document.chk_item_at_join.submit();
	}
	
	
}





var	preTag = '<table width="130" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">';
		preTag += '<tr>'; 
		preTag += '<td height="1" bgcolor="#B4B4B4"></td>';
		preTag += '<td bgcolor="#B4B4B4"></td>';
		preTag += '<td bgcolor="#B4B4B4"></td>';
		preTag += '</tr>';
					
var postTag = '<tr>' 
		+ '<td height="1" bgcolor="#B4B4B4"></td>'
		+ '<td bgcolor="#B4B4B4"></td>'
		+ '<td bgcolor="#B4B4B4"></td>'
		+ '</tr>'
		+ '</table>';

function setTag(id)
{
		var html = preTag;
				html +='<tr>                                                                                                                                                                                                                                                            '
						+'  <td width="1" bgcolor="#B4B4B4"></td>                                                                                                                                                                                                                         '
						+'  <td height="20" onmouseover="this.style.backgroundColor=\'#F2F2F2\'" onmouseout="this.style.backgroundColor=\'#FFFFFF\'"><img src="/XVMMain/image/blank.gif" width="5" height="1"><img src="/XVMMain/image/right_img03.gif" width="11" height="9" border="0" align="absmiddle"> '
						+'    <a href="javascript:popUpHompy(\'' + id + '\')" class="chat_center_text">미니홈피</a></td>                                                                                                                                   '
						+'  <td width="1" bgcolor="#B4B4B4"></td>                                                                                                                                                                                                                         '
						+'</tr>                                                                                                                                                                                                                                                           '
						+'<tr>                                                                                                                                                                                                                                                            '
						+'  <td bgcolor="#B4B4B4"></td>                                                                                                                                                                                                                                   '
						+'  <td height="20" onmouseover="this.style.backgroundColor=\'#F2F2F2\'" onmouseout="this.style.backgroundColor=\'#FFFFFF\'"><img src="/XVMMain/image/blank.gif" width="5" height="1"><img src="/XVMMain/image/right_img04.gif" width="13" height="13" border="0" align="absmiddle">' 
						+'    <a href="javascript:popUpSendMessage(\'' + id + '\')" class="chat_cente_text">쪽지 보내기</a></td>'                                                                                                                         
						+'  <td bgcolor="#B4B4B4"></td>'
						+'</tr>';
					/*	+'<tr>'
						+'  <td bgcolor="#B4B4B4"></td>                                                                                                                                                                                                                                   '
						+'  <td height="20" onmouseover="this.style.backgroundColor=\'#F2F2F2\'" onmouseout="this.style.backgroundColor=\'#FFFFFF\'"><img src="/image/blank.gif" width="5" height="1"><img src="/image/right_img08.gif" width="11" height="11" border="0" align="absmiddle">' 
						+'    <a href="javascript:popUpAddFriend(\'' + id + '\')" class="chat_center_text">친구로 추가</a></td>                                                                                                                         '
						+'  <td bgcolor="#B4B4B4"></td>                                                                                                                                                                                                                                   '
						+'</tr>';         
					*/
			html 	+= postTag ; 
			
			return html;

}

function setTagFollowFriend(id, roomno)
{
		var html = preTag;
				html +='<tr>                                                                                                                                                                                                                                                            '
						+'  <td width="1" bgcolor="#B4B4B4"></td>                                                                                                                                                                                                                         '
						+'  <td height="20" onmouseover="this.style.backgroundColor=\'#F2F2F2\'" onmouseout="this.style.backgroundColor=\'#FFFFFF\'"><img src="/image/blank.gif" width="5" height="1"><img src="../image/right_img03.gif" width="11" height="9" border="0" align="absmiddle"> '
						+'    <a href="javascript:popUpHompy(\'' + id + '\')" class="chat_center_text">미니홈피</a></td>                                                                                                                                   '
						+'  <td width="1" bgcolor="#B4B4B4"></td>                                                                                                                                                                                                                         '
						+'</tr>                                                                                                                                                                                                                                                           '
						+'<tr>                                                                                                                                                                                                                                                            '
						+'  <td bgcolor="#B4B4B4"></td>                                                                                                                                                                                                                                   '
						+'  <td height="20" onmouseover="this.style.backgroundColor=\'#F2F2F2\'" onmouseout="this.style.backgroundColor=\'#FFFFFF\'"><img src="/image/blank.gif" width="5" height="1"><img src="../image/right_img04.gif" width="13" height="13" border="0" align="absmiddle">' 
						+'    <a href="javascript:popUpSendMessage(\'' + id + '\')" class="chat_center_text">쪽지 보내기</a></td>                                                                                                                         '
						+'  <td bgcolor="#B4B4B4"></td>                                                                                                                                                                                                                                   '
						+'</tr>                                                                                                                                                                                                                                                           '
						+'<tr>                                                                                                                                                                                                                                                            '
						+'  <td bgcolor="#B4B4B4"></td>                                                                                                                                                                                                                                   '
						+'  <td height="20" onmouseover="this.style.backgroundColor=\'#F2F2F2\'" onmouseout="this.style.backgroundColor=\'#FFFFFF\'"><img src="/image/blank.gif" width="5" height="1"><img src="../image/right_img08.gif" width="11" height="11" border="0" align="absmiddle">' 
						+'    <a href="javascript:popUpAddFriend(\'' + id + '\')" class="chat_center_text">친구로 추가</a></td>                                                                                                                         '
						+'  <td bgcolor="#B4B4B4"></td>                                                                                                                                                                                                                                   '
						+'</tr>'
						+'<tr>                                                                                                                                                                                                                                                            '
						+'  <td bgcolor="#B4B4B4"></td>                                                                                                                                                                                                                                   '
						+'  <td height="20" onmouseover="this.style.backgroundColor=\'#F2F2F2\'" onmouseout="this.style.backgroundColor=\'#FFFFFF\'"><img src="/image/blank.gif" width="5" height="1"><img src="../image/icon_shot.gif" width="11" height="11" border="0" align="absmiddle">' 
						+'    <a href="javascript:JoinToRoom(\'' + roomno + '\',\'0\')" class="chat_center_text">친구방 입장</a></td>                                                                                                                         '
						+'  <td bgcolor="#B4B4B4"></td>                                                                                                                                                                                                                                   '
						+'</tr>';         
			html 	+= postTag ; 
			
			return html;

}


function setTagImdae(id)
{
		var html = preTag;
				html +='<tr>                                                                                                                                                                                                                                                            '
						+'  <td bgcolor="#B4B4B4"></td>                                                                                                                                                                                                                                   '
						+'  <td height="20" onmouseover="this.style.backgroundColor=\'#F2F2F2\'" onmouseout="this.style.backgroundColor=\'#FFFFFF\'"><img src="/image/blank.gif" width="5" height="1"><img src="../image/right_img04.gif" width="13" height="13" border="0" align="absmiddle">' 
						+'    <a href="javascript:popUpSendMessage(\'' + id + '\')" class="chat_center_text">쪽지 보내기</a></td>                                                                                                                         '
						+'  <td bgcolor="#B4B4B4"></td>                                                                                                                                                                                                                                   '
						+'</tr>                                                                                                                                                                                                                                                           '
						+'<tr>                                                                                                                                                                                                                                                            '
						+'  <td bgcolor="#B4B4B4"></td>                                                                                                                                                                                                                                   '
						+'  <td height="20" onmouseover="this.style.backgroundColor=\'#F2F2F2\'" onmouseout="this.style.backgroundColor=\'#FFFFFF\'"><img src="/image/blank.gif" width="5" height="1"><img src="../image/right_img08.gif" width="11" height="11" border="0" align="absmiddle">' 
						+'    <a href="javascript:popUpAddFriend(\'' + id + '\')" class="chat_center_text">친구로 추가</a></td>                                                                                                                         '
						+'  <td bgcolor="#B4B4B4"></td>                                                                                                                                                                                                                                   '
						+'</tr>';         
			html 	+= postTag ; 
			
			return html;

}



function setTag2(id, roomid, senderid)
{
		var html = preTag;
				html +='<tr>                                                                                                                                                                                                                                                            '
						+'  <td width="1" bgcolor="#B4B4B4"></td>                                                                                                                                                                                                                         '
						+'  <td height="20" onmouseover="this.style.backgroundColor=\'#F2F2F2\'" onmouseout="this.style.backgroundColor=\'#FFFFFF\'"><img src="/image/blank.gif" width="5" height="1"><img src="../image/right_img03.gif" width="11" height="9" border="0" align="absmiddle"> '
						+'    <a href="javascript:popUpHompy(\'' + id + '\')" class="chat_center_text">미니홈피</a></td>                                                                                                                                   '
						+'  <td width="1" bgcolor="#B4B4B4"></td>                                                                                                                                                                                                                         '
						+'</tr>                                                                                                                                                                                                                                                           '
						+'<tr>                                                                                                                                                                                                                                                            '
						+'  <td bgcolor="#B4B4B4"></td>                                                                                                                                                                                                                                   '
						+'  <td height="20" onmouseover="this.style.backgroundColor=\'#F2F2F2\'" onmouseout="this.style.backgroundColor=\'#FFFFFF\'"><img src="/image/blank.gif" width="5" height="1"><img src="../image/right_img04.gif" width="13" height="13" border="0" align="absmiddle">' 
						+'    <a href="javascript:popUpSendMessage(\'' + id + '\')" class="chat_center_text">쪽지 보내기</a></td>                                                                                                                         '
						+'  <td bgcolor="#B4B4B4"></td>                                                                                                                                                                                                                                   '
						+'</tr>                                                                                                                                                                                                                                                           '
						+'<tr>                                                                                                                                                                                                                                                            '
						+'  <td bgcolor="#B4B4B4"></td>                                                                                                                                                                                                                                   '
						+'  <td height="20" onmouseover="this.style.backgroundColor=\'#F2F2F2\'" onmouseout="this.style.backgroundColor=\'#FFFFFF\'"><img src="/image/blank.gif" width="5" height="1"><img src="../image/topmenu_img07.gif" width="12" height="11" border="0" align="absmiddle"> '
						+'    <a href="javascript:InviteUser(\'' + id + '\',\'' + roomid + '\')" class="chat_center_text">초대하기</a></td>                                                                                                                         '
						+'  <td bgcolor="#B4B4B4"></td>                                                                                                                                                                                                                                   '
						+'</tr>																																																																																																																														'		
						+'<tr>                                                                                                                                                                                                                                                            '
						+'  <td bgcolor="#B4B4B4"></td>                                                                                                                                                                                                                                   '
						+'  <td height="20" onmouseover="this.style.backgroundColor=\'#F2F2F2\'" onmouseout="this.style.backgroundColor=\'#FFFFFF\'"><img src="/image/blank.gif" width="5" height="1"><img src="../image/right_img08.gif" width="11" height="11" border="0" align="absmiddle">' 
						+'    <a href="javascript:popUpAddFriend(\'' + id + '\')" class="chat_center_text">친구로 추가</a></td>                                                                                                                         '
						+'  <td bgcolor="#B4B4B4"></td>                                                                                                                                                                                                                                   '
						+'</tr>';         
			html 	+= postTag ; 
			
			return html;

}



function setTag3(id)
{
		var html = preTag;
				html +='<tr>                                                                                                                                                                                                                                                            '
						+'  <td width="1" bgcolor="#B4B4B4"></td>                                                                                                                                                                                                                         '
						+'  <td height="20" onmouseover="this.style.backgroundColor=\'#F2F2F2\'" onmouseout="this.style.backgroundColor=\'#FFFFFF\'"><img src="/image/blank.gif" width="5" height="1"><img src="../image/right_img03.gif" width="11" height="9" border="0" align="absmiddle"> '
						+'    <a href="javascript:popUpHompy(\'' + id + '\')" class="chat_center_text">미니홈피</a></td>                                                                                                                                   '
						+'  <td width="1" bgcolor="#B4B4B4"></td>                                                                                                                                                                                                                         '
						+'</tr>                                                                                                                                                                                                                                                           '
						+'<tr>                                                                                                                                                                                                                                                            '
						+'  <td bgcolor="#B4B4B4"></td>                                                                                                                                                                                                                                   '
						+'  <td height="20" onmouseover="this.style.backgroundColor=\'#F2F2F2\'" onmouseout="this.style.backgroundColor=\'#FFFFFF\'"><img src="/image/blank.gif" width="5" height="1"><img src="../image/right_img04.gif" width="13" height="13" border="0" align="absmiddle">' 
						+'    <a href="javascript:popUpSendMessage(\'' + id + '\')" class="chat_center_text">쪽지 보내기</a></td>                                                                                                                         '
						+'  <td bgcolor="#B4B4B4"></td>                                                                                                                                                                                                                                   '
						+'</tr>                                                                                                                                                                                                                                                           '
						+'<tr>                                                                                                                                                                                                                                                            '
						+'  <td bgcolor="#B4B4B4"></td>                                                                                                                                                                                                                                   '
						+'  <td height="20" onmouseover="this.style.backgroundColor=\'#F2F2F2\'" onmouseout="this.style.backgroundColor=\'#FFFFFF\'"><img src="/image/blank.gif" width="5" height="1"><img src="../image/right_img08.gif" width="11" height="11" border="0" align="absmiddle">' 
						+'    <a href="javascript:popUpBadFriend(\'' + id + '\')" class="chat_center_text">블랙리스트로 추가</a></td>                                                                                                                         '
						+'  <td bgcolor="#B4B4B4"></td>                                                                                                                                                                                                                                   '
						+'</tr>';         
			html 	+= postTag ; 
			
			return html;

}


function setTag4(id)
{
		var html = preTag;
				html +='<tr>                                                                                                                                                                                                                                                            '
						+'  <td width="1" bgcolor="#B4B4B4"></td>                                                                                                                                                                                                                         '
						+'  <td height="20" onmouseover="this.style.backgroundColor=\'#F2F2F2\'" onmouseout="this.style.backgroundColor=\'#FFFFFF\'"><img src="/image/blank.gif" width="5" height="1"><img src="../image/right_img03.gif" width="11" height="9" border="0" align="absmiddle"> '
						+'    <a href="javascript:popUpHompy(\'' + id + '\')" class="chat_center_text">미니홈피</a></td>                                                                                                                                   '
						+'  <td width="1" bgcolor="#B4B4B4"></td>                                                                                                                                                                                                                         '
						+'</tr>                                                                                                                                                                                                                                                           '
						+'<tr>                                                                                                                                                                                                                                                            '
						+'  <td bgcolor="#B4B4B4"></td>                                                                                                                                                                                                                                   '
						+'  <td height="20" onmouseover="this.style.backgroundColor=\'#F2F2F2\'" onmouseout="this.style.backgroundColor=\'#FFFFFF\'"><img src="/image/blank.gif" width="5" height="1"><img src="../image/right_img04.gif" width="13" height="13" border="0" align="absmiddle">' 
						+'    <a href="javascript:popUpSendMessage(\'' + id + '\')" class="chat_center_text">쪽지 보내기</a></td>                                                                                                                         '
						+'  <td bgcolor="#B4B4B4"></td>                                                                                                                                                                                                                                   '
						+'</tr>                                                                                                                                                                                                                                                           '
						+'<tr>                                                                                                                                                                                                                                                            '
						+'  <td bgcolor="#B4B4B4"></td>                                                                                                                                                                                                                                   '
						+'  <td height="20" onmouseover="this.style.backgroundColor=\'#F2F2F2\'" onmouseout="this.style.backgroundColor=\'#FFFFFF\'"><img src="/image/blank.gif" width="5" height="1"><img src="../image/right_img08.gif" width="11" height="11" border="0" align="absmiddle">' 
						+'    <a href="javascript:popUpAddFriend(\'' + id + '\')" class="chat_center_text">친구로 추가</a></td>                                                                                                                         '
						+'  <td bgcolor="#B4B4B4"></td>                                                                                                                                                                                                                                   '
						+'</tr>'
						+'<tr>                                                                                                                                                                                                                                                            '
						+'  <td bgcolor="#B4B4B4"></td>                                                                                                                                                                                                                                   '
						+'  <td height="20" onmouseover="this.style.backgroundColor=\'#F2F2F2\'" onmouseout="this.style.backgroundColor=\'#FFFFFF\'"><img src="/image/blank.gif" width="5" height="1"><img src="../image/right_img18.gif" width="11" height="11" border="0" align="absmiddle">' 
						+'    <a href="javascript:popUpBadFriend(\'' + id + '\')" class="chat_center_text">블랙리스트로 추가</a></td>                                                                                                                         '
						+'  <td bgcolor="#B4B4B4"></td>                                                                                                                                                                                                                                   '
						+'</tr>';         
			html 	+= postTag ; 
			
			return html;

}

//캠 설정
function SetCam()
{
	if(typeof parent.footer.footer != 'undefined' && typeof parent.footer.footer.Updater != 'undefined')
		parent.footer.footer.Updater.SetVideoSrc();

}




function mpop(id)
{
	if (djMenu != null && typeof djMenu != "undefined") {
		
		djMenu.innerHTML = setTag(id);
		setMpop(id );
	}
}

function mpopChatList(id, imdae)
{
	if(id.length == 0)
		return;
		
	if (djMenu != null && typeof djMenu != "undefined") {
		
		if(imdae == 1)
			djMenu.innerHTML = setTagImdae(id);	
		else
			djMenu.innerHTML = setTag(id);
			
		setMpop(id );
	}
}

function mpopChatListWithFriend(id, imdae, roomno)
{
	if (djMenu != null && typeof djMenu != "undefined") {
		
		if(imdae == 1)
			djMenu.innerHTML = setTagImdae(id);	
		else
			djMenu.innerHTML = setTagFollowFriend(id, roomno);
			
		setMpop(id );
	}
}


function mpop4(id, roomid, senderid, x, y, doc)
{
	if (djMenu != null && typeof djMenu != "undefined") {
		
		djMenu.innerHTML = setTag2(id, roomid, senderid);
		setMpop2(id, x,y, doc );
	}
}

function mpop5(id, roomid, senderid, x, y, doc)
{
	
	if (djMenu != null && typeof djMenu != "undefined") {
		djMenu.innerHTML = setTag2(id, roomid, senderid);
		//setMpop(id);
		setMpop2(id, x,y, doc );
	}
}

function mpop3(id, x, y, doc)
{
	if (djMenu != null && typeof djMenu != "undefined") {
		djMenu.innerHTML = setTag3(id);
		setMpop2(id, x,y, doc );
	}
}

function mpop2(id, x, y, doc)
{
	if (djMenu != null && typeof djMenu != "undefined") {
		djMenu.innerHTML = setTag(id);
		setMpop2(id, x,y, doc );
	}
}


function mpop6(id)
{
	if (djMenu != null && typeof djMenu != "undefined") {
		djMenu.innerHTML = setTag4(id);
		setMpop(id);
	}
}




function hideMpop(force)
{
	if(typeof force != "undefined" && force != "") {
		djList.style.visibility = 'hidden';
		return;
	}
	if( djList.componentFromPoint( event.x, event.y ) != '' )
		djList.style.visibility = 'hidden';
}


function setMpop(id) { 
	var IE = document.all?true:false; 

	var tempX = 0; 
	var tempY = 0; 

	if (IE) { 
		tempX = event.clientX + document.body.scrollLeft; 
		//tempY = event.clientY + document.body.scrollTop; 
		tempY = event.clientY+document.documentElement.scrollTop;
	} 
	else 
	{  
		tempX = e.pageX; 
		tempY = e.pageY; 
	}   
	if (tempX < 0){tempX = 0;} 
	if (tempY < 0){tempY = 0;}   
	
	djMenu.style.left = tempX; 
	djMenu.style.top = tempY; 
	djMenu.style.visibility='visible';	
	djMenu.focus();
}

function setMpop2(id, x, y, doc) { 
	var IE = document.all?true:false; 

	var tempX = 0; 
	var tempY = 0; 

	if (IE) { 
		
		tempX = x + doc.body.scrollLeft; 
		tempY = y + doc.body.scrollTop; 
		
	} 
	else 
	{  
		tempX = e.pageX; 
		tempY = e.pageY; 
	}   
	if (tempX < 0){tempX = 0;} 
	if (tempY < 0){tempY = 0;}   
	
	
	
	djMenu.style.left = tempX; 
	djMenu.style.top = tempY; 
	djMenu.style.visibility='visible';	
	djMenu.focus();
}

function setMpopRoom(x, y) { 
	var IE = document.all?true:false; 

	var tempX = 0; 
	var tempY = 0; 

	if (IE) { 
		tempX = eval(x) + document.body.scrollLeft; 
		tempY = eval(y) + document.body.scrollTop; 
	} 
	else 
	{  
		tempX = e.pageX; 
		tempY = e.pageY; 
	}   
	if (tempX < 0){tempX = 0;} 
	if (tempY < 0){tempY = 0;}   
	
	djList.style.left = tempX; 
	djList.style.top = tempY; 
	djList.style.visibility='visible';	
	djList.focus();
	
}

function isOverXPSP2()
{
	  var strVerStr = window.navigator.appVersion;
	  var arrVerStr = strVerStr.split('; ');
	  if (arrVerStr.length >= 4)
	  {
	    // arrOsVer Example
	    // Windows NT 5.1
	    var arrOsVer = arrVerStr[2].split(' ');
	    if (arrOsVer.length >= 3 && arrOsVer[0] == "Windows")
	    {
	      var osVerNum = new Number(arrOsVer[2]);
	      // 새로운 Windows Version 나올때 수정필요
	      if (osVerNum >= 5.1 && strVerStr.indexOf("SV1") >= 35 )
	      {
	        return true;
	      }
	    }
	  }
	
	  return false;
}

/*
resizeTo에서 폭과 높이 숫자는 외부창의 크기 기본적으로 status가 있다고 가정
*/
function resizeToXP(reWidth, reHeight) {
 reWidth += 10;
 if(isOverXPSP2()) {
  reHeight += 58;
 } else {
  reHeight += 49;
 }
 self.resizeTo(reWidth, reHeight);
}

/*
resizeTo에서 폭과 높이 숫자는 외부창의 크기 status 없을 경우
*/
function resizeToXPnostatus(reWidth, reHeight) {
 reWidth += 10;
 if(isOverXPSP2()) {
  reHeight += 48; //reHeight += 58;
 } else {
  reHeight += 29;
 }
 self.resizeTo(reWidth, reHeight);
}


function popUpPolice(id)
{
	w = 398;
	h = 595;
	lp = (screen.width) ? (screen.width-w)/2 : 0;
	tp = (screen.height) ? (screen.height-h)/2 : 0;
	
	if(typeof document.all.virtualFrm == 'undefined')
			makeVirtualForm();
	doc = document.all;
	doc.virtualFrm.id.value = id;
	doc.virtualFrm.target = 'call_police';
	doc.virtualFrm.action = '../police/police.aspx';
	
	var oWin = window.open('','call_police','scrollbars=no,resizable=no,width=' + w + ',height=' + h + ', status=no, top='+tp+',left='+lp);
	try{ oWin.focus(); }catch(Exception){}

	doc.virtualFrm.submit();

}

// 랜트캠 팝업창
function popUpRentcam()
{
	w = 850;
	h = 600;
	lp = (screen.width) ? (screen.width-w)/2 : 0;
	tp = (screen.height) ? (screen.height-h)/2 : 0;
	
	var oWin = window.open('http://www.dakjang.com/XVMMain/rentcam/page1.htm','','scrollbars=yes, resizable=yes,width=' + w + ',height=' + h + ', status=no, top='+tp+',left='+lp);
	try{oWin.focus(); }catch(Exception){}

}


