
/* Áñ°ÜÃ£±â */
function addbookmark(){
window.external.AddFavorite('http://historyexam.go.kr', 'ÇÑ±¹»ç´É·Â°ËÁ¤½ÃÇè')
}

 function fla_main(aaa,bbb,ccc,ddd) {
document.write('	<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="/fla/swflash.cab#version=8,0,0,0" width="' + ccc + '" height="' + ddd + '" id="fla_main"/>');
document.write('	<param name="allowScriptAccess" value="sameDomain" />');
document.write('	<param name="movie" value="/fla/main.swf?pageNum=' + aaa + '&subNum=' + bbb + '" /><param name="quality" value="high" /><param name="wmode" value="transparent" ><embed src="/flash/main.swf?pageNum=' + aaa + '&subNum=' + bbb + '" quality="high" bgcolor="#ffffff"  width="' + ccc + '" height="' + ddd + '"  name="fla_main" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write('	<embed value="transparent" /></embed>');
document.write('	</object>');
}


// Image Roll-over
function imageOver(objImg) {
objImg.src = objImg.src.replace("off.gif", "on.gif");
}
function imageOut(objImg) {
objImg.src = objImg.src.replace("on.gif", "off.gif");
}

//nav
function initNavigation(seq) {
	nav = document.getElementById("menu_sub");
	nav.menu = new Array();
	nav.current = null;
	nav.menuseq = 0;
	navLen = nav.childNodes.length;

	allA = nav.getElementsByTagName("a")
	for(k = 0; k < allA.length; k++) {
		allA.item(k).onmouseover = allA.item(k).onfocus = function () {
			nav.isOver = true;
		}
		allA.item(k).onmouseout = allA.item(k).onblur = function () {
			nav.isOver = false;
			setTimeout(function () {
				if (nav.isOver == false) {
					if (nav.menu[seq])
						nav.menu[seq].onmouseover();
					else if(nav.current) {
						menuImg = nav.current.childNodes.item(0);
						menuImg.src = menuImg.src.replace("_on.gif", ".gif");
						if (nav.current.submenu)
							nav.current.submenu.style.display = "none";
						nav.current = null;
					}
				}
			}, 500);
		}
	}

	for (i = 0; i < navLen; i++) {
		navItem = nav.childNodes.item(i);
		if (navItem.tagName != "LI")
			continue;

		navAnchor = navItem.getElementsByTagName("a").item(0);
		navAnchor.submenu = navItem.getElementsByTagName("ul").item(0);

		navAnchor.onmouseover = navAnchor.onfocus = function () {
			if (nav.current) {
				menuImg = nav.current.childNodes.item(0);
				menuImg.src = menuImg.src.replace("_on.gif", ".gif");
				if (nav.current.submenu)
					nav.current.submenu.style.display = "none";
				nav.current = null;
			}
			if (nav.current != this) {
				menuImg = this.childNodes.item(0);
				menuImg.src = menuImg.src.replace(".gif", "_on.gif");
				if (this.submenu)
					this.submenu.style.display = "block";
				nav.current = this;
			}
			nav.isOver = true;
		}
		nav.menuseq++;
		nav.menu[nav.menuseq] = navAnchor;
	}
	if (nav.menu[seq])
		nav.menu[seq].onmouseover();
}
//maintab
function initTabMenu(tabContainerID) {
	var tabContainer = document.getElementById(tabContainerID);
	var tabAnchor = tabContainer.getElementsByTagName("a");
	var i = 0;

	for(i=0; i<tabAnchor.length; i++) {
		if (tabAnchor.item(i).className == "tab")
			thismenu = tabAnchor.item(i);
		else
			continue;

		thismenu.container = tabContainer;
		thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);
		thismenu.targetEl.style.display = "none";
		thismenu.imgEl = thismenu.getElementsByTagName("img").item(0);
		if (thismenu.imgEl) {
			thismenu.onmouseover = function () {
				//this.onclick();
			}
		}
		thismenu.onclick = tabMenuClick;

		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	tabContainer.first.onclick();
}
function tabMenuClick() {
	currentmenu = this.container.current;
	if (currentmenu != this) {
		if (currentmenu) {
			currentmenu.targetEl.style.display = "none";
			if (currentmenu.imgEl) {
				currentmenu.imgEl.src = currentmenu.imgEl.src.replace("_on.gif", ".gif");
			} else {
				currentmenu.className = currentmenu.className.replace(" on", "");
			}
		}

		this.targetEl.style.display = "block";
		if (this.imgEl) {
			this.imgEl.src = this.imgEl.src.replace(".gif", "_on.gif");
		} else {
			this.className += " on";
		}
		this.container.current = this;
	}
	return false;
}

function CaricaFoto(img){
        foto1= new Image();
        foto1.src=(img);
        Controlla(img);
}
function Controlla(img){
        if((foto1.width!=0)&&(foto1.height!=0)){
                viewFoto(img);
        }
        else{
                funzione="Controlla('"+img+"')";
                intervallo=setTimeout(funzione,20);
        }
}
function viewFoto(img){
        largh=foto1.width + 30;
        altez=foto1.height + 20;

		window_left = (screen.width-largh)/2;
		window_top = (screen.height-altez)/2;

        stringa="width="+largh+",height="+altez+",left="+window_left+",top="+window_top+",resizable="+1+",scrollbars=yes";
        image_view=window.open(img,"",stringa);
        image_view.document.write("<html><head><meta HTTP-EQUIV='imagetoolbar' CONTENT='no'><title> </title></head><body leftmargin=0 marginwidth=0 topmargin=0 marginheight=0><img src="+img+" onclick='self.close()' style=cursor:hand></body></html>");
        image_view.document.close();
}

//
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_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_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];}
}


//Å¬¸¯ÇÏ¸é º»¹®º¸ÀÌ±â
var latestmenu = "";
function menuclick(id){
    show_id = document.all[id];
    if(show_id.style.display !="none"){
        show_id.style.display ="none";
    }else{
        show_id.style.display = "";
        if(latestmenu !="" && id !=latestmenu){
            document.all[latestmenu].style.display = "none";
        }
        latestmenu = id;
    }
}

/* Å¬¸¯½Ã */

var gonggi1 = null;
var imgwin = null;

function open_notice(url) {
	var notice = window.open ( url, "notice", "toolbar=no, menubar=no, scrollbars=no, resizable=no, width=505, height=452, left=200, top=0");
}

function open_win1(url,fromwin,w,h) {

if (fromwin == 1){
  if (imgwin != null){
    imgwin.close();
  }

  if ( !gonggi1 || gonggi1.closed ){
     gonggi1=window.open ( url, "gonggi1", "toolbar=no, menubar=no, scrollbars=yes, resizable=no, width=" + w + ", height=" + h + ", left=200, top=0");
  }else{
     gonggi1.location.href = url;
  }

}else{

  if (gonggi1 != null){
    gonggi1.close();
  }

  if ( !imgwin || imgwin.closed ){
     imgwin=window.open ( url, "imgwin", "toolbar=no, menubar=no, scrollbars=no, resizable=no, width=" + w + ", height=" + h + ", left=200, top=0");
  }else{
     imgwin.location.href = url;
  }

}
}





/* Åä±Û */

function closeRemote(){
	if(document.remoteCheckForm.ckStatus.value == "2"){
		SwitchRemote('remote');
	}
	document.remoteCheckForm.ckRemote.value = "2";
}



/* Åä±Û */
var menuStat = new Array(false,false,false,false,false,false);

function SwitchRemote(obj){
 if(document.getElementById){
 var el = document.getElementById(obj);
 var ar = document.getElementById("stoplayer").getElementsByTagName("span");
  if(el.style.display != "block") {
   for (var i=0; i<ar.length; i++){
    if (ar[i].className=="cnj_menu")
    ar[i].style.display = "none";
   }
   el.style.display = "block";
   menuStat[(parseInt(obj.substr(3)) - 1)] = true;
   //alert('1');
   //toggle_img
   toggle_img.src = "/images/total_menu_on.gif";

  }else{
   menuStat[(parseInt(obj.substr(3)) - 1)] = false;
   el.style.display = "none"
   //alert('2');
   toggle_img.src = "/images/total_menu.gif";

  }
 }
}
/* Åä±Û */


/* ±Û¾¾È®´ë Ãà¼Ò */


function FontPlus()
{
var k = document.getElementById('subcontents');
var nSize = k.style.fontSize  ? k.style.fontSize  : '9pt';
var iSize = parseInt(nSize.replace('pt',''));

if (iSize < 20)
{
k.style.fontSize  = (iSize + 1) + 'pt';
k.style.lineHeight = '140%';
}
}


//ÆùÆ®Ãà¼Ò
function FontMinus()
{
var k = document.getElementById('subcontents');
var nSize = k.style.fontSize ? k.style.fontSize : '9pt';
var iSize = parseInt(nSize.replace('pt',''));

if (iSize > 6)
{
k.style.fontSize = (iSize - 1) + 'pt';
k.style.lineHeight = '140%';
}
}

function playflash(file,width,height,bgcolor,quality,name){
        document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="/fla/swflash.cab#version=8,0,0,0" width="'+width+'" height="'+height+'" id="'+name+'">');  //ÇÃ·¡½¬ÇÃ·¹ÀÌ¾î ¹öÀüÀÌ ÀÌÀü¹öÀüÀÏ°æ¿ì ¹öÀü 8À» º¯°æ
        document.write('<param name="movie" value="'+file+'" />');
        document.write('<param name="quality" value="'+quality+'" />');
        document.write('<param name="wmode" value="transparent" />');
        document.write('<param name="bgcolor" value="'+bgcolor+'" />');
        document.write('<embed src="'+file+'" quality="'+quality+'" wmode="transparent" bgcolor="'+bgcolor+'" width="'+width+'" height="'+height+'" name="'+name+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
        document.write('</object>')
}



