
//이미지 확대보기
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; 
        altez=foto1.height; 
        stringa="width="+largh+",height="+altez+",left="+100+",top="+100+",resizable="+1; 
        image_view=window.open(img,"",stringa); 
        image_view.document.write("<html><head><title>크게보기</title></head>"); 
        image_view.document.write("<body leftmargin=0 marginwidth=0 topmargin=0 marginheight=0>"); 
        image_view.document.write("<img src="+img+" onclick='self.close()'+ style='cursor:hand'>"); 
        image_view.document.close(); 
} 



/* Select Go */
function goSelectUrl(num){
			var obj = document.getElementById('select'+num);
			if(obj.value == '' || obj.value == 'total'){
			}else{
				window.open(obj.value);
			}
}

//login 창띄우기
function loginWindow(url,windowName){
	var width=640;
	var height=480;
	var left=(screen.availWidth-width)/2;
	var top=(screen.availHeight-height)/2;
	h = 110;	
	w = 220;
	window.open(url, windowName,  "help=0,status=0,scrollbars=0,toolbar=0,directories=0,linemenubar=0,resizable=0,modal=1,dependent=1,location=0,height="+h+",width="+w+",left="+left+",top="+top);	
	//window.open(url,windowName,"dependent=yes,menubar=no,status=no,toolbar=no,scrollbars=no,resizable=no,location=no,width=150,height=100,left="+left+",top="+top);
	//if  (window.showModelessDialog) {
		//w = w -90;
	//	window.showModelessDialog(url, windowName,  "status:no;scroll:no;resizable:no;dialogHeight:"+h+"px;dialogWidth:"+w+"px;center:true;dialogLeft:"+left+";dialogTop:"+top);
	//} else {

	//if ( verClient.indexOf("TRANS") > -1 ) {
	//	var win = window.open(url, windowName,  "help=0,status=0,scrollbars=0,toolbar=0,directories=0,linemenubar=0,resizable=0,modal=1,dependent=1,location=0,height="+h+",width="+w+",left="+left+",top="+top);
	//	//window.showModelessDialog(url, windowName,  "status:no;scroll:no;resizable:no;dialogHeight:"+h+"px;dialogWidth:"+w+"px;center:true;dialogLeft:"+left+";dialogTop:"+top);		
	//} else {
	//	var win = window.open(url, windowName,  "help=0,status=0,scrollbars=0,toolbar=0,directories=0,linemenubar=0,resizable=0,modal=1,dependent=1,location=0,height="+h+",width="+w+",left="+left+",top="+top);	
	//}
}
function mailWindow(url,windowName){
	var left=0;
	var top=0;
	h = 800;	
	w = 900;
	window.open(url, windowName,"height="+h+",width="+w+",left="+left+",top="+top);	
}

// 새창띄위기
var win1Open = null

function displayImage(picName, windowName, windowWidth, windowHeight){
return window.open(picName,windowName,"toolbar=no,scrollbars=no,resizable=no,width=" + (parseInt(windowWidth)+20) + ",height=" + (parseInt(windowHeight)+15)) 
}

function winClose(){
if(win1Open != null) win1Open.close() 
}

function doNothing(){}

function displayImage(picName, windowName, windowWidth, windowHeight){
var winHandle = window.open("" ,windowName,"toolbar=no,scrollbars=no,resizable=no,width=" + windowWidth + ",height=" + windowHeight)
if(winHandle != null){
var htmlString = "<html><head><title>Picture</title></head>" 
htmlString += "<body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>"
htmlString += "<a href=javascript:window.close()><img src=" + picName + " border=0 alt=창닫기></a>"
htmlString += "</body></html>"
winHandle.document.open()
winHandle.document.write(htmlString)
winHandle.document.close()
} 
if(winHandle != null) winHandle.focus()
return winHandle
}

// 이미지 롤오버

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];}
}


//탭기능에 마우스 오버기능
b = 0;									
function gongover(a,ulID) {	//a : 오버 번호  ulID : 감싸는 UL 아이디
img_el = document.getElementById(ulID).getElementsByTagName("img")
	for (j = 0; j < img_el.length; j++) {
		if (a == j) {
			if(a != b){
			img_el.item(j).src = img_el.item(j).src.replace("_out.gif", "_on.gif");
			b = a;
			}
		}else{
			img_el.item(j).src = img_el.item(j).src.replace("_on.gif", "_out.gif");
		}
	}
}
c = 0;									
function groupover(d,ulID) {	//a : 오버 번호  ulID : 감싸는 UL 아이디
img_el = document.getElementById(ulID).getElementsByTagName("img")
	for (j = 0; j < img_el.length; j++) {
		if (d == j) {
			if(d != c){
			img_el.item(j).src = img_el.item(j).src.replace("_out.gif", "_on.gif");
			c = d;
			}
		}else{
			img_el.item(j).src = img_el.item(j).src.replace("_on.gif", "_out.gif");
		}
	}
}



//공지사항,자주쓰는메뉴 리스트 오버기능
var boardSelected = 1;
function ListOver(upno,listname) {
  document.getElementById(listname + boardSelected).style.display = "none";
  document.getElementById(listname + upno).style.display = "block";
  boardSelected = upno;
}
var groupSelected = 1;
function GroupOver(board,listname) {
  document.getElementById(listname + groupSelected).style.display = "none";
  document.getElementById(listname + board).style.display = "block";
  groupSelected = board;
}
var searchSelected = 1;
function SearchOver(board,listname) {
  document.getElementById(listname + searchSelected).style.display = "none";
  document.getElementById(listname + board).style.display = "block";
  searchSelected = board;
}


//글자크기 
//ex) onclick="setFontSize(+1);"	 onclick="setFontSize(-1);"
function setFontSize(a) {
	var defaultFontSize = 1;//em
	var minFontSize = 1;//em
	var maxFontSize = 2;//em
	obj = document.getElementById("contents");
	var objFontSize = obj.style.fontSize;
	if (!objFontSize) { objFontSize = parseFloat(defaultFontSize)+"em"; }
	var checkFontSize = (Math.round(12*parseFloat(objFontSize))+(a*2))/12;
	if (checkFontSize >= maxFontSize) { checkFontSize = maxFontSize; obj.style.fontSize = checkFontSize+"em"; alert("더이상 늘릴 수 없습니다."); }
	else if (checkFontSize <= minFontSize) { checkFontSize = minFontSize; obj.style.fontSize = checkFontSize+"em"; alert("더이상 줄일 수 없습니다."); }
	else { obj.style.fontSize = checkFontSize+"em"; }
//	alert(checkFontSize);
}


//------------------- SWF 제어함수 시작

function SWFLoader() {
	var obj = new String;
	var parameter = new String;
	var embed = new String;
	
	var classId = new String;
    var codeBase = new String;
	var pluginSpage = new String;
	var embedType = new String;	
	var allParameter = new String;	
	
	var src = new String;
	var width = new String;
	var height = new String;
	var id = new String;
	var layer = new String;
	var arg = new String;
	var altText = new String;
	var wmode = new String;

	this.init = function ( w, h, s, a) {
		width = w; //넓이
		height = h; //높이
		src = s; //파일경로
		arg = a; // 매개변수
		wmode = 'transparent'; //모드설정

		classId = 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000';
		codeBase = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0';
		pluginSpage = 'http://www.macromedia.com/go/getflashplayer';
		embedType = 'application/x-shockwave-flash';

		parameter += "<param name='allowScriptAccess' value='always'>\n";
		parameter += "<param name='allowFullScreen' value='false'\n>";
		parameter += "<param name='movie' value='"+ s + "'>\n";
		parameter += "<param name='quality' value='high'>\n";
		parameter += "<param name='base' value='.'>\n";
		parameter += "<param name='FlashVars' value='"+a+"'>\n";
	}
	
	

	//플래시 오브젝트 옵션설정
	this.parameter = function ( param, value ) {
		 parameter += "<param name='"+param +"' value='"+ value + "'>\n";
	}

	// 플래시 wmode 설정 setFlash.wmode('window')
	this.wmode = function ( value ) {
		wmode = value;
	}

	// 플래시 아이디 설정
	this.id = function ( value ) {
		id = value;
	}
	
	// 플래시 대체텍스트 설정
	
	this.alt = function ( value ) {
		altText = value;
	}

	// 플래시 삽입 레이어 설정
	this.layer = function ( value ) {
		if(value == undefined) {
			layer = "";
		} else {
			layer = value;
		}
	}

	this.show = function () {
		obj = '<object id="'+id+'" width="'+width+'" height="'+height+'" classid="'+classId+'" codebase="'+codeBase+'">\n'+
			parameter +
			'<param name="wmode" value="'+wmode+'">\n'+
			'<!--[if !IE]>-->\n' +
			'<object type="application/x-shockwave-flash" data="' + src + '" width="' + width + '" height="' + height + '" name="' + id + '">\n' +
				parameter +
				'<param name="wmode" value="'+wmode+'">\n'+
			'<!--<![endif]-->\n' +
				'<div class="alt-content alt-' + id + '">' + altText + '</div>\n' +
			'<!--[if !IE]>-->\n' +
			'</object>\n' +
			'<!--<![endif]-->\n' +
		'</object>';

		if(layer == "") {
			document.write(obj);
		}else{
			var div = document.getElementById( layer);
			div.style.display = "";
			div.innerHTML = obj;
		}
	}
}

function hideSWFLayer( div) {
	var div = document.getElementById( div);
	div.style.display = "";
	div.innerHTML = "";
}

function thisMovie(movieName) {
	if (navigator.appName.indexOf("Microsoft") != -1) {
		return window[movieName];
	}
	else {
		return document[movieName];
	}
 }

 function callExternalInterface(movieId) {
    thisMovie(movieId).moveMc();	
}
//------------------- SWF 제어함수 끝



 /* 서브좌측메뉴 롤오버 */
function menuOver() {
	this.src = this.src.replace(".gif", "_on.gif");
}
function menuOut() {
	this.src = this.src.replace("_on.gif", ".gif");
}

function initImgEffect(ImgEls,SelImg) {

	MenuImg = document.getElementById(ImgEls).getElementsByTagName("img");
	MenuImgLen = MenuImg.length;

	for (i=0; i<MenuImgLen; i++) {
		MenuImg.item(i).onmouseover = menuOver;
		MenuImg.item(i).onmouseout = menuOut;
		if (i == SelImg) {
			MenuImg.item(i).onmouseover();
			MenuImg.item(i).onmouseover = null;
			MenuImg.item(i).onmouseout = null;
		}
	}
}



	/* IE HTML rewrite */
	function IE_HtmlRewrite(objParent) {
		if (window.ActiveXObject && objParent) {
			objParent.innerHTML = objParent.innerHTML;
		}
	}

function initSubmenu(depth1, depth2, depth3) {
		selectDepth1 = "menu" + depth1 + "-" + depth2;
		selectDepth2 = "menu" + depth1 + "-" + depth2 + "-" + depth3;

		nav = document.getElementById("snb");
		menuEl = nav.getElementsByTagName("li");


		for(i = 0; i < menuEl.length; i++) {
			if (menuEl.item(i).id == selectDepth1 || menuEl.item(i).id == selectDepth2  ) {
				menuEl.item(i).getElementsByTagName("img").item(0).src = menuEl.item(i).getElementsByTagName("img").item(0).src.replace(".gif", "_on.gif");
			} else {
				menuEl.item(i).getElementsByTagName("img").item(0).onmouseover = menuOver;
				menuEl.item(i).getElementsByTagName("img").item(0).onmouseout = menuOut;
				if (menuEl.item(i).getElementsByTagName("div").item(0)) {
					menuEl.item(i).getElementsByTagName("div").item(0).style.display = "none";
				}
			}
		}
	}

