

// Flash publish
function swfprint(furl,fwidth,fheight,transoption)	{
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+ fwidth +'" height="' + fheight +'" align="middle">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="movie" value="'+ furl +'"/>');
	if (transoption == "t")	{
		document.write('<param name="wmode" value="transparent"/>');
	} else if	(transoption == "o")	{
		document.write('<param name="wmode" value="opaque"/>');
	}
	document.write('<!-- Hixie method -->');
	document.write('<!--[if !IE]> <-->');
	document.write('<object type="application/x-shockwave-flash" data="'+ furl +'" width="'+ fwidth +'" height="' + fheight +'"');
	if (transoption == "t")	{
		document.write(' wmode="transparent"');
	} else if	(transoption == "o")	{
		document.write(' wmode="opaque"');
	}
	document.write('></object>');
	document.write('<!--> <![endif]-->');
	document.write('</object>');
}

// Roll over image
function imageOver(obj) {
	obj.src = obj.src.replace("off.gif", "on.gif");
}
function imageOut(obj) {
	obj.src = obj.src.replace("on.gif", "off.gif");
}

// Replace image
function imageReplace(target,imgSrc) {
	if((target.nodeType!=undefined) && (target.nodeType=='1')){t=target;}else{t=document.getElementById(target);}
	t.setAttribute('src',imgSrc);
}
//add window.onload event
function addLoadEvent(f){
	var oldonoad = window.onload;
	if(typeof window.onload != 'function'){window.onload = f;}
	else{window.onload=function(){
		oldonload();
		f();
		}
	}
}

//Popup
function popWin(url,name,w,h,s){
    if(s!==0)    {
        sOp = ",scrollbars=yes";
    } else    {
        sOp = "";
    }
    winOptions = 'width='+w+',height='+h+sOp;
    window.open(url,name,winOptions);
}

//Popup Close
function closeWin(){
    window.close();
}

// Tab Content
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);
		thismenu.onmouseover = function tabMenuClick() {
			currentmenu = this.container.current;
			if (currentmenu == this)
				return false;

			if (currentmenu) {
				currentmenu.targetEl.style.display = "none";
				if (currentmenu.imgEl) {
					currentmenu.imgEl.src = currentmenu.imgEl.src.replace("_on.gif", "_off.gif");
				} else {
					currentmenu.className = currentmenu.className.replace(" on", "");
				}
			}

			this.targetEl.style.display = "block";
			if (this.imgEl) {
				this.imgEl.src = this.imgEl.src.replace("_off.gif", "_on.gif");
			} else {
				this.className += " on";
			}
			this.container.current = this;

			return false;
		};

		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	if (tabContainer.first)
		tabContainer.first.onmouseover();
}


// Show Hide Layer
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_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; }
}

// /html/clf/ass/clfass_sislppd
function toggleView(t){
	var tt = document.getElementById('view_' + t);
	for(var i=0;;i++){
		if(document.getElementById('view_' + i))document.getElementById('view_' + i).style.display = 'none';
		else{break;}
	}
	tt.style.display = 'block';
}

// Swap Image
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];}
		}

//	/html/clf/lic/clflic_clssroom
function iframe_autoresize(arg) {arg.height = eval(arg.name+".document.body.scrollHeight");}

function goTab(no){
	if(no == 11 ){
		document.getElementById('first').src = "clflic_clssroom_10.html";
		document.getElementById('second').src = "clflic_clssroom_01.html#01";
	}else if(no == 12 ){
		document.getElementById('first').src = "clflic_clssroom_10.html";
		document.getElementById('second').src = "clflic_clssroom_01.html#02";
	}else if(no == 13 ){
		document.getElementById('first').src = "clflic_clssroom_10.html";
		document.getElementById('second').src = "clflic_clssroom_01.html#03";
	}else if(no == 14 ){
		document.getElementById('first').src = "clflic_clssroom_10.html";
		document.getElementById('second').src = "clflic_clssroom_01.html#04";
	}else if(no == 21 ){
		document.getElementById('first').src = "clflic_clssroom_20.html";
		document.getElementById('second').src = "clflic_clssroom_02.html#01";
	}else if(no == 22 ){
		document.getElementById('first').src = "clflic_clssroom_20.html";
		document.getElementById('second').src = "clflic_clssroom_02.html#02";
	}else if(no == 31 ){
		document.getElementById('first').src = "clflic_clssroom_30.html";
		document.getElementById('second').src = "clflic_clssroom_03.html#01";
	}else if(no == 32 ){
		document.getElementById('first').src = "clflic_clssroom_30.html";
		document.getElementById('second').src = "clflic_clssroom_03.html#02";
	}else if(no == 1 ){
		document.getElementById('first').src = "clflic_clssroom_10.html";
		document.getElementById('second').src = "clflic_clssroom_01.html";
	}else if(no == 2 ){
		document.getElementById('first').src = "clflic_clssroom_20.html";
		document.getElementById('second').src = "clflic_clssroom_02.html";
	}else if(no == 3 ){
		document.getElementById('first').src = "clflic_clssroom_30.html";
		document.getElementById('second').src = "clflic_clssroom_03.html";
	}else if(no == 4 ){
		document.getElementById('first').src = "clflic_clssroom_40.html";
		document.getElementById('second').src = "clflic_clssroom_04.html";
	}
}

function selectBoxNavi(t){window.location = t.getAttribute('value');} //ÆäÀÌÁö°¡ ÇÁ·¹ÀÓ¾ÈÀ¸·Î µé¾î°¥ °æ¿ì ¼öÁ¤ÀÌ ÇÊ¿äÇÒ ¼ö ÀÖ½À´Ï´Ù

function commentInit(){
	if(!(document.getElementById('comment_view')&&document.getElementById('comment_write')))return false;
	document.getElementById('comment_write').style.display = 'none';
	var view = document.getElementById('comment_view').getElementsByTagName('table')[0].getElementsByTagName('td')[1].getElementsByTagName('img')[0];
	var write = document.getElementById('comment_write').getElementsByTagName('table')[0].getElementsByTagName('td')[1].getElementsByTagName('img')[0];
	view.style.cursor = 'pointer';
	view.onclick = function(){
		document.getElementById('comment_view').style.display = 'none';
		document.getElementById('comment_write').style.display = 'block';
	}
	write.style.cursor = 'pointer';
	write.onclick = function(){
		document.getElementById('comment_view').style.display = 'block';
		document.getElementById('comment_write').style.display = 'none';
	}
}


// Quick_bar scroll Layer
function initMoving(target) {
    if (!target)
        return false;

    var obj = target;

	if (document.getElementById('quick_bar'))
	{
	    obj.initTop = 258;
		obj.topLimit = 258;
	} else if(document.getElementById('quick_bar2'))	{
	    obj.initTop = 307;
		obj.topLimit = 307;
	} else if(document.getElementById('quick_bar3'))	{
	    obj.initTop = 258; //international quick
	}

    obj.initLeft = 950;
    obj.bottomLimit = document.documentElement.scrollHeight - 220;

    obj.style.position = "absolute";
    obj.top = obj.initTop;
    obj.left = obj.initLeft;
    obj.style.top = obj.top + "px";
    obj.style.left = obj.left + "px";

    obj.getTop = function() {
        if (document.documentElement.scrollTop) {
            return document.documentElement.scrollTop;
        } else if (window.pageYOffset) {
            return window.pageYOffset;
        } else {
            return 0;
        }
    }
    obj.getHeight = function() {
        if (self.innerHeight) {
            return self.innerHeight;
        } else if(document.documentElement.clientHeight) {
            return document.documentElement.clientHeight;
        } else {
            return 500;
        }
    }
    
    obj.move = setInterval(function() {
    	try{
	        pos = obj.getTop() + obj.getHeight() / 2 - 164;
	
	        if (pos > obj.bottomLimit)
	            pos = obj.bottomLimit
	        if (pos < obj.topLimit)
	            pos = obj.topLimit
	
	        interval = obj.top - pos;
	        obj.top = obj.top - interval / 3;
	
	        obj.style.top = obj.top + "px";
		} catch (e1) {
		}
    }, 40)
}


// context popup layer

Layer_popup_close=2;  //¸Þ´º ´Ý´Â ¹æ¹ý 1(Å¬¸¯À¸·Î ´ÝÀ½ )¶Ç´Â 2(¸¶¿ì½º ¾Æ¿ôÀ¸·Î ´ÝÀ½ )


var satuas; //¸¶¿ì½º°¡ ÆË¾÷Ã¢ À§¿¡ ³õ¿© ÀÖ´ÂÁö¸¦ ¾Ë±â À§ÇÑ Àü¿ªº¯¼ö ¼±¾ð
function popup_Layer(event,popup_name) {    //ÆË¾÷·¹ÀÌ¾î »ý¼º
	 var main,_tmpx,_tmpy,_marginx,_marginy;
	 main = document.getElementById(popup_name);
	 if(Layer_popup_close==2){
	satuas=1;//Å¬¸¯À¸·Î ÀÎÇÑ ´ÝÈû ¹æÁö¸¦ À§ÇØ
	 }
	 main.style.display = '';//ÆË¾÷ »ý¼º
	 _tmpx = event.clientX+parseInt(main.offsetWidth);
	 _tmpy = event.clientY+parseInt(main.offsetHeight);
	 _marginx = document.body.clientWidth - _tmpx;
	 _marginy = document.body.clientHeight - _tmpy;

	 // ÁÂ¿ì À§Ä¡ ÁöÁ¤
	 if(_marginx < 0){//¿ìÃø;
	main.style.left = event.clientX + document.body.scrollLeft + _marginx-2+"px";
	 }
	 else{
	main.style.left = event.clientX + document.body.scrollLeft-5+"px";
	 }
	 //³ôÀÌ ÁöÁ¤
	 if(_marginy < 0){//¾Æ·¡ºÎºÐ;
	main.style.top = event.clientY + document.body.scrollTop + _marginy-5+"px";
	 }  
	 else{
	main.style.top = event.clientY + document.body.scrollTop-5+"px";
	 }

}  


function mouse_anchor(type){ //¸¶¿ì½ºÀÇ À§Ä¡¿¡ µû¸¥ ÆË¾÷ÀÇ ´ÝÀ½À» °áÁ¤
	if(type=="1"){
	   satuas="1";
	}
	if(type=="0"){
	   satuas="0";
	}
}



function Layer_popup_Off() { //ÆË¾÷ ´ÝÀ½
  if(satuas=="0"){
	 document.getElementById("popup_context").style.display = "none";
   }
   if(Layer_popup_close==2){
	  satuas=null;
   }
}


function mouseout_close() {
	window.setTimeout('Layer_popup_Off()',850);
}

if(Layer_popup_close==1){
   document.onmousedown = Layer_popup_Off;//Å¬¸¯À¸·Î ´Ý±â
}

if(Layer_popup_close==2){
   document.onmouseover=mouseout_close;//·¹ÀÌ¾î ¹ù¾î³ª¸é ´Ý±â
}


// background ±ô¹ÚÀÓ ¹æÁö
try {
	document.execCommand('BackgroundImageCache', false, true);
} catch(e) {}


// Äü¸Þ´º top ¸µÅ©
function CyberQTop() {
	location.href = "#"
}


// ¸µÅ© ÀÌ¹ÌÁö Å×µÎ¸® Á¦°Å
function bluring(){
if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus();
}
document.onfocusin=bluring; 



//Lozanoy Popup
function PopLozanoy(){
    window.open('http://cufs.ac.kr/lozanov/contents.htm','','width=800,height=580,scrollbars=yes');
}

//Quick ¿Â¶óÀÎ ÇÐ½ÀÁö¿ø Popup
function PopOnlineSupport(){
    window.open('/com/com_downpopu.jsp','','width=580,height=510,scrollbars=yes');
}

//Popup ÀÔÇÐ¿¡¼­ Á¹¾÷±îÁö
function StartEnd(){
    window.open('/swf/start_end/main.html','','width=1000,height=630');
}

//»çÀÌ¹ö¿Ü´ëÂ÷º°È­
function DifferentCuf(){
	window.open('/man/pop/cyber_1209.html','','width=450,height=550');
}
