function trim(str) {
	if( !str )  return '';
   return str.replace(/^\s*|\s*$/g,'');
}

function checkEmail (emailStr) {
	var checkTLD=1 ;
	var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/ ;
	var emailPat=/^(.+)@(.+)$/ ;
	var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]" ;
	var validChars="\[^\\s" + specialChars + "\]" ;
	var quotedUser="(\"[^\"]*\")" ;
	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/ ;
	var atom=validChars + '+' ;
	var word="(" + atom + "|" + quotedUser + ")" ;
	var userPat=new RegExp("^" + word + "(\\." + word + ")*$") ;
	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$") ;
	var matchArray=emailStr.match(emailPat) ;

	if (matchArray==null) {
		alert("E-mailÀÌ Çü½Ä¿¡ ¸ÂÁö ¾Ê½À´Ï´Ù. ¿¹) ¾ÆÀÌµð@host.co.kr") ;
		return false ;
	}
	var user=matchArray[1] ;
	var domain=matchArray[2] ;

	// Start by checking that only basic ASCII characters are in the strings (0-127).

	for (i=0; i<user.length; i++) {
		if (user.charCodeAt(i)>127) {
			alert("ÀÌ¸ÞÀÏÀ» Á¤È®È÷ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.") ;
			return false ;
	   }
	}
	for (i=0; i<domain.length; i++) {
		if (domain.charCodeAt(i)>127) {
			alert("ÀÌ¸ÞÀÏÀ» Á¤È®È÷ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.") ;
			return false ;
	   }
	}

	// See if "user" is valid 

	if (user.match(userPat)==null) {

	// user is not valid
		alert("ÀÌ¸ÞÀÏÀ» Á¤È®È÷ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.") ;
		return false ;
	}

	var IPArray=domain.match(ipDomainPat) ;
	if (IPArray!=null) {
		// this is an IP address

		for (var i=1;i<=4;i++) {
			if (IPArray[i]>255) {
				alert("Àß¸øµÈ IP ÁÖ¼ÒÀÔ´Ï´Ù.") ;
				return false ;
		   }
		}
		return true ;
	}

	// Domain is symbolic name.  Check if it's valid.

	var atomPat=new RegExp("^" + atom + "$") ;
	var domArr=domain.split(".") ;
	var len=domArr.length ;
	for (i=0;i<len;i++) {
		if (domArr[i].search(atomPat)==-1) {
			alert("ÀÌ¸ÞÀÏÀ» Á¤È®È÷ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.") ;
			return false ;
		}
	}
	
	if (checkTLD && domArr[domArr.length-1].length!=2 && domArr[domArr.length-1].search(knownDomsPat)==-1) {
		alert("ÀÌ¸ÞÀÏÀ» Á¤È®È÷ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.") ;
		return false ;
	}

	// Make sure there's a host name preceding the domain.

	if (len<2) {
		alert("ÀÌ¸ÞÀÏÀ» Á¤È®È÷ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.") ;
		return false ;
	}

	// If we've gotten this far, everything's valid!
	return true;
}

function openSimpleWindow(url, name, w, h) {
	var url, name, w, h;
	Pop_Pos(w,h,0,0);
	if (isOverXPSP2() != 0){h = h + 24;}
    window.open(url, name, 'scrollbars=no, statusbar=no, status=no, width='+w+', height='+h+', resizable=yes');
}

function openSimpleScrolledWindow(url, name, w, h) {
	var url, name, w, h;
	Pop_Pos(w,h,0,0);
	if (isOverXPSP2() != 0){h = h + 24;}
    window.open(url, name, 'scrollbars=yes, statusbar=no, status=no, width='+w+', height='+h+', resizable=yes');		
}

function openWindow(url, name, w, h, t, l) {
	var url, name, w, h, t, l;
	Pop_Pos(w,h,0,0);
	if (isOverXPSP2() != 0){h = h + 24;}
    window.open(url, name, 'scrollbars=no, statusbar=no, status=no, width='+w+', height='+h+', top='+TopPosition+', left='+LeftPosition+', resizable=yes');
}

function openScrolledWindow(url, name, w, h, t, l) {
	var url, name, w, h, t, l;
	Pop_Pos(w,h,0,0);
	if (isOverXPSP2() != 0){h = h + 24;}
    window.open(url, name, 'scrollbars=yes, statusbar=no, status=no, width='+w+', height='+h+', top='+TopPosition+', left='+LeftPosition+', resizable=yes');
}

function openModelessDialog(url, w, h, t, l) {
	var url, w, h, t, l;
	Pop_Pos(w,h,t,l);
	if (isOverXPSP2() != 0){h = h + 24;}
	window.showModelessDialog(url, window, "dialogHeight: "+h+"px; dialogWidth: "+w+"px; dialogTop: "+TopPosition+"px; dialogLeft: "+LeftPosition+"px; edge: Sunken; center: Yes; help: No; resizable: No; status: No; scroll: Yes;") ;
}

// search a target in selectBox and make it selected.
function findAndSelect(sel, value) {
	var opt = sel.options;
	var size = opt.length;
	
	for (var fi=0; fi<size; fi++) {
		if (opt[fi].value == value) {
			opt.selectedIndex = fi;
			break;
		}
	}
}

// check whether check/radio box is selected.
function isBoxSelected(sel) {
	// if it's not array
	if (!sel.length) {
		if (sel.checked) return true;
		else return false;
	} else {
		var cnt = 0;
		for (i=0; i<sel.length; i++)
			if (sel[i].checked) cnt++;
		if (cnt > 0) return true;
		else return false;
	}
}

// check whether all check/radio box is selected.
function isBoxAllSelected(sel) {
	// if it's not array
	if (!sel.length) {
		if (sel.checked) return true;
		else return false;
	} else {
		var cnt = 0;
		for (i=0; i<sel.length; i++)
			if (sel[i].checked) cnt++;
		if (cnt == sel.length) return true;
		else return false;
	}
}

function onlyNumber() {
    if (window.event.keyCode < 48 || window.event.keyCode > 57) {
        window.event.keyCode = 0 ;
    }
}

function NumberCheck2(obj){
	if(!isNumerics(obj.value)){
		alert('¼ýÀÚ¸¸ ÀÔ·ÂÇÒ ¼ö ÀÖ½À´Ï´Ù.');
		obj.value = "";
	}
}

function isNumerics(str) {
  	var checkStr = str;
  	var checkOK = "0123456789";
  	var isnumeric = false;

	for (i = 0;  i < checkStr.length;  i++) {
		ch = checkStr.charAt(i);

		isnumeric = false;
		for (j = 0;  j < checkOK.length;  j++) {
			if (ch == checkOK.charAt(j)) {
        		isnumeric = true;
			}
		}

		if (isnumeric == false) {
    		return false;
		}
	}
	return true;
}

function ChangeParameter(obj){
	var addstr;
	var RealURL	= location.href; 
	var strURL	= RealURL.toLowerCase();
	var s;
	var e;
	var column = obj.name;
	var value	 = obj.value;

	//ÆÄ¶ó¸ÞÅ¸°¡ ¾øÀ¸¸é
	if(strURL.indexOf(column.toLowerCase()+"=")==-1){
		RealURL = AddParameter(RealURL,column+"="+value);
	}else{
		s = strURL.indexOf(column.toLowerCase()+"=");
		e = strURL.indexOf("&",s)==-1?strURL.length:strURL.indexOf("&",s);
		RealURL = RealURL.replace(RealURL.substring(s,e),column+"="+value);
	}

	//gotopage ÆÄ¶ó¸ÞÅ¸¸¦ »èÁ¦ÇÑ´Ù
	if(strURL.indexOf("gotopage=")!=-1){
		s = strURL.indexOf("gotopage=");
		e = strURL.indexOf("&",s)==-1?strURL.length:strURL.indexOf("&",s)+1;
		RealURL = RealURL.replace(RealURL.substring(s,e),"");
	}

	location.href=RealURL;
}

function AddParameter(str,p){
	if(str.indexOf("?")==-1){
		str += "?"+p;
	}else{
		str += "&"+p;
	}
	return str;
}

function swf(src,w,h) {
	html = '';
	html += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" 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" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="'+w+'" height="'+h+'"><\/embed>';
	html += '<\/object>';
	document.write(html);
}

function fnfocus(f) {
	var f;
	if (f.value == "")
		f.focus();
}

function fnfocus2(f) {
	var f;
	if (f.value == "")
		f.focus();
	else {
		f.select();
		f.focus();
	}
}

function aFocus(f) {
	var f;
	f.style.background = "";
	if (f.value == "") {
		f.focus() ;
	}
	return ;
}

function bgClear(f) {
	var f;
	f.style.background = "#FFFFFF" ;
	return ;
}

function bgClear2(f,bg) {
	var f,bg;
	f.style.background = bg ;
	return ;
}

function fnNextFocus(obj, inum, tName) {
	var obj, inum, tName ;
	if (obj.value.length == inum)
		eval(tName + ".focus()") ;
}

function fnReset(f) {
	var f;
	f.reset();
}

//ÆË¾÷ À§Ä¡
function Pop_Pos(W,H,T,L) {
	var W,H,T,L ;
	if (T == 0 && L == 0) {
		TopPosition		= T ;
		LeftPosition	= L ;
		
	} else {
		if (screen.width < 1025){
			TopPosition		= T ;
			LeftPosition	= L ;
			
		} else {
			TopPosition=(screen.height)?(screen.height-H)/2:100 ;
			LeftPosition=(screen.width)?(screen.width-W)/2:100 ;
		}
	}
}

function isOverXPSP2() { 
	var arrVerStr = window.navigator.appVersion.split('; ');    
	if( arrVerStr.length >= 4 ) {
	
		var arrOsVer = arrVerStr[2].split(' ');
		if( arrOsVer.length >= 3 && arrOsVer[0] == "Windows" ) {
			var osVerNum = new Number(arrOsVer[2]);
			if( osVerNum >= 5.1 && arrVerStr[3].indexOf("SV1") >= 0 ) // »õ·Î¿î Windows Version ³ª¿Ã¶§ ¼öÁ¤ÇÊ¿ä
				return true;
		}
	}
	return false;
}

function isOverIEVer7() {
	var arrVerStr = window.navigator.appVersion.split('; ');    
	var arrIEVer = arrVerStr[1].split(' ');
	var arrOsVer = arrVerStr[2].split(' ');
	
	if( arrIEVer.length >= 2 && arrOsVer[0] == "Windows" ) {
		var ieVerNum = new Number(arrIEVer[1]);
		if( ieVerNum >= 7.0 )
			return true;
	}
	return false;
}

function Copy2Name(val) {
	var val;
	val.value = frmSch.KeyWd.value;
}

function OpenLayer(Layer, LayerFrame, URL) {
	var Layer, LayerFrame, URL, strX, strY;
	layerObj = document.getElementById(Layer);
	this.layerObj.style.left = (screen.width)/4;
    this.layerObj.style.top  = (screen.height)/4 + (document.body.scrollTop);
	this.layerObj.style.display = "";
	this.layerObj.style.visibility = "visible";
	
	if (LayerFrame != "") {
		LayerFrame.location.href = URL;
	}
}

function OpenLayerClose(Layer) {
	var Layer;
	Layer.style.display = "none";
}

// ·¹ÀÌ¾î¿¡ »ç¿ë(´Þ·Â)
function hideSelectList() {
    var obj;
    for( $i=0; $i<10; $i++ ) {
        obj = document.getElementById( "selectList"+$i );
        if( obj ) obj.style.visibility = "hidden";
    }
}

function showSelectList() {
    var obj;
    for( $i=0; $i<10; $i++ ) {
        obj = document.getElementById( "selectList"+$i );
        if( obj ) obj.style.visibility = "visible";
    }
}

function getCookie(name) { 
	var Found = false 
	var start, end 
	var i = 0 

	// cookie ¹®ÀÚ¿­ ÀüÃ¼¸¦ °Ë»ö 
	while(i <= document.cookie.length) { 
		start = i 
		end = start + name.length 
		// name°ú µ¿ÀÏÇÑ ¹®ÀÚ°¡ ÀÖ´Ù¸é 
		if(document.cookie.substring(start, end) == name) { 
			Found = true 
			break 
		}
		i++ 
	}

	// name ¹®ÀÚ¿­À» cookie¿¡¼­ Ã£¾Ò´Ù¸é 
	if(Found == true) { 
		start = end + 1 
		end = document.cookie.indexOf(";", start) 
       	// ¸¶Áö¸· ºÎºÐÀÌ¶ó´Â °ÍÀ» ÀÇ¹Ì(¸¶Áö¸·¿¡´Â ";"°¡ ¾ø´Ù) 
       	if(end < start) 
           	end = document.cookie.length 
			// name¿¡ ÇØ´çÇÏ´Â value°ªÀ» ÃßÃâÇÏ¿© ¸®ÅÏÇÑ´Ù. 
		return document.cookie.substring(start, end) 
	} 
	// Ã£Áö ¸øÇß´Ù¸é 
	return "" 
}

function setCookie(name, value, expiredays)	{
	var expire_date = new Date();
	expire_date.setDate(expire_date.getDate() + expiredays );
	document.cookie = name + "=" + escape( value ) + "; expires=" + expire_date.toGMTString() + "; path=/";
}

function fnSubmit(frm) {
	var frm ;
	frm.submit() ;
}

//½ºÆ®¸®¹Ö, È­¸é Å°¿î °Í
/*
function obj_wmv(src,l,t,w,h) {
	html = '';
	html += '<object id="edu_player" name="edu_player" classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6"';
	html += 'standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject" style="position:absolute; left:'+ l +'px; top:'+ t +'px; width:'+ w +'; height:'+ h +';">';
	html += '<param name="URL" value="'+src+'">';
	html += '<param name="autoStart" value="true">';
	html += '<param name="balance" value="1">';
	html += '<param name="enableContextMenu" value="false">';
	html += '<param name="enabled" value="true">';
	html += '<param name="ShowControls" value="TRUE">';
	html += '<param name="fullScreen" value="0">';
	html += '<param name="invokeURLs" value="true">';
	html += '<param name="mute" value="false">';
	html += '<param name="rate" value="false">';
	html += '<param name="stretchToFit" value="1">';
	html += '<param name="volume" value="80">';
	html += '<param name="uiMode" value="full">';
	html += '<param name="SAMIFileName" value="false">';
	html += '<param name="SAMILang" value="false">';
	html += '<param name="SAMIStyle" value="false">';
	html += '<\/object>';
	document.write(html);
}
*/

function obj_wmv(div,src,l,t,w,h,a,b,sr) {
	var div,src,l,t,w,h,a,b,sr;

	html = '';
	html += '<object id="edu_player" name="edu_player" classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" ';
	html += '	standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject" style="position:absolute; left:'+ l +'px; top:'+ t +'px; width:'+ w +'; height:'+ h +';">';
	html += '	<param name="URL" value="/inc/Player_ASX.asp?VOD_URL='+ src +'&A='+ a +'&B='+ b +'&Div='+ div +'&SR='+ sr +'">';
	html += '	<param name="autoStart" value="true">';
	html += '	<param name="balance" value="1">';
	html += '	<param name="enableContextMenu" value="false">';
	html += '	<param name="enabled" value="true">';
	html += '	<param name="ShowControls" value="true">';
	html += '	<param name="fullScreen" value="0">';
	html += '	<param name="invokeURLs" value="true">';
	html += '	<param name="mute" value="false">';
	html += '	<param name="rate" value="false">';
	html += '	<param name="stretchToFit" value="1">';
	html += '	<param name="volume" value="80">';
	html += '	<param name="uiMode" value="full">';
	html += '	<param name="SAMIFileName" value="false">';
	html += '	<param name="SAMILang" value="false">';
	html += '	<param name="SAMIStyle" value="false">';
	html += '<\/object>';
	document.write(html);
}

function obj_wmv2(src,l,t) {
	html = '';
	html += '<object classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" id="edu_player" left:'+l+'px; top:'+t+'px; width:630px; height:390px;" TYPE="application/x-oleobject" 	STANDBY="Microsoft Windows Media Player ±¸¼º¿ä¼Ò¸¦ ÀÐ´ÂÁßÀÔ´Ï´Ù.">';
	html += '	<param name="URL" value="'+src+'">';
	html += '	<param NAME="AutoSize" value="true">';
	html += '	<param NAME="AutoStart" value="true">';
	html += '	<param NAME="Balance" value="0">';
	html += '	<param NAME="BufferingTime" value="5">';
	html += '	<param NAME="stretchToFit" value="1">';
	html += '	<param NAME="EnableContextMenu" value="false">';
	html += '<\/object>';
	document.write(html);
}

//Player Speed
function obj_controller() {
	html = '';
	html += '<object id="MagicController" classid="clsid:BDD22343-1DF0-4983-947F-7604DD9838F8" width=0 height=0 "';
	html += '	codebase="/movie/MagicSpeeder.cab#Version=2,0,4,8">';
	html += '<\/object>';
	document.write(html);
}

//Player Minimize
function obj_min() {
	html = '';
	html += '<object id=min type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">';
	html += '	<param name="Command" value="Minimize"> ';
	html += '<\/object>';
	document.write(html);
}

//Sample Player
function SamplePlayer(a,b,c,d,cp) {
	var a,b,c,d,cp ;
	window.open("http://www.kyohak.co.kr/movie/player_v1/?A=" + a + "&B=" + b + "&SType=" + c + "&SR=" + d + "&CP=" + cp, "SP", "width=983, height=675, top=0, left=0, resizable=no, status=yes") ;
}

function SamplePlayer_V1_wildm(a,b,c,d,cp) {
	var str,LastLec,a,b ;
	strPlayer = window.open("http://www.wildm.net/movie/player_v1.5/?A=" + a + "&B=" + b + "&SType=" + c + "&SR=" + d + "&CP=" + cp, "SP", "width=995, height=675, top=0, left=0, resizable=no, status=yes");
}

function SamplePlayer_V2(a,b,c,d,cp) {
	var a,b,c,d,cp ;
	window.open("http://www.kyohak.co.kr/movie/player_v2/?A=" + a + "&B=" + b + "&SType=" + c + "&SR=" + d + "&CP=" + cp, "SP", "width=995, height=675, top=0, left=0, resizable=no, status=yes");
}

function SamplePlayer_V3(a,b,c,d,cp) {
	var a,b,c,d,cp ;
	window.open("http://www.kyohak.co.kr/movie/player_v3/?A=" + a + "&B=" + b + "&SType=" + c + "&SR=" + d + "&CP=" + cp, "SP", "width=995, height=675, top=0, left=0, resizable=no, status=yes");
}

function SamplePlayer_V4(a,b,c,d,cp,strWide) {
	var a,b,c,d,cp,strWide;
	window.open("http://www.kyohak.co.kr/movie/player_v4/?A=" + a + "&B=" + b + "&SType=" + c + "&SR=" + d + "&CP=" + cp + "&strWide=" + strWide, "SP", "width=995, height=675, top=0, left=0, resizable=no, status=yes");
}

var strPlayer ;	//ÇÃ·¡ÀÌ¾î Àü¿ªº¯¼ö ¼±¾ð

//Player
function Player(str,LastLec,a,b) {
	var str,LastLec,a,b ;
	strPlayer = window.open("http://www.kyohak.co.kr/movie/player_v1/?DataSRC=" + str + "&CMark=" + LastLec + "&SType=" + a + "&SR=" + b, "KHPlayer", "width=983, height=675, top=0, left=0, resizable=no, status=yes") ;
}

function Player_V1_kyohak(str,LastLec,a,b) {
	var str,LastLec,a,b ;
	strPlayer = window.open("http://www.kyohak.co.kr/movie/player_v1/?DataSRC=" + str + "&CMark=" + LastLec + "&SType=" + a + "&SR=" + b, "KHPlayer", "width=995, height=675, top=0, left=0, resizable=no, status=yes");
}

function Player_V1_wildm(str,LastLec,a,b) {
	var str,LastLec,a,b ;
	strPlayer = window.open("http://www.wildm.net/movie/player_v1.5/?DataSRC=" + str + "&CMark=" + LastLec + "&SType=" + a + "&SR=" + b, "KHPlayer", "width=995, height=675, top=0, left=0, resizable=no, status=yes");
}

function Player_V2(str,LastLec,a,b) {
	var str,LastLec,a,b ;
	strPlayer = window.open("http://www.kyohak.co.kr/movie/player_v2/?DataSRC=" + str + "&CMark=" + LastLec + "&SType=" + a + "&SR=" + b, "KHPlayer", "width=995, height=675, top=0, left=0, resizable=no, status=yes");
}

function Player_V3_wildm(str,LastLec,a,b) {	//Å¸ÀÌÆ² ºÐ¸®
	var str,LastLec,a,b ;
	strPlayer = window.open("http://www.wildm.net/movie/player_v3/?DataSRC=" + str + "&CMark=" + LastLec + "&SType=" + a + "&SR=" + b, "KHPlayer", "width=995, height=675, top=0, left=0, resizable=no, status=yes");
}

function Player_V3_kyohak(str,LastLec,a,b) { //Å¸ÀÌÆ² ºÐ¸®
	var str,LastLec,a,b ;
	strPlayer = window.open("http://www.kyohak.co.kr/movie/player_v3/?DataSRC=" + str + "&CMark=" + LastLec + "&SType=" + a + "&SR=" + b, "KHPlayer", "width=995, height=675, top=0, left=0, resizable=no, status=yes");
}

function Player_V4_kyohak(str,LastLec,a,b) {
	var str,LastLec,a,b ;
	strPlayer = window.open("http://www.kyohak.co.kr/movie/player_v4/?DataSRC=" + str + "&CMark=" + LastLec + "&SType=" + a + "&SR=" + b, "KHPlayer", "width=995, height=675, top=0, left=0, resizable=no, status=yes");
}

function iBlink() {
	var blink = document.all.tags("BLINK") ;
	for (var i=0; i < blink.length; i++)
		blink[i].style.visibility = blink[i].style.visibility == "" ? "hidden" : ""
}

function sBlink() {
	if (document.all)
		setInterval("iBlink()",1000);
}
window.onload = sBlink ;

function F5keydown() {
	if(event.keyCode== 116) {
		window.event.keyCode = "";
		location.reload();
		return false;
	}
}
document.onkeydown = F5keydown;

function getBrowser() {
	var browser = { agent:null, opera:false, msie:false, firefox:false, netscape:false, safari:false, version:false };
	var ua = window.navigator.userAgent.toLowerCase();
	var agent, version;
	if ( ua.match( "opera" ) ) 
	{
		browser.agent = "opera";
		browser.opera = true;
		browser.version = trim( ua.split( "opera" )[1] );
	}
	else if ( ua.match( "msie" ) )
	{
		browser.agent = "msie";
		browser.msie = true;
		browser.version = trim( ua.split( "msie" )[1].split( ";" )[0] );
	}
	else if ( ua.match( "firefox" ) )
	{
		browser.agent = "firefox";
		browser.firefox = true;
		browser.version = trim( ua.split( "firefox" )[1].split( "/" )[1] );
	}
	else if ( ua.match( "netscape" ) )
	{
		browser.agent = "netscape";
		browser.netscape = true;
		browser.version = trim( ua.split( "netscape" )[1].split( "/" )[1] );
	}
	else if ( ua.match( "safari" ) )
	{
		browser.agent = "safari";
		browser.safari = true;
		browser.version = trim( ua.split( "safari" )[1].split( "/" )[1] );
	}
	return browser;
}

function getNavigatorType() {
	if ( navigator.appName == "Microsoft Internet Explorer" )
		return 1;
	else if ( navigator.appName == "Netscape" )
		return 2;
	else
		return 0;
}

function setCursorToEnd(elem) {	//Cursor¸¦ Æû ³¡ÂÊ¿¡...
	if (elem && getNavigatorType() == 1) {
		if (elem.type && (elem.type == "text" || elem.type == "textarea")) {
			var rng = elem.createTextRange();
			rng.move("textedit");
			rng.select();
		}
	}
}

function objFixColor(obj, bg) { //Select bar Fix Color
	for( i=0 ; i < obj.length ; i++) {
		if(obj.options[i].selected) {
			if (!(obj.options[0].selected) && !(obj.value == "")) {
				obj[i].style.backgroundColor = bg ;
			}
		} else {
			obj[i].style.backgroundColor = "" ;
		}
	}
}

function switchAll(frm) {
	var frm ;
	var cFlag = false ;
	for (var j=0; j<frm.length; j++) {
		if (frm[j].checked)
			cFlag = true ;
		else
			cFlag = false ;
	}
	if (cFlag) {
		for (var i=0; i<frm.length; i++) {
			frm[i].checked = false ;
		}
	}
	if (!(cFlag)) {
		for (var i=0; i<frm.length; i++) {
			frm[i].checked = true ;
		}
	}
}

function ViewDialog(iURL,iWidth,iHeight,iTop,iLeft,iEdge,iCenter,iHelp,iResize,iStatus,iScroll) {
	var iURL,iWidth,iHeight,iTop,iLeft,iEdge,iCenter,iHelp,iResize,iStatus,iScroll ;	
	window.showModelessDialog(iURL, window, "dialogWidth:"+ iWidth +"px;dialogHeight:"+ iHeight +"px;dialogTop:"+ iTop +"px;dialogLeft:"+ iLeft +"px;edge:"+ iEdge +";center:"+ iCenter +";help:"+ iHelp +";resizable:"+ iResize +";status:"+ iStatus +";scroll:"+ iScroll +";") ;
}

function ViewWindow(iURL,iName,iWidth,iHeight,iTop,iLeft,iResize,iStatus,iScroll) {
	var iURL,iName,iWidth,iHeight,iTop,iLeft,iResize,iStatus,iScroll ;	
	window.open(iURL, iName, 'width='+ iWidth +',height='+ iHeight +',top='+ iTop +',left='+ iLeft +',resizable='+ iResize +',status='+ iStatus +',scrolling='+ iScroll) ;
}

function Set_Date(frm, Div, Div2) {
	var frm, Div, Div2 ;
	frm.TargetSDate.value = Div ;
	frm.TargetEDate.value = Div2 ;
}

function LoginPlz(url) {
	if (confirm("·Î±×ÀÎ ÈÄ¿¡ »ç¿ëÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.\n\n·Î±×ÀÎ ÇÏ½Ã°Ú½À´Ï±î?")) {
		location.href="/comm/member/login/?" + url;
		return;
	} else {return;}	
}

function LoginPlz2(rtnSite, rtnURL) {
	if (confirm("·Î±×ÀÎ ÈÄ¿¡ »ç¿ëÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.\n\n·Î±×ÀÎ ÇÏ½Ã°Ú½À´Ï±î?")) {
		location.href="/" + rtnSite + "/member/login/?" + rtnURL;
		return;
	} else {return;}	
}

function LoginPlz3(rtnSite, rtnURL, strFrame) {
	if (confirm("·Î±×ÀÎ ÈÄ¿¡ »ç¿ëÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.\n\n·Î±×ÀÎ ÇÏ½Ã°Ú½À´Ï±î?")) {
		if (rtnSite == "") {
			if (strFrame == "Y") {
				top.frames.location.href="/member/login/?" + rtnURL;
			} else {
				location.href="/member/login/?" + rtnURL;
			}
		} else {
			if (strFrame == "Y") {
				top.frames.location.href="/" + rtnSite + "/member/login/?" + rtnURL;
			} else {
				location.href="/" + rtnSite + "/member/login/?" + rtnURL;
			}
		}
		return;
	} else {return;}	
}

function fnScrap(frm,sp,url,uid) {
	var frm,sp,url,uid;

	if (uid == "") {
		LoginPlz(url);
		return;
	}
	fnScrapSubmit(frm);
}

function fnLogOut(xURL) {
	var xURL;

	if (fnc_left(location,5).toLowerCase() == "https") {
		location.href = "http://" + location.hostname + "/inc/incLogout.asp?xURL=" + xURL;
	} else {
		Process.location.href = "/inc/incLogout.asp?xURL=" + xURL;
	}
}

function ParentFrameGo(xURL) {
	var xURL;
	parent.location.href = xURL;
}

function convUpper(obj) {	//ÄÚµå¸¦¸¦ ´ë¹®ÀÚ·Î
	var strObj = obj.value ;
	obj.value = strObj.toUpperCase() ;
}

function convLower(obj) {	//ÄÚµå¸¦¸¦ ¼Ò¹®ÀÚ·Î
	var strObj = obj.value ;
	obj.value = strObj.toLowerCase() ;
}

/*
	¿ÞÂÊ,¿À¸¥ÂÊ ¹®ÀÚ¿­ ÀÚ¸£±â ÇÔ¼ö
	2008.03.21 ÀÌÅÃ±Ù Ãß°¡
*/
function fnc_left(str, n){
	if (n <= 0)
	    return "";
	else if (n > String(str).length)
	    return str;
	else
	    return String(str).substring(0,n);
}

function fnc_right(str, n){
    if (n <= 0)
       return "";
    else if (n > String(str).length)
       return str;
    else {
       var iLen = String(str).length;
       return String(str).substring(iLen, iLen - n);
    }
}

function Sch_Chk(frm,bg) {
	var frm,bg,str;
	if (frm.KeyWd.value == "") {
		alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		frm.KeyWd.focus() ;
		frm.KeyWd.style.background = bg ;
		return false ;
	} else
		return;
}

/*
	e-book View
	2008.04.11 ÀÌÅÃ±Ù Ãß°¡
*/
function fnc_ebook_open(isbn,folder){
	window.open('about:blank','win_ebook','width=960,height=740,resizable=0');
	window.open('/inc/incOpen_Ebook.asp?isbn='+isbn+'&folder='+folder,target='win_ebook');
}

function fnChkHttps(Div,strURL) {	//yasumoon 08/04/29
	var Div,strURL;

	if (Div) {
		if (fnc_left(location,5).toLowerCase() == "https") {
			location.href = "http://" + location.hostname + strURL;
		}
	}
}

//yasumoon, 08/05/07 Textarea ±ÛÀÚ¼ö Á¦ÇÑ
/////////////////////////////////////////////////////
function util_strlen (str) {
	var len = 0;

	for (var i=0; i < str.length; i++) {
		if (str.charCodeAt(i) > 128)
			len += 2;
		else
			len ++;
	}
	return len;
}

function util_get_realidx(mystr, rstrlen) {
	var r_len = 0;

	for(i=0; i<mystr.length; i++) {
		if( mystr.charCodeAt(i) <= 127 )
			r_len = r_len + 1;
		else
			r_len = r_len + 2;

		if( r_len == rstrlen )
			return i+1;
		else if( r_len > rstrlen )
			return i;
	}	
	return i;
}

function getMemoLength(str,rstrlen,obj)	{
	var curlen = util_strlen(str);

	if( curlen > rstrlen) {
		alert(rstrlen + "byte¸¦ ³Ñ¾ú½À´Ï´Ù.");
		obj.value = str.substring(0, util_get_realidx(str, rstrlen));
		curlen = util_strlen(str);
	}
	document.all.msglen.innerHTML = curlen;
}
/////////////////////////////////////////////////////

function fnGoUrl(GoUrl,div) {
	if (div == "frame") {
		parent.frames.location.href = GoUrl;
	} else {
		location.href = GoUrl;
	}
}

function fnFileDownLoad(fPath,fName) {
	location.href = "/inc/incFileDownLoad.asp?filepath=" + fPath + "&filename=" + fName;
}

function fnPdsSch(obj) {
	obj.style.display = ""
}

function fnFrmColorClear(obj) {
	eval($(obj)).css({"background-color":""});
}