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=450,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 (input.w_name.value.length == 0) {
		alert('ÀÌ¸§À» ÀÔ·ÂÇÏ¼¼¿ä.');
		input.w_name.focus();
		return (false);
	}
	if (input.w_subject.value.length == 0) {
		alert('Á¦¸ñÀ» ÀÔ·ÂÇÏ¼¼¿ä.');
		input.w_subject.focus();
		return (false);
	}
	if (input.w_pass.value.length == 0) {
		alert('ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä.');
		input.w_pass.focus();
		return (false);
	}
	if (input.use_category.value==1 && input.w_category.value==0){
		alert('Ä«Å×°í¸®¸¦ ¼±ÅÃÇÏ¿© ÁÖ½Ê½Ã¿ä');
		input.w_category.focus();
		return (false);
	}
	if (input.chk_file.value!=0 && !input.write_check.value.length){
		alert('È®ÀÎ ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿ä.');
		input.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 += '<embed src="'+src+'" quality=high bgcolor="#000000" wmode="transparent" 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>';
 	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;
		}
	}
}

var cl=null;
var cl_count=0;
var repeatTimer=null;
function main_concert(){
	lpAjax.open("post","/return_data/concert_list.php",false);
	lpAjax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	lpAjax.onreadystatechange=receiveResponse;
	lpAjax.send();
	
	if(lpAjax.responseText!=null){
		cl=lpAjax.responseText;
		input_main_concert();
	}
}

function input_main_concert(){
	eval("var received="+cl+";");
	if(received!=null && received!=''){
		var tr_value="<table border='0' width='100%' cellspacing='0' cellpadding='0'>";
		tr_value+="<tr><td style='font-weight:bold'><a href='/_info/concert_info.html?type="+received[cl_count].c_type+"&No="+received[cl_count].concert_No+"' style='color:#ffffff'>"+received[cl_count].title+"</a></td></tr>";
		tr_value+="<tr><td style='text-align:right'>"+received[cl_count].concert_date+"</td></tr>";
		tr_value+="<tr><td style='text-align:right'>"+received[cl_count].place+"</td></tr>";
		tr_value+="</table>";
		cl_count++;
		if(cl_count>=received.length) cl_count=0;
		self.document.getElementsByName("main_concert")[0].innerHTML=tr_value;
		repeatTimer=window.setTimeout("input_main_concert()",5000);
	}	
}

