function MM_swapImgRestore() {
	//v3.0
	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() {
	//v3.0
	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) {
	//v4.01
	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() {
	//v3.0
	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 MM_showHideLayers() {
	//v6.0
	var i,p,v,obj,args=MM_showHideLayers.arguments;
	for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) {
			v=args[i+2];
		if (obj.style) {
			obj=obj.style;
			v=(v=='show')?'visible':(v=='hide')?'hidden':v;
		}
		obj.visibility=v;
	}
}

function MM_showHideDisplay() {
	var i,p,v,obj,args=MM_showHideDisplay.arguments;
	for (i=0; i<(args.length-2); i+=3) {
		if ((obj=MM_findObj(args[i]))!=null) { 
			v=args[i+2];
			if (obj.style) { 
				v=(v=='show')?'inline':(v=='hide')?'none':v; 
			}
			obj.style.display=v; 
		}
	}
}

function MM_reloadPage(init) {
	//reloads the window if Nav4 resized
	if (init==true) with (navigator) {
		if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
			document.MM_pgW=innerWidth;
			document.MM_pgH=innerHeight;
			onresize=MM_reloadPage;
		}
	}
	else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_openBrWindow(theURL,winName,features) {
	//v2.0
	window.open(theURL,winName,features);
}

function bluring(){
	if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus();
}
document.onfocusin=bluring;

function filterKey(filter,nFocusID,funcName) { 
	var evCode = (window.netscape) ? event.which : event.keyCode;
	if(evCode==13 && nFocusID) {
		if(nFocusID == 'function' && funcName) eval(funcName);
		else if(document.getElementById(nFocusID).disabled==false || document.getElementById(nFocusID).style.display=='none') document.getElementById(nFocusID).focus();
	}
	else if(filter) { 
		var sKey = String.fromCharCode(evCode); 
		var re = new RegExp(filter); 
		if(!re.test(sKey)) event.returnValue=false; 
	} 
}

function nextFocusId(sNow,sNext) {
	if(event.keyCode==8 || (event.keyCode>=37 && event.keyCode<=40)) return;

	var sForm = 'document.getElementById';
	var oNow,oNext;

	if(typeof sNow == 'object') oNow = sNow;
	else oNow = eval(sForm + '("' + sNow + '")');

	if(typeof sNext == 'object') oNext = sNext;
	else oNext = eval(sForm + '("' + sNext + '")');

	if (typeof oNow == 'object' && typeof oNext == 'object') {
		if ( oNow.value.length == oNow.maxLength) oNext.focus();
	}
}

function inValue(obj,val) {
	obj.value = val;
	//alert(val);
}

function bt(id,after) {
	eval(id+'.filters.blendTrans.stop();');
	eval(id+'.filters.blendTrans.Apply();');
	eval(id+'.src="'+after+'";');
	eval(id+'.filters.blendTrans.Play();');
}

//--Áñ°ÜÃ£±âµî·Ï ÀÚ¹Ù½ºÅ©¸³Æ®--//
var favoriteurl="http://www.alledu.co.kr"
var favoritetitle="¡Ú ÀüÀÚÂü°í¼­::ÇØ¶óÅ¬·¡½º¹æ°úÈÄ ÇÐ±³¡Ú"
function addfavorites(){
	if (document.all)
		window.external.AddFavorite(favoriteurl,favoritetitle)
}
//--Áñ°ÜÃ£±âµî·Ï ÀÚ¹Ù½ºÅ©¸³Æ®end--//

function find_data(){
	var val = document.getElementById('searchval').value
	if(val == '°¢±âµÕ') {
		window.open('/search/01.htm?query='+val,'dicSearch','resizable=yes,scrollbars=yes,width='+screen.availWidth+',height='+screen.availHeight+',top=0,left=0').focus();
	}
	else if(val == '¼¼Æ÷') {
		window.open('/search/02.htm?query='+val,'dicSearch','resizable=yes,scrollbars=yes,width='+screen.availWidth+',height='+screen.availHeight+',top=0,left=0').focus();
	}
	else if(val == 'Èï¼±´ë¿ø±º') {
		window.open('/search/03.htm?query='+val,'dicSearch','resizable=yes,scrollbars=yes,width='+screen.availWidth+',height='+screen.availHeight+',top=0,left=0').focus();
	}
	else if(val == '±³°ú³»¿ë°ú °ü·ÃµÈ ´Ü¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä' || val == '') {
		alert("±³°ú³»¿ë°ú °ü·ÃµÈ ´Ü¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä");
		return;
	}
	else {
		window.open('http://find.happyedu.co.kr/?query='+val,'find_pop11','resizable=yes,scrollbars=yes,width='+screen.availWidth+',height='+screen.availHeight+',top=0,left=0').focus();
		//search_popup.focus();
	}
}

/*function find_data(val) {
	if(!val) val = document.getElementById('searchval').value;
	if(val == '°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä.' || val == '') {
		alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¿©ÁÖ¼¼¿ä");
		return;
	}
	window.open('http://find.happyedu.co.kr/?query='+val,'find_pop11','resizable=yes,scrollbars=yes,width=960,height=500,top=0,left=0').focus();
	//search_popup.focus();
}*/

function default_value(this_obj) {
	if(this_obj.value=='±³°ú³»¿ë°ú °ü·ÃµÈ ´Ü¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä') {
		this_obj.value="";
		this_obj.style.color="#666666"
	}
	else if(this_obj.value=='') {
		this_obj.value="±³°ú³»¿ë°ú °ü·ÃµÈ ´Ü¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä";
		this_obj.style.color="#AAAAAA"
	}
}

//--ÇÃ·¡½Ã ¾Ö´Ï¿­±â
function swfOpen(linkIdx)
{
	window.open('/pro/ebook_link/flash_view2.html?linkIdx='+linkIdx,'flashPop','width=753,height=550, resizable').focus();
}
