﻿function autoBlur(){ 
if(event.srcElement.tagName=="A"||event.srcElement.tagName=="/img") 
document.body.focus(); 
} 
document.onfocusin=autoBlur; 


function Flash(id,url,w,h,bg,t){
document.write("\
<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width="+w+" height="+h+" id="+id+">\
<param name='movie' value="+url+" />\
<param name='wmode' value="+t+" />\
<param name='bgcolor' value="+bg+" />\
<param name='allowScriptAccess' value='always' />\
<param name='quality' value='high' />\
<param name='menu' value='false' />\
<embed src="+url+" wmode="+t+" width="+w+" height="+h+" name="+id+" bgcolor="+bg+" allowScriptAccess='sameDomain' quality='high' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />\
</object>\
");
}

function scriptx(){
document.write("<object id='factory' style='display:none' classid='clsid:1663ed61-23eb-11d2-b92f-008048fdd814' codebase='/recruit/ScriptX.cab#Version=6,1,431,8'></object>");
}






function ScrollTop(){
	parent.window.scroll(0,0);
}

function Img(n,tog){eval("document.m"+n+".src=m"+n+"_"+tog+".src"); } ///*??지 롤오?/

function autoBlur(){
	try{
		if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus(); 
	}catch(e) {}
}
document.onfocusin=autoBlur;




/* 게???이??*/
var old_answer = "";

function toggle(now_question,now_answer) {
	if(old_answer != now_answer) {
		if(old_answer != "") {
			old_answer.style.display = "none";
			old_question.className = ""
		}
		now_answer.style.display = "block";
		now_question.className = "now"
		old_answer = now_answer;
		old_question = now_question;
	} else {
		now_answer.style.display = "none";
		old_question.className = "over"
		old_answer = "";
		old_question = "";
	}
}

function over(now_answer,e) {
	if(now_answer.style.display != "block") {
		e.className = "over"
	}
}

function out(now_answer,e) {
	if(now_answer.style.display != "block") {
		e.className = ""
	}
}
/* 게???이??보?end */





/* ?메???직?start*/

var stmnLEFT = 0; // ?크롤?의 좌??치
var stmnGAP1 = 430; // ?이지 ?더부분???(????로???라가지 ?음) 
var stmnGAP2 = 400; // ?크롤?브?? ?단??간 ??. ?요?으?0?로 ?팅 
var stmnBASE = 630; // ?크롤??초??작?치 (??게??????? ???stmnGAP1??간 차이?주는?보?좋? 
var stmnActivateSpeed = 100; // ?직??감??는 ?도 (?자가 ?수?????아차? 
var stmnScrollSpeed = 10; // ?크롤???도 (?수?????직? 
var mainScroll = document.getElementsByTagName('html')[0];
//var mainScroll = document.body.scrollTop;


function RefreshStaticMenu() { 
	var stmnStartPoint, stmnEndPoint, stmnRefreshTimer; 
	stmnStartPoint = parseInt(document.getElementById('scrolling_div').style.top, 10); 
	stmnEndPoint = mainScroll.scrollTop + stmnGAP2 - 180; 
	if (stmnEndPoint < stmnGAP1) stmnEndPoint = stmnGAP1; 
	
	if ( stmnStartPoint != stmnEndPoint ) { 
	stmnScrollAmount = Math.ceil( Math.abs( stmnEndPoint - stmnStartPoint ) / 20); 
	document.getElementById('scrolling_div').style.top = parseInt(document.getElementById('scrolling_div').style.top, 10) + ( ( stmnEndPoint<stmnStartPoint ) ? -stmnScrollAmount : stmnScrollAmount ); 
	stmnRefreshTimer = stmnScrollSpeed; 

	} 
	
	else { 
		stmnRefreshTimer = stmnActivateSpeed; 
	}
	setTimeout ("RefreshStaticMenu();", stmnRefreshTimer); 

	}

function InitializeStaticMenu() { 
	document.getElementById('scrolling_div').style.top = mainScroll.scrollTop + stmnBASE; 
	RefreshStaticMenu(); 
	//document.getElementById('scrolling_div').style.left = stmnLEFT; 
} 


/*????*/

/*분?내*/
function sale_tab(index) {
	for(i=1; i<5; i++){
		if (index == i) {
			document.getElementById('Layer'+i).style.display = "";
			}else {
			document.getElementById('Layer'+i).style.display = "none";
			}
		}
	}

/*빌??형*/
function villa_tab(index) {
	for(i=1; i<5; i++){
		if (index == i) {
			document.getElementById('Layer'+i).style.display = "";
			}else {
			document.getElementById('Layer'+i).style.display = "none";
			}
		}
	}

/*??당메*/
function menu_tab(index) {
	for(i=1; i<6; i++){
		if (index == i) {
			document.getElementById('Layer'+i).style.display = "";
			}else {
			document.getElementById('Layer'+i).style.display = "none";
			}
		}
	}

/*?시?길*/
function map_tab(index) {
	for(i=1; i<8; i++){
		if (index == i) {
			document.getElementById('Layer'+i).style.display = "";
			}else {
			document.getElementById('Layer'+i).style.display = "none";
			}
		}
	}

/*?젤리아?파*/
function spa_tab(index) {
	for(i=1; i<3; i++){
		if (index == i) {
			document.getElementById('Layer'+i).style.display = "";
			}else {
			document.getElementById('Layer'+i).style.display = "none";
			}
		}
	}


function thema_tab(index) {
	for(i=1; i<7; i++){
		if (index == i) {
			document.getElementById('sLayer'+i).style.display = "";
			}else {
			document.getElementById('sLayer'+i).style.display = "none";
			}
		}
	}

/*그늘?/
function shadehouse_tab(index) {
	for(i=1; i<4; i++){
		if (index == i) {
			document.getElementById('Layer'+i).style.display = "";
			}else {
			document.getElementById('Layer'+i).style.display = "none";
			}
		}
	}

/*?약*/
function reservation_tab(index) {
	for(i=1; i<4; i++){
		if (index == i) {
			document.getElementById('Layer'+i).style.display = "";
			}else {
			document.getElementById('Layer'+i).style.display = "none";
			}
		}
	}

function reservation_tab_2(index) {
	for(i=1; i<7; i++){
		if (index == i) {
			document.getElementById('Layer'+i).style.display = "";
		}else {
			document.getElementById('Layer'+i).style.display = "none";
		}
	}
}

function reservation_tab_apply(index) {
	for(i=1; i<4; i++){
		if (index == i) {
			document.getElementById('Layer'+i).style.display = "";
		}else {
			document.getElementById('Layer'+i).style.display = "none";
		}
	}
}
/*????end */




/* iframe ?이 ?동 조?:: iframe ???용?? width 값? 고정px값?준??*/

function calcHeight(FrameName) 
{
  var the_height= document.getElementById(FrameName).contentWindow.document.body.scrollHeight; 
document.getElementById(FrameName).height=the_height; 
}


function iFrameResize(name){
       var oBody = document.body;
       if(parent.frames.length){
		var oFrame = parent.document.all(name);
		 if(oFrame){
           var min_height = 400; 
           var min_width = 600;
           var i_height = oBody.scrollHeight + (oBody.offsetHeight-oBody.clientHeight);
           var i_width = oBody.scrollWidth + (oBody.offsetWidth-oBody.clientWidth);
           if(i_height < min_height) i_height = min_height;
           if(i_width < min_width) i_width = min_width;
           oFrame.style.height = i_height;
           //oFrame.style.width = i_width;
		   //alert(oFrame.style.height);
         }else{
			 alert("error:"+oFrame);
		 }
       }
}
/* iframe ?이 ?동 조?end */



/* ???수집거부 ?업 */
function Popup3(){
    window.open('/membership/mem10_4.asp', '', 'left=0, top=0, width=640, height=330, toolbar=no, menubar=no, status=no, scrollbars=yes, resizable=no');
}


/* ??지 ?동 리사?즈??업?우?*/
function popupWindows(openurl, width_s, height_s, winname)
{
	var height = screen.height; 
	var width = screen.width; 
	var leftpos = 5; //width / 2 - width_s/2; 
	var toppos = 5; //height / 2 - height_s/2; 
	var imgwin = window.open(openurl,winname,'scrollbars=no,status=yes,toolbar=no,resizable=1,location=no,menu=no,width=' + width_s + ',height=' + height_s + ',left=' + leftpos + ',top=' + toppos); 
	imgwin.focus(); 
}


/* ?시?길 관???시 추? */

function about_tab(index) {
	for(i=1; i<4; i++){
		if (index == i) {
			document.getElementById('sLayer'+i).style.display = "";
			}else {
			document.getElementById('sLayer'+i).style.display = "none";
			}
		}
	}

//ajax ?성 ?수
function createRequest() {
	var xhr = null;

	try {
		xhr = new XMLHttpRequest();
	} catch(e) {
		try {
			xhr = ActiveXObject("Msxml2.XMLHTTP");
		} catch(e) {
			try {
				xhr = new ActiveXObject("Microsoft.XMLHTTP");
			} catch(e) {
				xhr = null;
			}
		}
	}
	return (xhr);
}

function adjustImage(target_img)
{
    var newHeight, newWidth;
    var newImg;
	var maxWidth=680,maxHeight=700;

    newImg = new Image();
    newImg.src = target_img.src;
    imgw = newImg.width;
    imgh = newImg.height;
    //maxHeight=imgh;
	if (imgw > maxWidth || imgh > maxHeight)
	{
		if(imgw > maxWidth)
			newWidth = maxWidth;
		else
			newWidth = imgw;
		if(imgh > maxHeight){
			newHeight = maxHeight;
			min_height=newHeight+50;
		}else{
			newHeight = imgh;
		}
    }else{
        newWidth = imgw;
        newHeight = imgh;        
    }
  if(newWidth>0){
    target_img.onload = null;
    target_img.src = newImg.src;
    target_img.width = newWidth;
    //target_img.height = newHeight;	
  }
  //window.status="maxHeight="+maxHeight+", newHeight="+newHeight+", imgh="+imgh;	
	
}


function FlashPlay(Url, tWidth, tHeight)
{
    var tmpStr = "";
    tmpStr += "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9.0.124.0' width='"+ tWidth +"' height='"+ tHeight +"' style='z-index:1'>"
    tmpStr += "<param name='movie' value='"+ Url +"'>"
    tmpStr += "<param name='quality' value='high'>"
    tmpStr += "<param name='wmode' value='transparent'>"
    tmpStr += "<param NAME='AllowScriptAccess' VALUE='always'> "
    tmpStr += "<param name='menu' value='false'>"
    tmpStr += "<param name='AutoSize' value='flase'>"
    tmpStr += "<embed src='"+ Url +"' width='"+ tWidth +"' height='"+ tHeight +"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' wmode='transparent' menu='false'></embed>"
    tmpStr += "</object>"

    document.write (tmpStr);
}
