 

function popup(url,w,h){

  strop = "width="+w+" height="+h+",scrollbars=no,toolbar=0,resizable=0";
  window.open(url, "Searchid", strop); 
}


/*swf파일*/
function swf(src,w,h){

	html = '';
	html += '<object type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" id="param" width="'+w+'" height="'+h+'">';
	html += '<param name="movie" value="'+src+'">';
	html += '<param name="quality" value="best">';
	html += '<param name="wmode" value="transparent">';
	html += '<embed src="'+src+'" quality=best width="'+w+'" height="'+h+'" quality="best" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"><\/embed>';
	html += '<\/object>';
	document.write(html);
}

function oneBar(v){
	var obj = document.getElementById("onBar");	

	if(v=="ON"){
		obj.style.visibility="visible";
		obj.style.top="20";
		obj.style.left="125";
		obj.style.width="742";
		obj.style.height="470";
		obj.innerHTML = i_flash("/swf/cybertour.swf","742","640");

	}else if(v=="OFF"){
		obj.style.visibility="hidden";

	}
}



/*패밀리사이트 이동*/
function goFimilySite(url){
	window.open(url,"FimilySite","");		
}

//quick
var stmnLEFT = 890; // 스크롤메뉴의 좌측 위치
var stmnGAP1 = 350; // 페이지 위쪽 여백
var stmnGAP2 = 10; // 스크롤시 브라우저 상단과 약간 띄움. 필요없으면 0으로 세팅
var stmnBASE = 400;   // 스크롤메뉴 초기 시작위치 (아무렇게나 해도 상관은 없지만 stmnGAP1과 약간 차이를 주는게 보기 좋음)
var stmnActivateSpeed = 50; // 움직임을 감지하는 속도 (숫자가 클수록 늦게 알아차림)
var stmnScrollSpeed =1; // 스크롤되는 속도 (클수록 늦게 움직임)

var stmnTimer;


function ReadCookie(name) {
var label = name + "=";
var labelLen = label.length;
var cLen = document.cookie.length;
var i = 0;

while (i < cLen) {
var j = i + labelLen;

if (document.cookie.substring(i, j) == label) {
var cEnd = document.cookie.indexOf(";", j);
if (cEnd == -1) cEnd = document.cookie.length;
return unescape(document.cookie.substring(j, cEnd));
}
i++;
}
return "";
}

function SaveCookie(name, value, expire) {
var eDate = new Date();
eDate.setDate(eDate.getDate() + expire);
document.cookie = name + "=" + value + "; expires=" + eDate.toGMTString()+ "; path=/";
}

function RefreshStaticMenu() {
var stmnStartPoint, stmnEndPoint, stmnRefreshTimer;

stmnStartPoint = parseInt(STATICMENU.style.top, 10);	
stmnEndPoint = document.documentElement.scrollTop + stmnGAP2;
if (stmnEndPoint < stmnGAP1) stmnEndPoint = stmnGAP1;

stmnRefreshTimer = stmnActivateSpeed;

if ( stmnStartPoint != stmnEndPoint ) {
stmnScrollAmount = Math.ceil( Math.abs( stmnEndPoint - stmnStartPoint ) / 15 );
STATICMENU.style.top = parseInt(STATICMENU.style.top, 10) + ( ( stmnEndPoint<stmnStartPoint ) ? -stmnScrollAmount : stmnScrollAmount );
stmnRefreshTimer = stmnScrollSpeed;
}
stmnTimer = setTimeout ("RefreshStaticMenu();", stmnRefreshTimer);
}

function ToggleAnimate() {
if (!ANIMATE.checked) {
RefreshStaticMenu();
SaveCookie("ANIMATE", "true", 300);
} else {
clearTimeout(stmnTimer);
STATICMENU.style.top = stmnGAP1;
SaveCookie("ANIMATE", "false", 300);
}
}

function InitializeStaticMenu() {
//STATICMENU.style.left = stmnLEFT;
if (ReadCookie("ANIMATE") == "false") {
ANIMATE.checked = true;
STATICMENU.style.top = document.documentElement.scrollTop + stmnGAP1;
} else {
//ANIMATE.checked = false;
STATICMENU.style.top = document.documentElement.scrollTop + stmnBASE;
RefreshStaticMenu();
}
}



function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}



//공지텝메뉴
function show_layer(obj, n, v) //show_layer(id, 갯수, 보여줄레이어)
	{
		for (var i=1; i<=n; i++)
		{
			if (i == v) {document.all[obj+i].style.display='';}
			else {document.all[obj+i].style.display='none';}
		}
	}



//링크점선 없애기
function bluring(){ 
if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") 

document.body.focus(); 
} 
document.onfocusin=bluring; 


// 패밀리사이트 바로가기
function gosite(url){
	if (url != "" ){
		window.open(url);
	}
}

 
//파일다운로드
//javascript:goDownload('D11_1149486655296.gif','60277.gif','upload/directory');
function goDownload(f,re_f,dir){
	document.location = "/etc/download.jsp?filenm="+f+"&re_filenm="+re_f+"&dir="+dir;
}


//롤오버
function imageOver(imgEl) {
        imgEl.src = imgEl.src.replace("off.gif", "on.gif");
}
function imageOut(imgEl) {
        imgEl.src = imgEl.src.replace("on.gif", "off.gif");
}


function view_coment(e) {
       if (e.style.display == "none")
               { e.style.display = ""; }
       else         { e.style.display = "none"; }
}

//클릭시보이기
function showT(id, total){
	for(i=1;i<=total;i++){
		if(i!=id){
			obj1 = eval("showTD" + i);
			obj1.style.display = "none";
		}
	}


	obj1 = eval("showTD" + id);

	if(obj1.style.display == "none"){
		obj1.style.display = "block";
	}
	else{
		obj1.style.display = "none";
	}
}

function showT2(id, total){
	for(i=1;i<=total;i++){
		if(i!=id){
			obj1 = eval("showTD2" + i);
			obj1.style.display = "none";
		}
	}


	obj1 = eval("showTD2" + id);

	if(obj1.style.display == "none"){
		obj1.style.display = "block";
	}
	else{
		obj1.style.display = "none";
	}
}



//한눈바 제어
function i_flash(s,w,h){
        return "<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=\""+w+"\" height=\""+h+"\" id=\"main\" align=\"middle\"param name=\"allowScriptAccess\" value=\"always\" /><param name=\"allowScriptAccess\" value=\"always\" /><param name=\"movie\" value=\""+s+"\" /><param name=\"wmode\" value=\"transparent\" /><param name=\"quality\" value=\"high\" /><param name=\"bgcolor\" value=\"#000000\" /><embed src=\""+s+"\" quality=\"high\" bgcolor=\"#000000\" width=\""+w+"\" height=\""+h+"\" name=\"main\" align=\"middle\" allowScriptAccess=\"always\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /></object>";
}
function goHelp(v){

	var obj = document.getElementById("RESERVE");		
	if(v=="ON"){
		document.all.sch_machine_id.style.visibility = "hidden";

		obj.style.visibility="visible";
		obj.style.top="466";
		obj.style.left="250";
		obj.style.width="980";
		obj.style.height="320";
		obj.innerHTML = i_flash("/swf/help.swf","600","697");
	}else if(v=="OFF"){
		obj.style.visibility="hidden";
		if(document.all.sch_machine_id){
			document.all.sch_machine_id.style.visibility = "visible";
		}
	}
}

function goHelp2(v){
	var obj = document.getElementById("RESERVE");		
	
	if(v=="ON"){
		obj.style.visibility="visible";
		obj.style.top="430";
		obj.style.left="250";
		obj.style.width="980";
		obj.style.height="320";
		obj.innerHTML = i_flash("/swf/help.swf","600","697");
	}else if(v=="OFF"){
		obj.style.visibility="hidden";
	}
}

function parseLgObj(obj) {
	var HD = "LG";
	var UMA = Array("OBJECT", "EMBED");
	
	var str;
	var len;
	
	len = UMA.length;
	str = obj.innerHTML;
	for(i = 0; i < len; i++) {
		str = eval("str.replace(/" + HD + UMA[i] +"/g, \"" + UMA[i] + "\");");
	}	
	
	obj.innerHTML = str;
}



function goCyber(v){
	document.location = v;
}

function showDetail(v){
		noticeWindow  =  window.open('/bloom/popup/'+v+'.html','BADE','width=710,height=500,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');
	noticeWindow.opener = self;
	//noticeWindow.moveTo(0,0);
}


//이미지 resize
//사용법 : <img src="111.jpg" onload="Rsize(this, 667, 10000, 1)"> 
function imgRsize(img, rW, rH){
var iW = img.width;
var iH = img.height;
var g = new Array;
if(iW < rW && iH < rH) { // 가로세로가 축소할 값보다 작을 경우
g[0] = iW; 
g[1] = iH; 
} else {
if(img.width > img.height) { // 원크기 가로가 세로보다 크면
g[0] = rW;
g[1] = Math.ceil(img.height * rW / img.width);
} else if(img.width < img.height) { //원크기의 세로가 가로보다 크면
g[0] = Math.ceil(img.width * rH / img.height);
g[1] = rH;
} else {
g[0] = rW;
g[1] = rH;
}
if(g[0] > rW) { // 구해진 가로값이 축소 가로보다 크면
g[0] = rW;
g[1] = Math.ceil(img.height * rW / img.width);
}
if(g[1] > rH) { // 구해진 세로값이 축소 세로값가로보다 크면
g[0] = Math.ceil(img.width * rH / img.height);
g[1] = rH;
}
}
g[2] = img.width; // 원사이즈 가로
g[3] = img.height; // 원사이즈 세로
return g;
}

function Rsize(img, ww, hh, aL){
var tt = imgRsize(img, ww, hh);
        if(img.width > ww || img.height > hh){ // 가로나 세로크기가 제한크기보다 크면
            img.width = tt[0]; // 크기조정
            img.height = tt[1];
		}
		img.alt = '클릭하시면 원본이미지를 보실수있습니다.';
		if(aL){ // 자동링크 on
				img.onclick = function(){
				   /*
					wT = Math.ceil((screen.width - tt[2])/2.6); // 클라이언트 중앙에 이미지위치.
					wL = Math.ceil((screen.height - tt[3])/2.6);
					mm = window.open("", 'viewOrig', 'width='+tt[2]+',height='+tt[3]+',top='+wT+',left='+wL);
					var doc = mm.document;
					doc.body.style.margin = 0; // 마진제거
					doc.body.style.cursor = "hand";
					var previewimg = doc.createElement("img");
					previewimg.src = img.src;
					doc.body.appendChild(previewimg);
					doc.body.onmousedown = function(){ mm.close();}
					doc.title = 'NUX';
*/
					var img_view = img; 
					var x = x + 20 ; 
					var y = y + 30 ; 
					htmlz = "<html><head><title>이미지원본보기</title><style>body{margin:0;cursor:hand;}</style></head><body scroll=auto onload='width1=document.all.Timage.width;if(width1>1024)width1=1024;height1=document.all.Timage.height;if(height1>768)height1=768;top.window.resizeTo(width1+30,height1+54);' onclick='top.window.close();'><img src='"+img_view.src+"'  title='클릭하시면 닫힙니다.' name='Timage' id='Timage'></body></html>" 
					imagez = window.open('', "image", "width="+ 100 +", height="+ 100 +", top=0,left=0,scrollbars=auto,resizable=1,toolbar=0,menubar=0,location=0,directories=0,status=1"); 
					imagez.document.open(); 
					imagez.document.write(htmlz) 
					imagez.document.close(); 
				}
				img.style.cursor = "hand";
		}
        
}


// 주변관광지 이미지

	function	handsUp(obj){
		document.getElementById("bigIMG").src	=	obj.src;
	}

//레이어팝업
function setCookie( name, value, expiredays ) { 
    var todayDate = new Date(); 
        todayDate.setDate( todayDate.getDate() + expiredays ); 
        document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";" 
    } 
 
function closeWin() { 
    if ( document.notice_form.chkbox.checked ){ 
        setCookie( "maindiv", "done" , 1 ); 
    } 
    document.all['divpop'].style.visibility = "hidden"; 
}  




