/***************************************************************************
 * filename : head.js<br>
 *
 * @version	: 1.0
 * @author	: free270
****************************************************************************/
if(HEAD_CLASS!=null) {
	alert("[head.js] 이미 인클루드되어 있습니다.");
}
var HEAD_CLASS = true;

function init(){
}
function popupEvent(){}
function init_start(){
	init();

	setTimeout("popupEvent();", 2000);	
}


function goHome(){
	document.location = "/";
}

/** For Flash menu interface *************************************************************/
function goMenu(menu1, menu2, menu3, menu4, target){	
	if(menu1 == null){	menu1 = ""	}
	if(menu2 == null){	menu2 = ""	}
	if(menu3 == null){	menu3 = ""	}
	if(menu4 == null){	menu4 = ""	}
	if(target == null){	target = ""	}

	document.location = URL_ROOT + "/gomenu.asp?menu1=" + menu1 + "&menu2=" + menu2 + "&menu3=" + menu3 + "&target=" + target

}
function openFindZip(type){
	if(type==null) type = "";
	//window.open(URL_ROOT + "common/zip/popup_findzip.asp?type=" + type, "popup_findzip", "width=480,height=380");
}
function FFOpen(link, winname, option){
	window.open(link, winname, option); 
	return;
}
function sendMail(from_email, from_name, to_email){

}
function popupPrint(){
	open("/etc/pop_print.asp","print", "width=620,height=500,scrollbars=yes");
}
function limitTextarea(obj, lengthObj){
	if(obj.maxlength == null || obj.maxlength == ""){
		alert("개발시에 maxlength속성값을 주셔야 합니다.\n\n ex) mextlength='100'");
		return true;
	}

	var length = parseInt(obj.maxlength);

	if (obj.value.length > length) {
		msg = "";
		if(obj.title!=null && obj.title!=""){
			msg = obj.title + " 은(는) ";
		}
		msg += "한글 " + length + "자 이내로 입력해주세요\n\n한글 " + length + "자 기준으로 자동으로 잘려집니다.";
		alert(msg);
		obj.value = obj.value.substring(0,length);
		obj.focus();

		if(lengthObj!=null){
			lengthObj.value = parseInt(obj.value.length)
		}
		return false;
	}				

	if(lengthObj!=null){
		lengthObj.value = parseInt(obj.value.length)
	}

	return true;
}	

/*
 * EX) <input type="text" onKeyDown="javascript:if(isEnterDown()){goCommSubmit();}">
 */
function isEnterDown(){
	if(event.keyCode==13){
		return true;
	}else{
		return false;	
	}
}


//popup
function popup(url,w,h) {
	l = (screen.width) ?	(screen.width-550) / 2	: 0;
	t = (screen.height) ?	(screen.height-400) / 2 : 0;	
	var opt='top='+t+',left='+l+',width='+w+',height='+h;
	opt=opt+',toolbar=no,status=no,directories=no,scrollbars=auto,location=no,resizable=no,menubar=no';
	window.open(url,'Content',opt);
}

function popuplo(url,w,h,s) {
	l = (screen.width) ?	(screen.width-550) / 2	: 0;
	t = (screen.height) ?	(screen.height-400) / 2 : 0;	
	var opt='top='+t+',left='+l+',width='+w+',height='+h+',scrollbars='+s;
	opt=opt+',toolbar=no,status=no,directories=no,location=no,resizable=no,menubar=no';
	window.open(url,'Content',opt);
}

function popupsy(url,w,h) {
	l = (screen.width) ?	(screen.width-550) / 2	: 0;
	t = (screen.height) ?	(screen.height-400) / 2 : 0;	
	var opt='top='+t+',left='+l+',width='+w+',height='+h;
	opt=opt+',toolbar=no,status=no,directories=no,scrollbars=yes,location=no,resizable=no,menubar=no';
	window.open(url,'Content',opt);
}


function gotop(){
	scroll(0,0);
}

function gu(){
	scroll(0,646);
}
function gu1(){
	setTimeout(gu,2000);
}



function gudo(){
	scroll(0,1049);
}
function gudo1(){
	setTimeout(gudo,2000);
}


function gusu(){
	scroll(0,1420);
}
function gusu1(){
	setTimeout(gusu,2000);
}

function eff(){
	scroll(0,3830);
}
function eff1(){
	setTimeout(eff,2000);
}

/* 정기/수시 공시를 클릭하여 해당페이지로 링크될때 페이지뷰 카운트를 증가 시킨다 */
function goIRLink(sBbs_id, sSeq_id, goUrl){
	var url = "/board/actViewCount.asp?sBbs_id=" + sBbs_id + "&sSeq_id=" + sSeq_id
	callXml(url)
	open(goUrl,"","");
	//location.reload();
}