//-----------------------------------------------------------------------------------
// 플래시 테두리없이 보이는 자바스크립트
//-----------------------------------------------------------------------------------
/*
function mailCheck()
{
	//alert('email send test');

	frm_check =  document.frm_email;

	if(frm_check.name.value ==""){

		alert("이름을 입력 하세요");
		frm_check.name.value = "";
		frm_check.name.focus();
		return false;
	}

	if(frm_check.email.value ==""){

		alert("이메일을 입력 하세요");
		frm_check.email.value = "";
		frm_check.email.focus();
		return false;
	}

	if(frm_check.title.value ==""){

		alert("제목을 입력 하세요");
		frm_check.title.value = "";
		frm_check.title.focus();
		return false;
	}

	if(frm_check.contents.value ==""){

		alert("내용을 입력 하세요");
		frm_check.contents.value = "";
		frm_check.contents.focus();
		return false;
	}

	frm_check.submit();
}
*/


//-----------------------------------------------------------------------------------
// 플래시 테두리없이 보이는 자바스크립트
//-----------------------------------------------------------------------------------

function playflash(file,width,height,bgcolor,quality,name){
        document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+width+'" height="'+height+'" id="'+name+'">');
        document.write('<param name="movie" value="'+file+'" />');
        document.write('<param name="quality" value="'+quality+'" />');
        document.write('<param name="wmode" value="transparent" />');
        document.write('<param name="bgcolor" value="'+bgcolor+'" />');
        document.write('<embed src="'+file+'" quality="'+quality+'" wmode="transparent" bgcolor="'+bgcolor+'" width="'+width+'" height="'+height+'" name="'+name+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
        document.write('</object>')
}

function embedFlash(id, url, width, height, bgcolor, quality, altText, flashVars, wmode) {
	if (!flashVars) flashVars = '';
	if (!wmode) wmode = 'window';
	if (!altText) altText = document.getElementById('altText').innerHTML;

	var str = '' +
	'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0" width="' + width + '" height="' + height + '" id="' + id + '">' +
		'<param name="movie" value="' + url + '" />' +
		'<param name="wmode" value="' + wmode + '" />' +
		'<param name="FlashVars" value="' + flashVars + '" />' +
		'<param name="quality" value="' + quality + '" />' +
		'<param name="bgcolor" value="' + bgcolor + '" />' +
		'<!--[if !IE]>-->' +
		'<object type="application/x-shockwave-flash" data="' + url + '" width="' + width + '" height="' + height + '" name="' + id + '">' +
			'<param name="wmode" value="' + wmode + '" />' +
			'<param name="FlashVars" value="' + flashVars + '" />' +
		'<!--<![endif]-->' +
			'<div class="alt-content alt-' + id + '">' + altText + '</div>' +
		'<!--[if !IE]>-->' +
		'</object>' +
		'<!--<![endif]-->' +
	'</object>';
	document.write(str);
}


//-----------------------------------------------------------------------------------
// 메인페이지 롤오버 자바스크립트_1
//-----------------------------------------------------------------------------------
bbsclicknum2 = 1;
imgarray2 = new Array();
imgarray_r2 = new Array();
for(i=1; i<4; i++){
    imgarray2[i-1] = new Image();
    imgarray2[i-1].src = "/images/main_data_tab_"+i+"_off.gif";
    imgarray_r2[i-1] = new Image();
    imgarray_r2[i-1].src = "/images/main_data_tab_"+i+"_on.gif";
}

function bbsOver2(num){

	if(bbsclicknum2 != num){
		try{
			var cnt2 = 0;
			var noticea2 = document.getElementById("noticea");
			cnt2++;
			eval("document.getElementById('ndiv_"+num+"').style.display = '';");
			cnt2++;
			eval("document.getElementById('ndiv_"+bbsclicknum2+"').style.display = 'none';");
			cnt2++;
			eval("document.getElementById('fourthbox_tab_img"+(num)+"').src = '"+imgarray_r2[num-1].src+"'");
			cnt2++;
			eval("document.getElementById('fourthbox_tab_img"+(bbsclicknum2)+"').src = '"+imgarray2[bbsclicknum2-1].src+"'");
			cnt2++;
        bbsclicknum2 = num;
		}catch(e){ alert(e.message+":"+cnt2); }
    }
    return;
}


//-----------------------------------------------------------------------------------
// 메인페이지 롤오버 자바스크립트_2
//-----------------------------------------------------------------------------------

			function topOn(tabid,a) {
        var ID = document.getElementById(tabid,a);

				for (i=1;i<=10;i++) {
					if(i<10){inn="0"+i;} else {inn=""+i;}
					topMenu = document.getElementById("top"+tabid+"m"+i);
					topContent = document.getElementById("top"+tabid+"c"+i);
					if (topMenu) { //객체가존재하면
						if (topMenu.tagName=="IMG") { topMenu.src = topMenu.src.replace("on0" + i + ".gif", "off0" + i + ".gif");} //이미지일때
						if (topMenu.tagName=="A") { topMenu.className=""; } //앵커일때
					}
					if (topContent) { topContent.style.display="none"; }
				}

				if(a<10){ann="0"+a;} else {ann=""+a;}
				topMenu = document.getElementById("top"+tabid+"m"+a);
				topContent = document.getElementById("top"+tabid+"c"+a);
				//alert(topMenu.tagName);
				if (topMenu) { //객체가존재하면
					if (topMenu.tagName=="IMG") { topMenu.src = topMenu.src.replace("off0" + a + ".gif", "on0" + a + ".gif"); } //이미지일때
					if (topMenu.tagName=="A") { topMenu.className="on"; } //앵커일때
				}
				if (topContent) { topContent.style.display="block"; }
				topMore = document.getElementById("top"+tabid+"more");
				}

//-----------------------------------------------------------------------------------
// 서브페이지 왼쪽 메뉴 롤오버 자바스크립트
//-----------------------------------------------------------------------------------

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];}
}


// Familysite
function show_con(idName)	{
	var obj = document.getElementById(idName);
	obj.style.top = "-64px";
}

function hide_con(idName)	{
	var obj = document.getElementById(idName);
	obj.style.top = "-9000px";
}


//-----------------------------------------------------------------------------------
// 새창띄우는 소스
//-----------------------------------------------------------------------------------
function na_open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
  toolbar_str = toolbar ? 'yes' : 'no';
  menubar_str = menubar ? 'yes' : 'no';
  statusbar_str = statusbar ? 'yes' : 'no';
  scrollbar_str = scrollbar ? 'yes' : 'no';
  resizable_str = resizable ? 'yes' : 'no';
  window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}


//-----------------------------------------------------------------------------------
// 화면확대축소
//-----------------------------------------------------------------------------------
var KeyEvent_F		= "1";							// 버튼 이벤트 활성화(1:활성화, 0:비활성화)
var Otder_browser	= "F";			/* !IE 활성화 여부(T:활성화, F:비활성화) */

var FrameLength;
var FrameTopName;
var FrameMainName;

//FrameLength = parent.frames.length;
FrameLength = document.getElementsByTagName("frame").length;
if( FrameLength == 2  || FrameLength == 3 ){
	FrameTopName = "parent.frames[0].";
	FrameMainName = "parent.frames[1].";
}

function NetReader(Code){

	if (!window.ActiveXObject) {
	/*}
	else{*/

		if ( Otder_browser == "F" ){	//!IE일경우 비활성화이면 리턴
			alert("NetLight는 Internet  Explorer 에서만 지원합니다.");
			if (!window.ActiveXObject) return;
		}
	}

	var value = NetReader.arguments;

	//초기화
	if( Code == "ReSet" ){
		if(ReadCookie("VoiceStart") == "start"){
			setCookie("VoiceSpeed", "3", 1);
			NetLightCOM.VoiceSpeed="3";
			setCookie("VoiceVolum", "3", 1);
			NetLightCOM.VoiceVolume="3";
		}
			setCookie("bgColorIndex", 0, 1);
			f_setBgColor("0");
			setCookie("fontColorIndex", 0, 1);
			f_setFontColor("0");
			setCookie("zoomVal", "100%", 7);
			zoomInOut("");
			//setCookie("fontSize", "9", 1);
			//f_fontreset("9");
	}

	if(KeyEvent_F == 1){ //사이트 폭주 등 임시로 이벤트를 막고 싶을때 사용

		//화면크기 크게
		if( Code == "ZoomUp" ){
			if( FrameLength == 2 ){
				eval(FrameMainName +"zoomInOut('in');");
			}else{
				zoomInOut('in');
			}
		}

		//화면크기 작게
		if( Code == "ZoomDown" ){
			if( FrameLength == 2 ){
				eval(FrameMainName +"zoomInOut('out');");
			}else{
				zoomInOut('out');
			}
		}

	}else{
		if(KeyEvent_F_F == 1){
		alert(KeyEvent_F_M);
		}
	}

}

var zoomRate = 20;			// 확대/축소시 증감률
var maxRate = 200;			//최대확대률
var minRate = 100;			//최소축소률
var ScreenSize = 100;		//ScreenSize Default


var beforeBgColor;
var beforeTag;
var beforeTableTag;


/*****************************************************************/
//쿠키값 읽기
/*****************************************************************/

function ReadCookie( str )
{
  var key = str + "=";
  var key_len = key.length;
  var cookie_len = document.cookie.length;

  var i = 0;
  while ( i <= cookie_len ){
    var j = i + key_len;
    if ( document.cookie.substring( i, j ) == key ){
		var cookie_end = document.cookie.indexOf( ";", j );
		if ( cookie_end == -1 )
			cookie_end = document.cookie.length;
		return unescape( document.cookie.substring( j, cookie_end ) );
    }
    i = document.cookie.indexOf( " ", i ) + 1;

    if ( i == 0 )  break;
  }
  return "";
}

/*****************************************************************/
//쿠키값 쓰기
/*****************************************************************/
function setCookie( key, value, term ){
	var expire = new Date();
	expire.setDate( expire.getDate() + term );
	document.cookie = key + "=" + escape( value ) + "; path=/; expires=" + expire.toGMTString() + ";";
}


/*****************************************************************/
/*Init()*/
/*****************************************************************/
function f_FontInit(){

	if ( ReadCookie("zoomVal").length == 0 ){
		setCookie("zoomVal", "100%", 7);
	}else currZoom = ReadCookie("zoomVal")+"%";		//화면크기
	zoomInOut("");

	f_setFace();

}

/*********************************************************/
//화면확대
/*********************************************************/

function zoomInOut(how){
var sValue;

	if(ReadCookie("zoomVal") != null && ReadCookie("zoomVal") != "" && ReadCookie("zoomVal") != "NaN"){
		if( FrameLength == 2  ){
			eval(FrameMainName +"document.getElementById('wrap')").style.zoom = ReadCookie("zoomVal")+"%";
		}else{
			document.getElementById("wrap").style.zoom = ReadCookie("zoomVal")+"%";
		}
		currZoom=ReadCookie("zoomVal");
	}else{
		if( FrameLength == 2 ){
			eval(FrameMainName +"document.getElementById('wrap')").style.zoom = "100%";
		}else{
			document.getElementById("wrap").style.zoom = "100%";
		}
		currZoom = "100%";
	}

	if ( ((how == "in") && (parseInt(currZoom) >= maxRate)) || ((how == "out") && (parseInt(currZoom) <= minRate)) ) {
		return;
	}

	if (how == "in") {
		if( FrameLength == 2 )
			eval(FrameMainName +"document.getElementById('wrap')").style.zoom = parseInt(eval(FrameMainName +"document.getElementById('wrap')").style.zoom)+zoomRate+"%";
		else
			document.getElementById("wrap").style.zoom = parseInt(document.getElementById("wrap").style.zoom)+zoomRate+"%";
	}else if( how == "out" ){
		if( FrameLength == 2 )
			eval(FrameMainName +"document.getElementById('wrap')").style.zoom = parseInt(eval(FrameMainName +"document.getElementById('wrap')").style.zoom)-zoomRate+"%";
		else
			document.getElementById("wrap").style.zoom = parseInt(document.getElementById("wrap").style.zoom)-zoomRate+"%";
	}

	if( FrameLength == 2 ){
			sValue = parseInt(eval(FrameMainName +"document.getElementById('wrap')").style.zoom);
	}else{
			sValue = parseInt(document.getElementById("wrap").style.zoom);
	}
 setCookie("zoomVal", sValue, 1);
}

/*********************************************************/
//Object 유/무
/*********************************************************/
function NetlightObjectType(netlight){
	if(netlight.object){
		return true;
	}else{
		return false;
	}
}


//-----------------------------------------------------------------------------------
// 검색박스
//-----------------------------------------------------------------------------------
function fsearchbox_submit(f)
{
	if (f.stx.value == '')
	{
		alert("검색어를 입력해주세요.");
		f.stx.select();
		f.stx.focus();
		return;
	}

	f.action = "/08board_07.html";
	f.submit();
}

function sFocus(vari) {
	(vari).style.border='1px solid #1e1d1d';
	(vari).style.background='#1e1d1d none';
	(vari).style.letterSpacing='normal';
}
function sBlur(vari) {
	(vari).style.border='1px solid #1e1d1d';
}


//-----------------------------------------------------------------------------------
// top_menu
//-----------------------------------------------------------------------------------
function initNavigation(seq) {
	nav = document.getElementById("topmenu");
	nav.menu = new Array();
	nav.current = null;
	nav.menuseq = 0;
	navLen = nav.childNodes.length;

	allA = nav.getElementsByTagName("a")
	for(k = 0; k < allA.length; k++) {
		allA.item(k).onmouseover = allA.item(k).onfocus = function () {
			nav.isOver = true;
		}
		allA.item(k).onmouseout = allA.item(k).onblur = function () {
			nav.isOver = false;
			setTimeout(function () {
				if (nav.isOver == false) {
					if (nav.menu[seq])
						nav.menu[seq].onmouseover();
					else if(nav.current) {
						menuImg = nav.current.childNodes.item(0);
						menuImg.src = menuImg.src.replace("_on.gif", ".gif");
						if (nav.current.submenu)
							nav.current.submenu.style.display = "none";
						nav.current = null;
					}
				}
			}, 500);
		}
	}

	for (i = 0; i < navLen; i++) {
		navItem = nav.childNodes.item(i);
		if (navItem.tagName != "LI")
			continue;

		navAnchor = navItem.getElementsByTagName("a").item(0);
		navAnchor.submenu = navItem.getElementsByTagName("ul").item(0);

		navAnchor.onmouseover = navAnchor.onfocus = function () {
			if (nav.current) {
				menuImg = nav.current.childNodes.item(0);
				menuImg.src = menuImg.src.replace("_on.gif", ".gif");
				if (nav.current.submenu)
					nav.current.submenu.style.display = "none";
				nav.current = null;
			}
			if (nav.current != this) {
				menuImg = this.childNodes.item(0);
				menuImg.src = menuImg.src.replace(".gif", "_on.gif");
				if (this.submenu)
					this.submenu.style.display = "block";
				nav.current = this;
			}
			nav.isOver = true;
		}
		nav.menuseq++;
		nav.menu[nav.menuseq] = navAnchor;
	}
	if (nav.menu[seq])
		nav.menu[seq].onmouseover();
}



/////////////////////////////////////////////////////////
// 공통 페이지프린트 함수
// 방법 : 인쇄하고자 하는 영역을 <print> </print>로 감싸줌
// 자바스크립트만으로 인쇄하는 기능
function ps_page_print(){
	popup('/inc/print.html', 600, 500);
}

function ps_page_print2(){
	popup('/inc/print_2.html', 600, 500);
}

//서브프린트
function contentPrint(){
	window.open("/gboard/skin/n_print.html", "printPage", "scrollbars=yes width=662 height=600");
}


//메인프린트
function contentPrint2(){
	window.open("/n_print2.html", "printPage", "scrollbars=yes width=862 height=600");
}


//서브프린트_약도
function contentPrint3(){
	window.open("/gboard/skin/n_print2.html", "printPage", "scrollbars=yes width=642 height=700");
}

//서브프린트_약도
function contentPrint4(){
	window.open("/gboard/skin/n_print3.html", "printPage", "scrollbars=yes width=642 height=450");
}

///////////////////////////////////////////////////////////
// 팝업 기능관련
// @url URL
// @w 폭
// @h 너비
// @s 스크롤바 여부 1, 'Y'이면 보여줌, 0, '', 'N'이면 숨김
function popup(url,w,h,s){
	var l, t, objPopup;
	l = (screen.width-w)/2;
	t = (screen.height-h)/2;
	if(s==1 || s=="Y")
		objPopup  = window.open(url,'','width='+w+',height='+h+',left='+l+',top='+t+',resizable=0,scrollbars=1');
	else if (s=="" || s==0 || s=="N" || !s)
		objPopup = window.open(url,'','width='+w+',height='+h+',left='+l+',top='+t+',resizable=0,scrollbars=0,status=0');
	else
		objPopup = window.open(url,'','width='+w+',height='+h+',left='+l+',top='+t+',resizable=1,menubar=1,toolbar=1,scrollbars=1,status=1');
	if (objPopup == null) {
		alert("차단된 팝업창을 허용해 주십시오.");
	}
	return objPopup;

}


function popupEx(url,w,h,s){
	var objPopup;

	if(s==1 || s=="Y")
		objPopup  = window.open(url,'','width='+w+',height='+h+',resizable=0,scrollbars=1');
	else if (s=="" || s==0 || s=="N" || !s)
		objPopup = window.open(url,'','width='+w+',height='+h+',resizable=0,scrollbars=0,status=0');
	else
		objPopup = window.open(url,'','width='+w+',height='+h+',resizable=1,menubar=1,toolbar=1,scrollbars=1,status=1');
	if (objPopup == null) {
		alert("차단된 팝업창을 허용해 주십시오.");
	}
	return objPopup;

}

function openWin(url,w,h){
	window.open(url,"",'width='+w+',height='+h+',resizable=0,scrollbars=0,status=0');
}


/////////////////////////////////////////////////////////
// 공통 페이지프린트 함수
// 방법 : 인쇄하고자 하는 영역을 <print> </print>로 감싸줌
// 자바스크립트만으로 인쇄하는 기능
function ps_page_print(){
	popup('/inc/print.html', 600, 500);
}

function ps_page_print2(){
	popup('/inc/print_2.html', 600, 500);
}

//서브프린트
function contentPrint(){
	window.open("/gboard/skin/n_print.html", "printPage", "scrollbars=yes width=662 height=600");
}


//메인프린트
function contentPrint2(){
	window.open("/n_print2.html", "printPage", "scrollbars=yes width=862 height=600");
}


//서브프린트_약도
function contentPrint3(){
	window.open("/gboard/skin/n_print2.html", "printPage", "scrollbars=no width=665 height=650");
}

//서브프린트_약도
function contentPrint4(){
	window.open("/gboard/skin/n_print3.html", "printPage", "scrollbars=yes width=642 height=450");
}

//패밀리사이트 레이어
function layershow( icnt ) {
	document.getElementById("family"+icnt).style.display = "block";
}
function layerhidden( icnt ) {
	document.getElementById("family"+icnt).style.display = "none";
}

function fsite_hide(){
old = null;
document.getElementById("family1").style.display="none";
}
function fsite_show(){
	old = null;
	document.getElementById("family1").style.display="";
}

function fsite_hide2(){
old = null;
document.getElementById("family2").style.display="none";
}
function fsite_show2(){
	old = null;
	document.getElementById("family2").style.display="";
}



/*---------------------------------------------------------------------------------------------------------*/
// 퀵메뉴
/*---------------------------------------------------------------------------------------------------------*/

function getPosition(){
	var start, end, scale, term;
	start = parseInt (document.getElementById('quicktop').style.top, 0);
	end = document.documentElement.scrollTop + 0;
	term = 5;

	if ( start != end ) {
	scale = Math.ceil( Math.abs( end - start ) / 20 );
		if ( end < start )	scale = -scale;
		document.getElementById('quicktop').style.top = parseInt (document.getElementById('quicktop').style.top, 0)+ scale + "px";
		term = 1;
	}
	setTimeout ("getPosition()", term);
}
function moveBanner() {
	document.getElementById('quicktop').style.top = document.documentElement.scrollTop + 0 + "px"; //숫자가 같으면 슬라이드 없다.
	getPosition();
	return true;
}

function quickBanner(quickId, margin_top, limit_top)
{
	var quickObj, quickObjTop, margin_top, max;
	quickObj = document.getElementById(quickId);
	quickObjTop = quickObj.style.top.toInteger();
	max = 335;
	spead = 20;
	if (limit_top == "") { limit_top = quickObjTop; }

	quickObjTop *= 1;
	limit_top *= 1;
	margin_top *= 1;

	s = document.body.scrollTop + "";

	target_height = s.toInteger() + margin_top;
	if(target_height < limit_top) {
		target_height = quickObjTop;
	}

	body_height = document.body.scrollHeight;
	t = quickObj.style.top.toInteger();
	var t_bottom = (body_height - (t+260));

	if(t_bottom>max||target_height<t)
	{
		if(t != target_height)
		{
			g = Math.ceil(((t - target_height) / 5));
			//alert(t+" "+target_height+" "+(t - target_height)+" "+g);
			if(g > 50) {
				g = 50;
			} else if (g < -50) {
				g = -50;
			}

			if(g == 0 && (t - target_height) < 0) {
				quickObj.style.top = (t + 1) + "px";
			} else {
				quickObj.style.top = (t - g) + "px";
			}
		}
	}

	setTimeout("quickBanner('"+ quickId +"', "+ margin_top +", "+ limit_top +");", spead);
}

String.prototype.toInteger = function() {
	return this.replace(/[^0-9]/g, '') * 1;
}

/*---------------------------------------------------------------------------------------------------------*/
//Floating v1.1 Source By Bermann
//dobermann75@gmail.com
/*---------------------------------------------------------------------------------------------------------*/

//new Floating(적용할개체 , X축여백 , Y축여백 , 미끄러지는속도:작을수록빠름..기본20 , 빠르기:작을수록부드러움..기본10);

function Floating(FloatingObj,MarginX,MarginY,Percentage,setTime) {
	this.FloatingObj = FloatingObj;
	this.MarginX = (MarginX) ? MarginX : 0;
	this.MarginY = (MarginY) ? MarginY : 0;
	this.Percentage = (Percentage) ? Percentage : 20;
	this.setTime = (setTime) ? setTime : 10;
	this.FloatingObj.style.position = "absolute";
	this.Body = null;
	this.setTimeOut = null;
	this.Run();
}

Floating.prototype.Run = function () {
	if ((document.documentElement.scrollLeft + document.documentElement.scrollTop) > (document.body.scrollLeft + document.body.scrollTop)) {
		this.Body = document.documentElement;
	} else {
		this.Body = document.body;
	}

	var This = this;
	var FloatingObjLeft = (this.FloatingObj.style.left) ? parseInt(this.FloatingObj.style.left,10) : this.FloatingObj.offsetLeft;
	var FloatingObjTop = (this.FloatingObj.style.top) ? parseInt(this.FloatingObj.style.top,10) : this.FloatingObj.offsetTop;
	var DocLeft = this.Body.scrollLeft + this.MarginX;
	var DocTop = this.Body.scrollTop + this.MarginY;

	var MoveX = Math.abs(FloatingObjLeft - DocLeft);
	MoveX = Math.ceil(MoveX / this.Percentage);
	var MoveY = Math.abs(FloatingObjTop - DocTop);
	MoveY = Math.ceil(MoveY / this.Percentage);

//	if (FloatingObjLeft < DocLeft) {
//		this.FloatingObj.style.left = FloatingObjLeft + MoveX + "px";
//	} else {
//		this.FloatingObj.style.left = FloatingObjLeft - MoveX + "px";
//	}

	if (FloatingObjTop < DocTop) {
		this.FloatingObj.style.top = FloatingObjTop + MoveY + "px";
	} else {
		this.FloatingObj.style.top = FloatingObjTop - MoveY + "px";
	}

	window.clearTimeout(this.setTimeOut);
	this.setTimeOut = window.setTimeout(function () { This.Run(); },this.setTime);
}

