function createAjax(){
	if(typeof(ActiveXObject)=="function"){
		return new ActiveXObject("Microsoft.XMLHTTP");
	}else if(typeof(XMLHttpRequest)=="object" || typeof(XMLHttpRequest)=="function"){
		return new XMLHttpRequest();	
	}else{
		self.alert("À¥ ºê¶ó¿ìÀú¸¦ ¾÷±×·¹ÀÌµå ÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.");
		return null;
	}
}
function receiveResponse(){
	if(lpAjax.readyState==4 && lpAjax.status==200){
		responseText=lpAjax.responseText;
	}
}
function receiveResponse(){
	if(lpAjax.readyState==4 && lpAjax.status==200){
		responseText=lpAjax.responseText;
	}
}	
lpAjax=createAjax();

function idcheck(){
	var tmp=self.document.getElementsByName("id")[0].value;
	var actURI=self.document.getElementsByName("acturi")[0].value;
	
	for (i = 0; i < tmp.length; i++) {
		if (!((tmp.charAt(i) >= '0' && tmp.charAt(i) <= '9') ||(tmp.charAt(i) >= 'a' && tmp.charAt(i) <= 'z') || (tmp.charAt(i) >= 'A' && tmp.charAt(i) <= 'Z'))){
			alert('ID¿¡´Â ¿µ¹®ÀÚ, ¼ýÀÚ¸¸ »ç¿ëÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.');
			self.document.getElementsByName("id")[0].value = '' ;
			self.document.getElementsByName("id")[0].focus();
			return false;
		}
	}
	if (tmp.length < 4 || tmp.length > 12) {
		alert('ID´Â 4±ÛÀÚ ÀÌ»ó, 12±ÛÀÚ ÀÌÇÏÀÔ´Ï´Ù.');
		self.document.getElementsByName("id")[0].value = '' ;
		self.document.getElementsByName("id")[0].focus();
		return false;
	}
	
	lpAjax.open("post",actURI+"return_data/id_check.php",false);
	lpAjax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	lpAjax.onreadystatechange=receiveResponse;
	lpAjax.send("chk_id="+self.document.getElementsByName("id")[0].value);
	return lpAjax.responseText;
}

function post(form){
	var actURI=self.document.getElementsByName("acturi")[0].value;
	window.open(actURI+'zipcode.php?form='+form,'ZipWin', 'width=400,height=300,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
}

function login_check_submit(){
	if (!login.login_id.value) {
		alert('¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ¼¼¿ä.');
		login.login_id.focus();
		return false;
	}
	if (!login.login_pass.value) {
		alert('ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä.');
		login.login_pass.focus();
		return false;
	}
	return (true);
}
	
function onSubmit(){
	if (write.w_name.value.length == 0) {
		alert('ÀÌ¸§À» ÀÔ·ÂÇÏ¼¼¿ä.');
		write.w_name.focus();
		return (false);
	}
	if (write.w_subject.value.length == 0) {
		alert('Á¦¸ñÀ» ÀÔ·ÂÇÏ¼¼¿ä.');
		write.w_subject.focus();
		return (false);
	}
	if (write.w_pass.value.length == 0) {
		alert('ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä.');
		write.w_pass.focus();
		return (false);
	}
	if (write.use_category.value==1 && write.w_category.value==0){
		alert('Ä«Å×°í¸®¸¦ ¼±ÅÃÇÏ¿© ÁÖ½Ê½Ã¿ä');
		write.w_category.focus();
		return (false);
	}
	if (write.chk_file.value!=0 && !write.write_check.value.length){
		alert('È®ÀÎ ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿ä.');
		write.write_check.focus();
		return (false);
	}
	document.loading_check.check.value=1;
	show_waiting();
	return (true);
}

function unlock(){
	loading_check.check.value=0;
}

function show_waiting(){
	var _y = document.body.clientHeight/2 + document.body.scrollTop -44;
	var _x = document.body.clientWidth;

	lp_waiting.style.posTop=_y;
	lp_waiting.style.width=_x;
	lp_waiting.style.visibility='visible';
}

function hide_waiting(){
	lp_waiting.style.visibility='hidden';
	loading_check.check.value=0;
}

var farwindow=null;
function image_zoom(img_name) {
	farwindow=window.open('', 'LinksRemote', 'width=100, height=100, toolbar=no, status=no, scrollbars=yes, resizable=no');
	if(farwindow != null) {
		if(farwindow.opener == null) {
			farwindow.opener=self;
		}
		farwindow.location.href="images_zoom.php?image="+img_name;
	}
}

function arrange(){
	var check="";
	for(i=0;i<document.list.length;i++){
		if(document.list[i].checked) check=check+"|"+document.list[i].value;
	}
	if(check.length<1) alert ("°Ô½Ã¹°À» ¼±ÅÃÇØ ÁÖ½Ê½Ã¿ä");
	else{
		farwindow=window.open('', 'LinksRemote', 'width=300, height=200, toolbar=no, status=no, scrollbars=no, resizable=no');
		if(farwindow != null) {
			if(farwindow.opener == null) {
				farwindow.opener=self;
			}
			farwindow.location.href="arrange.php?id="+document.list.id.value+"&chk_text="+check;
		}
	}
}

function new_open(go,win_type){
	window.open(go,win_type, 'width=300,height=400,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no');
}

function AntiSpam(id,lp_url){
	window.open(lp_url+'antispam/antispamin.php?UniqId='+id,'AntiSpam','width=180,height=263,left=1,top=1');
}


function flash_add(src,w,h){
	html = '';
	html += '<object type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="param" width="'+w+'" height="'+h+'">';
	html += '<param name="movie" value="'+src+'">';
	html += '<param name="quality" value="high">';
	html += '<param name="bgcolor" value="#ffffff">';
 	html += '<param name="menu" value="false">';
 	html += '<param name=wmode value="transparent">';
 	html += '<param name="swliveconnect" value="true">';
 	html += '<embed src="'+src+'" quality=high bgcolor="#ffffff" menu="false" width="'+w+'" height="'+h+'" swliveconnect="true" id="param" name="param" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>';
 	html += '</object>';
 	document.write(html);
 }

function checked_all(){
	obj_no=document.getElementsByName("conf_no").length;
	if(obj_no==1){
		if(list.conf_no.checked) list.conf_no.checked=false;
		else list.conf_no.checked=true;
	}else{
		for(i=0;i<obj_no;i++){
			if(list.conf_no[i].checked) list.conf_no[i].checked=false;
			else list.conf_no[i].checked=true;
		}
	}
}