//<![CDATA[

// popup
function openWindow(theURL,theName,theTop,theLeft,theWidth,theHeight,theScroll) { 
	window.open(theURL, theName,'top='+theTop+',left='+theLeft+',width='+theWidth+',height='+theHeight+',marginwidth=0,marginheight=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars='+theScroll+',resizable=no');
}

// popup
function openPopup(theURL,theName,theTop,theLeft,theWidth,theHeight,theScroll) { 
	window.open(theURL, theName,'top='+theTop+',left='+theLeft+',width='+theWidth+',height='+theHeight+',marginwidth=0,marginheight=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars='+theScroll+',resizable=no');
}

// SETCOOKIE
function setCookie(name,value,expiredays) {
	var todayDate = new Date();
	todayDate.setDate(todayDate.getDate() + expiredays);
	document.cookie = name + "=" + escape(value) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}

// GETCOOKIE
function getCookie(name) {
	var nameOfCookie = name + "=";
	var x = 0;
	while (x <= document.cookie.length) {
		var y = (x+nameOfCookie.length);
		if (document.cookie.substring( x, y ) == nameOfCookie) {
			if ((endOfCookie=document.cookie.indexOf(";",y)) == -1) {
				endOfCookie = document.cookie.length;
			}
			return unescape(document.cookie.substring(y,endOfCookie));
		}

		x = document.cookie.indexOf(" ",x) + 1;
		if (x == 0) {
			break;
		}
	}
	return "";
}

// ÀÌ¹ÌÁö »çÀÌÁî¿¡ ¸Â°Ô »õÃ¢ ¿­±â
function AutoResize(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; 
	WinOpen(img, stringa);
	// finestra=window.open(img,"",stringa); 
} 

function WinOpen(img, stringa) {
	var WinOpen1;
	WinOpen1 = window.open("","",stringa);
	WinOpen1.document.open();
	WinOpen1.document.write("<HTML><HEAD><TITLE>:: ÀÌ¹ÌÁöºä ::</TITLE></HEAD>");
	WinOpen1.document.write("<BODY topmargin=0 leftmargin=0>");
	WinOpen1.document.write("<a href='javascript:window.close()'><IMG SRC='"+escape(img)+"' border=0 alt='Ã¢´Ý±â' onfocus='this.blur()' GALLERYIMG='no' /></a>");
	WinOpen1.document.write("</BODY></HTML>");
	WinOpen1.document.close();
}  

/***********************************************************************************************
*	¼­ºêÆäÀÌÁö ÁÂÃø ½½¶óÀÌµù ¸Þ´º
***********************************************************************************************/
function slide(Id, interval, to) {
	var level = Id.length;
    var obj = document.getElementById(Id);
    var H, step = 30; // ÆîÄ§¸Þ´º ¼Óµµ Á¦¾î

    if (obj == null) return;
    if (to == undefined) { // user clicking
        if (obj._slideStart == true) return;
        if (obj._expand == true) {
            to = 0;
            obj.style.overflow = "hidden";
        } else {
            slide.addId(Id);
			for(var i=0; i < slide.objects.length; i++) {
				if (slide.objects[i].id != Id && slide.objects[i]._expand == true) {
					slide(slide.objects[i].id);
				}
			}
            obj.style.height = "";
            obj.style.overflow = "";
            obj.style.display = "block";
            to = obj.offsetHeight; 
            obj.style.overflow = "hidden";
            obj.style.height = "1px";
        }
        obj._slideStart = true;
    }
    
    step             = ((to > 0) ? 1:-1) * step;
    interval         = ((interval==undefined)?1:interval);

    obj.style.height = (H=((H=(isNaN(H=parseInt(obj.style.height))?0:H))+step<0)?0:H+step)+"px";
    
    
    if (H <= 0) {
		obj.style.display = "none";
		obj.style.overflow = "hidden";
		obj._expand = false;
		obj._slideStart = false;
    } else if (to > 0 && H >= to) {
		obj.style.display = "block";
		obj.style.overflow = "visible";
		obj.style.height = H + "px";
		obj._expand = true;
		obj._slideStart = false;
    } else {
        setTimeout("slide('"+Id+"' , "+interval+", "+to+");", interval);
    }
}
slide.objects = new Array();
slide.addId = function(Id)
{
    for (var i=0; i < slide.objects.length; i++) {
       if (slide.objects[i].id == Id) return true;
    }
    slide.objects[slide.objects.length] = document.getElementById(Id);
}

/*********************************************************************
*	¸Þ´º·Ñ¿À¹ö ±â´É(µå¸²À§¹öÁ¦°ø)
*********************************************************************/ 
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];}
}

/*********************************************************************
*	onfocus="this.blur();" È¿°ú ÁÖ±â
*********************************************************************/  
function autoBlur(){ 
	if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") 
		document.body.focus(); 
	} 
document.onfocusin=autoBlur; 


// +++++++++++++  MakeFlashString(source,id,width,height,wmode) ++++++++
// 
// source: source url --> ÇÃ·¡½¬ ÆÄÀÏÀÇ °æ·Î
// id: flash id 
// width: source width
// height: source height
// wmode: wmode --> "none, transparent, opaque"
// otherparam : Ãß°¡ ÆÄ¶ó¹ÌÅÍ "<param name='myParam' value='myValue' />
// 
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

// +++++++++++++  MakeObjectString(classid, codebase, name, id, width,height, param) ++++++++
// 
// classid: classid --> ÇÃ·¡½¬ ÆÄÀÏÀÇ °æ·Î
// codebase: cabÆÄÀÏ À§Ä¡ ¹× ¹öÀüÁ¤º¸ 
// name :
// id :
// width: source width
// height: source height
// param : Ãß°¡ ÆÄ¶ó¹ÌÅÍ "<param name='myParam' value='myValue' />
// 
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

// Example 
// DocumentWrite(MakeFlashString('image/ml_flash.swf','emb1','330','520','opaque'));
// SetInnerHTML(document.all.mm, MakeFlashString('image/ml_flash.swf','emb1','330','520','opaque'));
// @@ÁÖÀÇ »çÇ× 
//  - »óÈ£ÀÛ¿ë ¾ø´Â ÄÁÅÙÃ÷´Â DocumentWrite, SetInnerHTML µÑ´Ù »ç¿ë °¡´É
//  - »óÈ£ÀÛ¿ë ÀÖ´Â ÄÁÅÙÃ÷´Â SetInnerHTML¸¸ »ç¿ë °¡´É
// #######################################################################

function MakeFlashString(source, id, width, height, wmode, otherParam) {	
	return "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,22,0\" width="+width+" height="+height+" id="+id+"><param name=wmode value="+wmode+" /><param name=movie value="+source+" /><param name=quality value=high />"+otherParam+"<embed src="+source+" quality=high wmode="+wmode+" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash\" width="+width+" height="+height+"></embed></object>";
}

function MakeObjectString(classid, codebase, name, id, width, height, param) {
	return "<object classid="+classid+" codebase="+codebase+" name="+name+" width="+width+" height="+height+" id="+id+">"+param+"</object>";
}

// innerHTML Type
function SetInnerHTML(target, code) { 
	target.innerHTML = code; 
}

// Direct Write Type
function DocumentWrite(src) {
	document.write(src);
}

// ¸Þ´º
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

/*********************************************************************
*	ÇÃ·¡½¬ È£Ãâ ½ºÅ©¸³Æ®
*********************************************************************/		
function lf_menuLink(as_link) {
	//alert(as_link);
	switch (as_link) {
		case "1" :
			//alert(as_link);
			openWindow("/new/html/map1.htm",'Window01',0,0,625,470,'no' );
			break;												
		case "2" :
			openWindow("/new/html/map2.htm",'Window02',0,0,625,470,'no' );
			break;															
		case "3" :	
			openWindow("/new/html/map3.htm",'Window03',0,0,625,470,'no' );
			break;		
		case "4" :
			openWindow("/new/html/map4.htm",'Window04',0,0,625,470,'no' );
			break;	
		case "5" :
			openWindow("/new/html/map5.htm",'Window05',0,0,625,450,'no' );
			break;	
		default	:		
			break;								
	}
}
//]]>

