
function chatInputCheck(frm)
{
	if(frm.keyword.value == 'Ã¤ÆÃ¹æ °Ë»ö' || frm.keyword.value=='')
	{
		alert('°Ë»ö¾î¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä');
		frm.keyword.focus();
		return false;
	}
}

// ÄíÅ° »ý¼º ¹× È®ÀÎ
function getCookie(name){
	var nameOfCookie = name + "="; 
	var x = 0; 
	while ( x <= document.cookie.length ){ 
		var y = (x+nameOfCookie.length); 
		if ( document.cookie.substring( x, y ) == nameOfCookie ){ 
			if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 ) 
			endOfCookie = document.cookie.length; 
			return unescape( document.cookie.substring( y, endOfCookie ) ); 
		}
		x = document.cookie.indexOf( " ", x ) + 1; 
		if ( x == 0 ) 
		break; 
	} 
	return ""; 
}

function setCookie(name, value, expiredays){
	var todayDate = new Date();
	todayDate.setDate( todayDate.getDate() + expiredays );
	document.cookie = name+"="+escape( value )+"; path=/;expires="+todayDate.toGMTString()+";"
}

//·¹ÀÌ¾î ¹è³Ê(¿­±â,´Ý±â) ÇÔ¼ö
function divbanner_open(){
	if(getCookie("divbanner") != "no"){
		divbanner.style.display = "block";
	}
}

function divbanner_close(today){
	divbanner.style.display = "none";
	if(today=="today"){
		setCookie("divbanner", "no", 1);
	}
}

function funSetCookie(){
	document.all['alramB'].style.visibility = 'hidden';
	setCookie( 'alramBanner', 'yes', 1 );
}
function setCookie( name, value, expiredays ){
	var todayDate = new Date();
	todayDate.setDate( todayDate.getDate() + expiredays );
	document.cookie = name + '=' + escape( value ) + '; path=/; expires=' + todayDate.toGMTString() + ';'
}

function alramBRC(){	
	// ÃÊ±â Âß ¿Ã¶ó¿À´Â ´À³¦...
	alramB.style.top = document.body.clientHeight;
	alramB.style.left = 0;
	alramB.style.visibility = 'visible';
	SSADMove2();
}

function SSADMove2(){
	var yBannerPos;
	var interval = 30;
	var SetValue = 0;
	var leftMargin = 0;
	yBannerPos = parseInt(alramB.style.top, 10);
	leftMargin = (document.body.clientWidth - 800) / 2
	if(leftMargin < 163) {
		alramB.style.left = leftMargin+document.all('main').offsetWidth-(163-leftMargin);
	}else{
		alramB.style.left = leftMargin+document.all('main').offsetWidth;
	}
	if (yBannerPos > document.body.clientHeight -100){
		SetValue = parseInt(alramB.style.top, 10) - 2;
		alramB.style.top = SetValue;
		setTimeout ('SSADMove2()',interval)
	}
}

function make_win2(src, name, width, height, flag) {
	if (flag) {
		scrollbar_option = 'yes';
	}else {
		scrollbar_option = 'no';
	}
	wid = ( screen.availwidth - width ) / 2;
	hei = ( screen.availheight - height ) / 2;
	retval = window.open(src, name, 'scrollbars=' + scrollbar_option + ', resize=no, width=' + width + ',height=' + height + ',top=' + hei + ',left=' + wid);
	retval.focus();
	return retval;
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
	if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
		document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
	else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

function gomm() { location.href='http://adult.geopia.com'; }
MM_reloadPage(true);

// ¿À¸¥ÂÊ ¹è³Ê ½ºÄÚ·Ñ¸µ º£³Ê
function LlayerRC(){
	document.all('LlayerRD').style.top = 107;
	document.all('LlayerRD').style.left = document.all('main').offsetLeft-105;
	document.all('LlayerRD').style.visibility='visible';
	setTimeout('LlayerRC()',100);
}

// For Windows XP SP2
function browserVersion(){
	var tmp_MSIE = window.navigator.userAgent.indexOf("MSIE");
	if(tmp_MSIE && window.navigator.userAgent.indexOf("SV1") > tmp_MSIE ){
		return true;
	}else{
		return false;
	}
}

function checkControl(){
	var isErr = false;
	try{
		geoLauncher.GeoPopupAllow( "*.geopia.com|*.fian.co.kr|*.loveting.co.kr|*.yes4989.com|*.ance.co.kr|*.infomaster.co.kr" );
	}catch(err){}
}
function isSP2(){
	var xpie_SP2 = browserVersion();
	if(xpie_SP2 == true){
		checkControl();
	}
}
/// For Windows XP SP2 ///

// ÇÁ¸®¹Ì¾ö È¸¿ø Å»Åð º£³Ê ÇÔ¼ö
function funWithdraw(){
	var f = document.withdraw;
	if(confirm("ÇÁ¸®¹Ì¾ö È¸¿øÀ» Å»ÅðÇÏ½Ã°Ú½À´Ï±î?")){	
		f.submit();
	}
}
// ¿À¸¥ÂÊ ½ºÅ©·Ñ º£³Ê //

//Ã¤ÆÃ¹æ°Ë»ö
function _chkForm(frm){
	if(frm.keyword.value == 'Ã¤ÆÃ¹æ °Ë»ö' || frm.keyword.value==''){
		alert('°Ë»ö¾î¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä');
		frm.keyword.focus();
		return 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];}
}

/* XMLHttpRequest ¿¬°á¼³Á¤ ½ÃÀÛ*/
var xmlHttp;
var xmlHttp1;

function createXMLHttpRequest() {
    if (window.ActiveXObject) {
        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    } else if (window.XMLHttpRequest) {
        xmlHttp = new XMLHttpRequest();
    }
}
    
function startRequest(cate1,cate2) {
    createXMLHttpRequest();
    xmlHttp.onreadystatechange = handleStateChange;
	var str = "?cate1="+cate1;
	str += "&cate2="+cate2;
	xmlHttp.open("GET", "../include/main_chat.php"+str, true);
    xmlHttp.send(null);
}

function handleStateChange() {
    if(xmlHttp.readyState == 4) {
        if(xmlHttp.status == 200) {
            document.getElementById("main_chat_list").innerHTML = xmlHttp.responseText;
        }
    }
}

function createXMLHttpRequest1() {
    if (window.ActiveXObject) {
        xmlHttp1 = new ActiveXObject("Microsoft.XMLHTTP");
    } else if (window.XMLHttpRequest) {
        xmlHttp1 = new XMLHttpRequest();
    }
}

function startRequest1(cate1) {
    createXMLHttpRequest1();
    xmlHttp1.onreadystatechange = handleStateChange1;
	var str = "?cate1="+cate1;
	xmlHttp1.open("GET", "../include/main_chat_cate.php"+str, true);
    xmlHttp1.send(null);
}

function handleStateChange1() {
    if(xmlHttp1.readyState == 4) {
        if(xmlHttp1.status == 200) {
            document.getElementById("main_chat_cate2").innerHTML = xmlHttp1.responseText;
        }
    }
}

function make_win(src, name, width, height, flag) {
	if (flag) {
		scrollbar_option = 'yes';
	}else {
		scrollbar_option = 'no';
	}
	retval = window.open(src, name, 'scrollbars=' + scrollbar_option + ', resize=no, width=' + width + ',height=' + height);
	retval.focus();
	return retval;
}

function open_join() {
	return make_win('https://addusrs.geopia.com:448/?vfrom=g','join_win',772,580,true);
	//return make_win('http://addusr.geopia.com/register/join1.ggi','join_win',772,580,true);
}

function open_idpass() {
	//window.open('http://chat.geopia.com/login_pass_01.ggi','login_pass','width=400; height=260')
	return make_win2('http://login.geopia.com/geopia/login_pass_01.ggi','login_pass',400,260,true);	
}	

function open_privacy_policy() {
	return make_win('http://www.geopia.com/privacy/privacy.html', 'private', 597, 650, true);
}

function open_company() {
	return make_win('http://www.geopia.com/company/home.ggi?visitfrom=geo', 'company', 771, 604, true);
}

function open_recruit() {
	return make_win('http://www.geopia.com/company/company4_3.ggi?visitfrom=geo', 'company', 771, 604, true);
}	

function noemailpop(url,width,height){
	wid = ( screen.availwidth - width ) / 2;
	hei = ( screen.availheight - height ) / 2;
	size = 'width=' + width + ',height=' + height + ',top=' + hei + ',left=' + wid;
	etc = size + ',resizable=no,scrollbars=no';
	window.open(url,'noemailpop',etc);
}

function use_agree(){
	noemailpop("http://www.geopia.com/privacy/useAgree.ggi",550,615)
}

function swindC(url,name,width,height){
	wid = ( screen.availwidth - width ) / 2;
	hei = ( screen.availheight - height ) / 2;
	size = 'width=' + width + ',height=' + height + ',top=' + hei + ',left=' + wid;
	etc = size + ',resizable=no,scrollbars=no,status=no';
	window.open(url,name,etc);
}

// Àå¹Ì²É ±¸¸Å ÆË¾÷
function buyRoseOpen(){
	swindC('http://chat.geopia.com/payment/rose/buyRose.php','buyRosePop',550,435);
}

function setCookie(name, value, expiredays){
	var todayDate = new Date();
	todayDate.setDate( todayDate.getDate() + expiredays );
	document.cookie = name+"="+escape( value )+"; path=/;expires="+todayDate.toGMTString()+";"
}

function saveid_func(userid, ip){
	var chk = document.login_form.saveid.checked;

	if(chk == true && userid && ip){
		document.hidden_save.action = 'include/saveid.php';
		document.hidden_save.mode.value = 'save';
		document.hidden_save.save_id.value = userid;
		document.hidden_save.save_ip.value = ip;
	}else{
		document.hidden_save.action = 'include/saveid.php';
		document.hidden_save.mode.value = 'del';
	}
	document.hidden_save.target = 'hidden_frame';
	document.hidden_save.submit();
}

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; }
} 
