var oldText;
var oldCount;

function main(){ 
	window.open('http://digimain.eplib.or.kr/digitalbook/web_main.asp', 'main00', 'fullscreen=yes, scrollbars=no');
} 

function MM_swapImgRestore() {
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() {
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) {
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() {
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function AttachFile(frm_name,field,view,type){
	window.open('/common/fileup.htm?frm_name=' + frm_name +'&field='+field+'&type='+type+'&view='+view,'upload','height=180,width=299,scrollbars=no,resizable=no');
  
}

function select_check(list) {
	var len = list.length;
	for(i=0;i<len;i++) {
		if(list.options[i].selected) return true;
	}
	return false;
}

function select_delete(list) {
	var len = list.length;
	var size = 0;
	var val = "";

// ¸®½ºÆ®¿¡¼­ Á¦°ÅÇÑ´Ù.
	for(i=0;i<len;i++) {
		if(i<list.length&&list.options[i].selected) list[i]=null;
	}
}


function CheckLen(valF, cntF,max) {
	var temp;
	var memocount;
	memocount = 0;
	len = valF.value.length;
	for(k=0;k<len;k++){
		temp = valF.value.charAt(k);
		if(escape(temp).length > 4)
			memocount += 2;
		else
			memocount++;
	}
	if(cntF != "") cntF.value = memocount/2;
	
	if (memocount/2>max) {	
		alert(max+"ÀÚ±îÁö¸¸ ¾²½Ç ¼ö ÀÖ½À´Ï´Ù.");
		valF.value = oldText;		
		if(cntF != "") cntF.value = oldCount/2;
		return false;
	}else{
		oldText = valF.value;	
		oldCount = memocount;
	}
	return memocount/2;
}

function initSelect(select,value) {
	var len = select.length;
	for(i=0;i<len;i++) 
		if(select[i].value==value) select.selectedIndex = i;
}

function initRadio(radio,value) {
	var len = radio.length;
	for(i=0;i<len;i++) 
		if(radio[i].value==value) radio[i].checked = true;
}

function swf(src,w,h,wmode,bgColor){
	html = '';
	html += '<object type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" id="param" width="'+w+'" height="'+h+'">';
	html += '<param name="movie" value="'+src+'">';
	html += '<param name="quality" value="high">';
	if(bgColor != ""){
		html += '<param name="bgcolor" value="'+ bgColor +'">';
	}
	if(wmode != ""){
		html += '<PARAM NAME="wmode" VALUE="'+ wmode +'">';
	}
	html += '<param name="swliveconnect" value="true">';
	html += '<embed src="'+src+'" quality=high bgcolor="#ffffff" 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 mov(src,w,h,vol,scon){
	html = '';
	
	//showcontrols
	if(scon == "") {
		scon = "true";
	}	else {
		scon = "false";
	}
	
	//width
	if(w == "") {
		w = '';
	}	else {
		w = '" width="'+w+'"';
	}
	
	//height
	if(h == "") {
		h = '';
	}	else {
		h = '" height="'+h+'"';
	}
	
	//volume
	if(vol == "") {
		vol = '';
	}	else {
		vol = '" volume="'+vol+'"';
	}
	
	html = '<embed src="'+src+'" showcontrols="'+scon+'" autostart="true" enablecontextmenu="false" '+w+' '+h+' '+vol+'></embed>';
	document.write(html);
}

//À¥Áø ÃÖ±ÙÈ£ º¸±â
function webzine_now(){
	window.open('/action/news_webzine/open_webzine.php','webzine','left=50, top=50, width=1,height=1');
}

//À¥Áøº¸±â
function webzine(id,url){
	window.open('/action/news_webzine/open_webzine.php?id='+id+'&url='+url,'webzine','left=50, top=50, width=1,height=1'); 
}

//ÇÑµµ¼­°ü ÇÑÃ¥ ÀÐ±â
function open_one_book()
{
    openWin = window.open('/action/book/2008/index.html','book','left=100, top=100, width=870, height=750, scrollbars=yes');
    openWin.focus();

    return;
}

//ÆÐ¹Ð¸® »çÀÌÆ® »õÃ¢ ¶ß±â
function navChange2(popup)
{
	if (popup.options[popup.selectedIndex].value != "")
	{
		window.open(popup.options[popup.selectedIndex].value, '_blank');
		popup.selectedIndex=0;
	}
}

