// JavaScript Document
<!-- <META http-equiv="Content-Type" content="text/html; charset=euc-kr"> -->

/* [ ¼Ò½ºº¸±â ¹æÁö ½ºÅ©¸³Æ® : added 200708091850 */
	// 0 - all
	// 1 - oncontextmenu
	var lockmode = 1;
	function lockpage(){
		document.oncontextmenu=new Function("return false");
		if(lockmode == 0){
			document.onselectstart=new Function("return false");
			document.ondragstart=new Function("return false");
		}
	}
	function start_locktimer(){ 
		var locktime = new Date(); 
		lockhours = locktime.getHours(); 
		lockmins = locktime.getMinutes(); 
		locksecs = locktime.getSeconds(); 
		lockcloseTime = lockhours * 3600 + lockmins * 60 + locksecs; 
		lockcloseTime += 1;  // This number is how long the window stays open 
		locktimer();
	} 
	function locktimer(){
		lockpage();
		var locktime = new Date(); 
		lockhours = locktime.getHours(); 
		lockmins = locktime.getMinutes(); 
		locksecs = locktime.getSeconds(); 
		lockcurTime =lockhours * 3600 + lockmins * 60 + locksecs 
		if (lockcurTime >= lockcloseTime){start_locktimer();} 
		else{window.setTimeout("locktimer()",250)} 
	}
	start_locktimer();
/* ] ¼Ò½ºº¸±â ¹æÁö ½ºÅ©¸³Æ® */

function autosize(){ // iframe »çÀÌÁî ÀÚµ¿ Á¶Àý
	var h = document.body.scrollHeight + 10;
	var w = document.body.scrollWidth;
	self.resizeTo(w , h);
}

function check_instring(str, chrs){
	var pattern = new RegExp("[" + chrs + "]","");
	return (str.match(pattern) != null);
}

function check_outstring(str, chrs){
	var pattern = new RegExp("[^" + chrs + "]","");
	return (str.match(pattern) != null);
}

/*
function check_instring(str){
	// ¹®ÀÚ 0123456789- Áß ÇÏ³ª¶óµµ ÀÖ´Â°¡?
	return (str.match(/[0123456789-]/) != null);
//	¾Æ·¡¿Í µ¿ÀÏÇÔ
//	var pattern = new RegExp("[0123456789-]","");
//	return (str.match(pattern) != null);
}

function check_outstring(str){
	// 0123456789- ÀÌ¿ÜÀÇ ¹®ÀÚ°¡ ÇÏ³ª¶óµµ ÀÖ´Â°¡?
	return (str.match(/[^0123456789-]/) != null);
//	¾Æ·¡¿Í µ¿ÀÏÇÔ
//	var pattern = new RegExp("[^0123456789-]","");
//	return (str.match(pattern) != null);
}
*/

function check_emailformat(str){
	var src = vb_trim(str);  // ÁÂ¿ì °ø¹é Á¦°Å
	
	// @ °Ë»ç
	var at= vb_instr(src,"@");
	if(at <= 1) return "@<=1"; // ¾ø°Å³ª Ã¹ÀÚ°¡ @ ÀÎ °æ¿ì
	// . °Ë»ç
	var period = vb_instr(src,".");
	if(period <= 1) return ".<=1";	// ¾ø°Å³ª Ã¹ÀÚ°¡ . ÀÎ °æ¿ì
	if(period == vb_len(src)) return ".==(last)";	// ³¡ÀÚ°¡ . ÀÎ °æ¿ì
	// @, . ±âº» ¼ø¼­ °Ë»ç
	if(at > period) return "@>.";	// @ °¡ . ÀÌÈÄ¿¡ ³ª¿À´Â °æ¿ì
	// @@ °Ë»ç
	var n = vb_instr(src,"@@");
	if(n!=0) return "@@";
	// .. °Ë»ç
	n = vb_instr(src,"..");
	if(n!=0) return "..";
	// @. °Ë»ç
	n = vb_instr(src,"@.");
	if(n!=0) return "@.";
	// " " °Ë»ç
	n = vb_instr(src," ");
	if(n!=0) return "(space)";
	// ³¡ºÎºÐ ºñ ¿µ¹®ÀÚ °Ë»ç
	n = vb_instrrev(src,".");
	var left = vb_mid(src, n+1);
	if(left.match(/[^A-Z]/gi) != null) return "last chr : not eng";

	return null;
}

// mouse roll over
function over_cell(cell, color){	cell.style.backgroundColor=color}
function outover_cell(cell,color){	cell.style.backgroundColor=color}

function ImageOver(obj) {obj.src = obj.src.replace('OFF.gif','ON.gif');}
function ImageOut(obj) {obj.src = obj.src.replace('ON.gif','OFF.gif');}

// added 20070806 get file information
function get_width(filepath){
	var tmp = new Image();
	tmp.src = filepath;
	return tmp.width;
}
function get_height(filepath){
	var tmp = new Image();
	tmp.src = filepath;
	return tmp.height;
}
function get_filesize(filepath){
	var tmp = new Image();
	tmp.src = filepath;
	return tmp.fileSize;
}

function get_sizecheck(filepath, limitsize){
	var tmp = new Image();
	tmp.onLoad = img_Load(limitsize);
	tmp.src = filepath;
}
function img_Load(limitsize){
	var imgSrc, imgWidth, imgHeight, imgFileSize;
	imgSrc = this.src; imgWidth = this.width; imgHeight = this.height; imgFileSize = this.fileSize;
	if (imgSrc == "" || imgWidth <= 0 || imgHeight <= 0){return 1;}  // alert('±×¸²ÆÄÀÏÀ» °¡Á®¿Ã ¼ö ¾ø½À´Ï´Ù.');
	if (imgFileSize > limitsize){return 2;} // alert('¼±ÅÃÇÏ½Å ±×¸² ÆÄÀÏÀº Çã¿ë ÃÖ´ëÅ©±âÀÎ ' + maxFileSize/1024 + ' KB ¸¦ ÃÊ°úÇÏ¿´½À´Ï´Ù.');
	return 0;
}

// added 20070806
function objectid(id){return document.getElementById(id);}
function objectname(name){return document.getElementsByName(name);}
