
// title
//document.title="¢Æ¢Æ ¾ÆÁÖ¿¡ÀÌºñ½º·»ÅÍÄ« ¢Æ¢Æ";
document.title="¾ÆÁÖ¿¡ÀÌºñ½º¿¡ ¿À½Å °ÍÀ» È¯¿µÇÕ´Ï´Ù.";

var nlocation = document.location.toString();//ÇöÀç ÁÖ¼Ò°ª

var pub = "http://www.avis.co.kr";

var _SITE_URL_ = "http://www.avis.co.kr";

if( nlocation.indexOf('http://localhost')>=0){
	_SITE_URL_ = "http://localhost:8080/avisapp";
}

//------------------------------------------
//ÆäÀÌÁöº° ¹æ¹®¼ö Ä«¿îÆ®

var nn_path_name = document.location.pathname; //ÇöÀç ÆäÀÌÁö url ¿¡¼­ µµ¸ÞÀÎ Á¦ÇÏ°í µÚ¿¡ °ª (  /abc/abc.jsp )
var nn_search = document.location.search; //ÆäÀÌÁö °ª ÀÌÈÄ ?Æ÷ÇÔ ÀÌÈÄ°ª ( ?abc=10 )

if( nlocation.indexOf('avis.co.kr')>=0){
	var nn_search_handok = "";
	if(nn_path_name.indexOf('/customer/')>=0) {
		nn_search_handok = nn_search;
	}
	
	document.write('<img src=\"'+pub+'/inc/visit.jsp?path_name='+nn_path_name+nn_search_handok+'\" height=\"0\" width=\"0\" style="display:none;">');
}

//-------------------------------------------


var XMLpath = pub + "/inc/flash/";

Home=_SITE_URL_+"/index.jsp";

reservation=_SITE_URL_+"/reserve/domestic/reserve_main.jsp";  //¿Â¶óÀÎ ¿¹¾à 
	reservation01=_SITE_URL_+"/reserve/domestic/reserve_main.jsp";
	reservation02="javascript:foreign_rent()";
	reservation03=_SITE_URL_+"/reserve/rentpay/rent_payment.jsp";
	reservation04="javascript:popup('"+_SITE_URL_+"/reserve/helper/reserve_helper.jsp','help',640,600,'yes')";
	reservation05="javascript:popup('"+_SITE_URL_+"/reserve/helper/reserve_helper.jsp?rsv_btn=Y','help',640,600,'yes')";


use=_SITE_URL_+"/use/guide/guide.jsp";  //ÀÌ¿ë¾È³» 
	use01=_SITE_URL_+"/use/guide/guide.jsp";
	use02=_SITE_URL_+"/use/information/inland.jsp";
		use021=_SITE_URL_+"/use/information/inland.jsp";
		use0211=_SITE_URL_+"/use/information/jeju.jsp";
		use022=_SITE_URL_+"/use/information/driver.jsp";
		use023=_SITE_URL_+"/use/information/car01.jsp";
		use024=_SITE_URL_+"/use/information/estimate.jsp";
	use03=_SITE_URL_+"/use/shopinfo/branch.jsp";
		use031=_SITE_URL_+"/use/shopinfo/branch.jsp?flag=seoul";
		use032=_SITE_URL_+"/use/shopinfo/branch.jsp?flag=kg";
		use033=_SITE_URL_+"/use/shopinfo/branch.jsp?flag=cc";
		use034=_SITE_URL_+"/use/shopinfo/branch.jsp?flag=kw";
		use035=_SITE_URL_+"/use/shopinfo/branch.jsp?flag=ju";
		use036=_SITE_URL_+"/use/shopinfo/branch.jsp?flag=ks";
		use037=_SITE_URL_+"/use/shopinfo/branch.jsp?flag=jeju";
		use038=_SITE_URL_+"/use/shopinfo/branch.jsp?flag=T";
		use039=_SITE_URL_+"/use/shopinfo/branch.jsp?flag=A";
	use04=_SITE_URL_+"/use/longrent/long_info.jsp";
		use041=_SITE_URL_+"/use/longrent/long_info.jsp";
		use042=_SITE_URL_+"/use/longrent/long_catalogue.jsp";
		use043=_SITE_URL_+"/use/longrent/long_compare.jsp";
		use044=_SITE_URL_+"/use/longrent/long_manage.jsp";
		use045=_SITE_URL_+"/use/longrent/long_qna.jsp";
		use046=_SITE_URL_+"/use/longrent/long_estimate.jsp";
	use05=_SITE_URL_+"/use/month/month_info.jsp";
		use051=_SITE_URL_+"/use/month/month_info.jsp";
		use052=_SITE_URL_+"/use/month/month_estimate.jsp";		
		use053=_SITE_URL_+"/use/month/month_compare.jsp";
	use06=_SITE_URL_+"/camp/car01.jsp";
	use07=_SITE_URL_+"/use/autolease/auto_info.jsp";
		use071=_SITE_URL_+"/use/autolease/auto_info.jsp";
		use072=_SITE_URL_+"/use/autolease/auto_cost.jsp";		
		use073=_SITE_URL_+"/use/autolease/auto_compare.jsp";
		use074=_SITE_URL_+"/use/autolease/auto_estimate.jsp";
		
jeju=_SITE_URL_+"/jeju/index.jsp";
	jeju01=_SITE_URL_+"/jeju/recall/recall.jsp";
	jeju02=_SITE_URL_+"/jeju/pay/jeju.jsp";
	jeju03=_SITE_URL_+"/jeju/tourinfo/guide.jsp";
		jeju031=_SITE_URL_+"/jeju/tourinfo/guide.jsp";
		jeju032=_SITE_URL_+"/jeju/tourinfo/taste.jsp";
		jeju033=_SITE_URL_+"/jeju/tourinfo/custom.jsp";
		jeju034=_SITE_URL_+"/jeju/tourinfo/tour.jsp";
		jeju035=_SITE_URL_+"/jeju/tourinfo/course.jsp";
	jeju04=_SITE_URL_+"/jeju/coupon/coupon.jsp";		
		jeju041=_SITE_URL_+"/jeju/coupon/coupon_jeju.jsp";		
		jeju042=_SITE_URL_+"/jeju/coupon/coupon_east.jsp";		
		jeju043=_SITE_URL_+"/jeju/coupon/coupon_west.jsp";		
		jeju044=_SITE_URL_+"/jeju/coupon/coupon_middle.jsp";		
		jeju045=_SITE_URL_+"/jeju/coupon/coupon_seo.jsp";		
	
	
tour=_SITE_URL_+"/tour/cartel/cartel.jsp";  //¿¡ÀÌºñ½º ¿©ÇàÁ¤º¸   
	tour01=_SITE_URL_+"/tour/cartel/cartel.jsp";
		tour011=_SITE_URL_+"/tour/cartel/cartel_jeju.jsp";
tour0112=_SITE_URL_+"/tour/cartel/cartel_middle.jsp";
		tour0113=_SITE_URL_+"/tour/cartel/cartel_east.jsp";
		tour0114=_SITE_URL_+"/tour/cartel/cartel_west.jsp";
		tour012=_SITE_URL_+"/tour/cartel/cartel_kangwon.jsp";
		tour013=_SITE_URL_+"/tour/cartel/cartel_gyeongsang.jsp";
		tour014=_SITE_URL_+"/tour/cartel/cartel_ski.jsp";
		tour015=_SITE_URL_+"/tour/cartel/cartel_gyeonggi.jsp";
		tour016=_SITE_URL_+"/tour/cartel/cartel_chung.jsp";
		tour017=_SITE_URL_+"/tour/cartel/cartel_jeolla.jsp";
	tour02=_SITE_URL_+"/tour/webtour/webtour01.jsp";	
	tour03=_SITE_URL_+"/tour/webtour/webtour02.jsp";
	tour04=_SITE_URL_+"/tour/cpbook/cpbook01.jsp";
		tour041=_SITE_URL_+"/tour/cpbook/cpbook01.jsp";
		tour042=_SITE_URL_+"/tour/cpbook/cpbook03.jsp";
		tour043=_SITE_URL_+"/tour/cpbook/cpbook04.jsp";

//story=_SITE_URL_+"/story/index.jsp";  //¿¡ÀÌºñ½º ½ºÅä¸®  
story=_SITE_URL_+"/story/event/event.jsp";
	story01=_SITE_URL_+"/story/event/event.jsp";
		story011=_SITE_URL_+"/story/event/event.jsp";
		story0112=_SITE_URL_+"/story/event/event.jsp?sub_content=1";
		story0113=_SITE_URL_+"/story/event/event.jsp?sub_content=2";
		story012=_SITE_URL_+"/story/event/hotsale.jsp";
	story02=_SITE_URL_+"/story/news/notice.jsp";		
		story021=_SITE_URL_+"/story/news/notice.jsp";		
		story023=_SITE_URL_+"/story/newsletter/newsletter.jsp";
	story03=_SITE_URL_+"/story/webzine/webzine_list.jsp";
		story031=_SITE_URL_+"/story/webzine/webzine_list.jsp";
		story032=_SITE_URL_+"/story/webzine/travel_list.jsp";
		story033=_SITE_URL_+"/story/webzine/carlife_list.jsp";
		story034=_SITE_URL_+"/story/webzine/drive_tip.jsp";


//community=_SITE_URL_+"/community/index.jsp";   //Ä¿¹Â´ÏÆ¼
community=_SITE_URL_+"/story/trabel/list.jsp";
	community01=_SITE_URL_+"/story/trabel/list.jsp";
	community02=_SITE_URL_+"/story/carreview/list.jsp";
	community03=_SITE_URL_+"/community/avispoll/poll_list.jsp";

	if ( getLoginState() == "2" ) { //È¸¿øÀÏ °æ¿ì
		myavis=_SITE_URL_+"/myavis/member/my_benefit.jsp";   //my avis 
	}else if( getLoginState() == "1" ) {  //ºñÈ¸¿øÀÏ°æ¿ì
		myavis=_SITE_URL_+"/myavis/mem/member_privilege.jsp";   //my avis 
	}

	myinfo=GoLoginChk( _SITE_URL_+"/myavis/member/my_benefit.jsp" );
		myinfo01=GoLoginChk(_SITE_URL_+"/myavis/member/my_benefit.jsp");
		myinfo02=_SITE_URL_+"/myavis/member/coupon.jsp";
		myinfo03=_SITE_URL_+"/myavis/member/my_info_correct.jsp";
		myinfo04=_SITE_URL_+"/myavis/member/member_out.jsp";
	my_reserve=GoLoginChk(_SITE_URL_+"/myavis/reserve/current_reserve.jsp");
		my_reserve01=_SITE_URL_+"/myavis/reserve/current_reserve.jsp";
		my_reserve02=_SITE_URL_+"/myavis/reserve/passed_reserve.jsp";
		my_reserve03=_SITE_URL_+"/myavis/reserve/current_reserve_ext.jsp";
	benefit=_SITE_URL_+"/myavis/mem/member_privilege.jsp";
	
cust=_SITE_URL_+"/cust/faq/faq.jsp";	//°í°´¼¾ÅÍ 
	cust01=_SITE_URL_+"/cust/faq/faq.jsp";	//faq 
	cust02=_SITE_URL_+"/cust/qna/speed_call.jsp";	//¹®ÀÇÇÏ±â 
		cust021=_SITE_URL_+"/cust/qna/speed_call.jsp";	// 
		cust022=_SITE_URL_+"/cust/qna/mail_qna.jsp";	// 
		cust023=_SITE_URL_+"/use/information/estimate.jsp";	// 
		cust024=_SITE_URL_+"/use/longrent/long_estimate.jsp";	// 
	cust03=_SITE_URL_+"/cust/lost/lostcenter.jsp?category=L";	//ºÐ½Ç & ½Àµæ¼¾ÅÍ  
	
member=_SITE_URL_+"/member/member_check.jsp";
member2=_SITE_URL_+"/myavis/member/my_info_correct.jsp";
login=_SITE_URL_+"/member/login.jsp?reUrl="+encodeURIComponent(nn_path_name+nn_search);
logout =_SITE_URL_+"/member/logout.jsp";

res_settle=_SITE_URL_+"/myavis/reserve/current_reserve.jsp";

company=_SITE_URL_+"/etc/company.jsp";
	company01=_SITE_URL_+"/etc/company.jsp";
	company02=_SITE_URL_+"/etc/aboutus.jsp";
	company03=_SITE_URL_+"/etc/ceo.jsp";
	
	company04=pub+"/etc/history.jsp";
	company05=pub+"/etc/mission.jsp";
	company06=pub+"/etc/location.jsp";

//eng = "http://dev.avis.co.kr/eng/index.jsp";
eng = "http://www.avis.co.kr/eng/index.jsp";
sitemap=_SITE_URL_+"/etc/sitemap.jsp";
contactus=_SITE_URL_+"/etc/open_info.jsp";

recruit="javascript:new_win('http://recruit.aju.co.kr/')";
partner=_SITE_URL_+"/etc/open_info.jsp";
prov="javascript:popup('"+_SITE_URL_+"/etc/pop_prov.jsp','prov',710,600,'no')";
priv="javascript:popup('"+_SITE_URL_+"/etc/pop_priv.jsp','priv',730,600,'yes')";
legal=_SITE_URL_+"/etc/open_info.jsp";
spam="javascript:popup('"+_SITE_URL_+"/etc/pop_spam.jsp','spam',462,300,'no')";

commu01=_SITE_URL_+"/community/travel/list.jsp";
commu02=_SITE_URL_+"/community/photo/list.jsp";
commu03=_SITE_URL_+"/community/recommend_travel/list.jsp";
commu04=_SITE_URL_+"/community/recommend_drive/list.jsp";
commu05=_SITE_URL_+"/community/recommend_restaurant/list.jsp";
commu06=_SITE_URL_+"/community/recommend_movie/list.jsp";
commu07=_SITE_URL_+"/community/carreview/list.jsp";
commu08=_SITE_URL_+"/community/car_catalog/list.jsp";

//commu011=_SITE_URL_+"/community/travel/list.jsp?cate=15";
//commu012=_SITE_URL_+"/community/recommend_travel/list.jsp?cate=29";
//commu013=_SITE_URL_+"/community/recommend_restaurant/list.jsp?cate=34";
//commu014=_SITE_URL_+"/community/recommend_drive/list.jsp?cate=32";

commu011=_SITE_URL_+"/jeju/community/travel/list.jsp";
commu012=_SITE_URL_+"/jeju/community/recommend_travel/list.jsp";
commu013=_SITE_URL_+"/jeju/community/recommend_restaurant/list.jsp";
commu014=_SITE_URL_+"/jeju/community/recommend_drive/list.jsp";

//·Î±×ÀÎ ¾ÈµÇ¾î ÀÖ´Ù¸é ·Î±×ÀÎÆäÀÌÁö°ªÀ» ¸®ÅÏ
function GoLoginChk( tUrl ) {
	if ( getLoginState() == "2" ) { //·Î±×ÀÎ µÇ¾î ÀÖ´Ù¸é
		return tUrl;
	}else if( getLoginState() == "1" ) {  //·Î±×ÀÎ ¾ÈµÇ¾ú´Ù¸é
		return _SITE_URL_+"/member/login.jsp?reUrl="+encodeURIComponent( tUrl );
	}
}


function GoURL(name, win) {
	GoUrl(name, win);
}

function GoUrl(name, win) {

	if (name == null) {
		alert("¼­ºñ½º ÁØºñÁßÀÔ´Ï´Ù.");
		return;	
	} else {
		if (win == null) {
			if(name.indexOf("(") != -1) 	eval(name);
			else document.location.href = eval(name);
		} else {
			window.open(eval(name), win);
		}
	}
}

//--------------------------------------------------------------

//ÇØ¿Ü ¿¹¾à ÆË¾÷
function foreign_rent(){

	popup('http://book.rent-at-avis.com/avisonline/ibe.nsf/ReservationStep1?OpenForm&IBEOwner=KP','res_pop',610,600,'yes');
	
	if ( getCookie( "0708OPEN" ) != "done" ){
		window.open(pub+'/popup/0708/0708_pop.htm', '0708OPEN', 'width=360, height=348,  top=0,left=0').focus();
	}

	if ( getCookie( "0208OPEN" ) != "done" ){
		window.open(pub+'/popup/20060208/0208_pop.htm', '0208OPEN', 'width=360, height=480,  top=0,left=360').focus();
	}
}


//1Depth Menu rollOn 
function ImgPreLoad(imgTitle, imageNum) {
		imageNum++;
		rollOn = new Array(imageNum);
		rollOff = new Array(imageNum);
		for (j = 1; j <= imageNum; j++) {
			if (j < 10) {
				tmp = "0";
			} else {
				tmp ="";
			}
			rollOn[j] = new Image();
			rollOn[j].src = imgTitle + tmp + j + "_on.gif";
			rollOff[j] = new Image();
			rollOff[j].src = imgTitle + tmp + j + ".gif";
		}
	}
	function imgOn(Num) {
    if (rollOn[Num] != null) {	
				document["T"+Num].src = rollOn[Num].src;
		}
	}
	function imgOff(Num) {
		if (rollOn[Num] != null) {
			if (Num != _MCurrentOn) {
				document["T"+Num].src = rollOff[Num].src;
			}
      else {  
      document["T"+Num].src = rollOn[Num].src;
      }
	}
}

function PreImgLoad(Title, imgNum) {
		imgNum++;
		rollOver = new Array(imgNum);
		rollOut = new Array(imgNum);
		for (i = 1; i <= imgNum; i++) {
			if (i < 10) {
				tmp = "0";
			} else {
				tmp ="";
			}
			rollOver[i] = new Image();
			rollOver[i].src = Title + tmp + i + "_on.gif";
			rollOut[i] = new Image();
			rollOut[i].src = Title + tmp + i + ".gif";
		}
	}
	function imgOver(Num) {
    if (rollOver[Num] != null) {	
				document["S"+Num].src = rollOver[Num].src;
		}
	}
	function imgOut(Num) {
		if (rollOver[Num] != null) {
			if (Num != _SCurrentOn) {
				document["S"+Num].src = rollOut[Num].src;
			}
      else {  
      document["S"+Num].src = rollOver[Num].src;
    		 }
		}
	}

function BodyOnLoad() {
	imgOff(_MCurrentOn);
}

<!-- [Á¡¼± ¾ø¾Ö±â] ½ÃÀÛ ###########################################################################-->

/*
function allblur() {
	if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus(); 
}
document.onfocusin = allblur;
*/

function allblur() {
	for (i = 0; i < document.links.length; i++) {
		var obj = document.links[i];
		if(obj.addEventListener) obj.addEventListener("focus", oneblur, false);
		else if(obj.attachEvent) obj.attachEvent("onfocus", oneblur);
	}
}

function oneblur(e) {
	var evt = e ? e : window.event;
	if(evt.target) evt.target.blur();
	else if(evt.srcElement) evt.srcElement.blur();
}

<!-- [Á¡¼± ¾ø¾Ö±â] ³¡ ###########################################################################-->


// flashWrite(ÆÄÀÏ°æ·Î, °¡·Î, ¼¼·Î[, º¯¼ö][,¹è°æ»ö][,À©µµ¿ì¸ðµå])
function ObFlashW(url,w,h,vars,bg,win){
	
	var id=url.split("/")[url.split("/").length-1].split(".")[0]; //id´Â ÆÄÀÏ¸íÀ¸·Î ¼³Á¤
	if(vars==null) 	vars='';
	if(bg==null) 	bg='#FFFFFF';
	if(win==null) 	win='transparent';


	// ÇÃ·¡½Ã ÄÚµå Á¤ÀÇ
	var flashStr= "	<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'";
		flashStr+="			codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0'";
		flashStr+="			width='"+w+"'";
		flashStr+="			height='"+h+"'";
		flashStr+="			id='"+id+"'";
		flashStr+="			align='middle'>";

		flashStr+="		<param name='allowScriptAccess' value='always' />";
		flashStr+="		<param name='movie' value='"+url+"' />";
		flashStr+="		<param name='FlashVars' value='"+vars+"' />";
		flashStr+="		<param name='wmode' value='"+win+"' />";
		flashStr+="		<param name='menu' value='false' />";
		flashStr+="		<param name='quality' value='high' />";
		flashStr+="		<param name='bgcolor' value='"+bg+"' />";
	
	
		flashStr+="		<embed src='"+url+"'";
		flashStr+="		       flashVars='"+vars+"'";
		flashStr+="		       wmode='"+win+"'";
		flashStr+="		       menu='false'";
		flashStr+="		       quality='high'";
		flashStr+="		       bgcolor='"+bg+"'";
		flashStr+="		       width='"+w+"'";
		flashStr+="		       height='"+h+"'";
		flashStr+="		       name='"+id+"'";
		flashStr+="		       align='middle'";
		flashStr+="		       allowScriptAccess='always'";
		flashStr+="		       type='application/x-shockwave-flash'";
		flashStr+="		       pluginspage='http://www.macromedia.com/go/getflashplayer' />";
		flashStr+=" </object>";

	// ÇÃ·¡½Ã ÄÚµå Ãâ·Â
	document.write(flashStr);
}

//Popup 		

function popup(Fn,Win, X, Y, Scroll){
	l = (screen.width) ? (screen.width- X) / 2	: 0;
	t = (screen.height) ?	(screen.height- Y) / 2 : 0;	
	
	NewWindow=window.open(Fn,Win,'width='+X+',height='+Y+',top='+t+',left='+l+',scrollbars='+Scroll+',toolbar=no,location=no,directories=no,status=no,resizable=no,menubar=no');
	NewWindow.focus();
}

function new_win(win){
	w = window.open(win);
	w.focus();
}

//iframe ±æÀÌ ´Ã¾î³ª±â
function resizeHeight(fr) {
  fr = typeof fr == 'string' ? document.getElementById(fr) : fr;
  fr.setExpression('height',detail.document.body.scrollHeight);
}
function resizeHeight2(fr) {
  fr = typeof fr == 'string' ? document.getElementById(fr) : fr;
  fr.setExpression('height',clearance.document.body.scrollHeight);
}

// Å¾¹öÆ°½ºÅ©·Ñ
function goTop(orix,oriy,desx,desy) {
		var Timer;
		var winHeight = document.body.scrollTop;
		if(Timer) clearTimeout(Timer);
		startx = 0;
		starty = winHeight;
		if(!orix || orix < 0) orix = 0;
		if(!oriy || oriy < 0) oriy = 0;
		var speed = 7;
		if(!desx) desx = 0 + startx;
		if(!desy) desy = 0 + starty;
		desx += (orix - startx) / speed;
		if (desx < 0) desx = 0;
		desy += (oriy - starty) / speed;
		if (desy < 0) desy = 0;
		var posX = Math.ceil(desx);
		var posY = Math.ceil(desy);
		window.scrollTo(posX, posY);
		if((Math.floor(Math.abs(startx - orix)) < 1) && (Math.floor(Math.abs(starty - oriy)) < 1)){
			clearTimeout(Timer);
			window.scroll(orix,oriy);
		}else if(posX != orix || posY != oriy){
			Timer = setTimeout("goTop("+orix+","+oriy+","+desx+","+desy+")",15);
		}else{
			clearTimeout(Timer);
		}
	}	

function getPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = window.innerWidth + window.scrollMaxX;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	
//	console.log(self.innerWidth);
//	console.log(document.documentElement.clientWidth);

	if (self.innerHeight) {	// all except Explorer
		if(document.documentElement.clientWidth){
			windowWidth = document.documentElement.clientWidth; 
		} else {
			windowWidth = self.innerWidth;
		}
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

//	console.log("xScroll " + xScroll)
//	console.log("windowWidth " + windowWidth)

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = xScroll;		
	} else {
		pageWidth = windowWidth;
	}
//	console.log("pageWidth " + pageWidth)

	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}

var bNetscape4plus = (navigator.appName == "Netscape" && navigator.appVersion.substring(0,1) >= "4");
var bExplorer4plus = (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.substring(0,1) >= "4");
function CheckUIElements(){
  var yMenuFrom, yMenuTo, yButtonFrom, yButtonTo, yOffset, timeoutNextCheck;
	var ie=document.all&&navigator.userAgent.indexOf("Opera")==-1
	var ne=document.getElementById==-1
	var window_height=ie? document.body.clientHeight : window.innerHeight
	var window_height1=ne? document.getElementById.clientHeight : window.innerHeight

	arrayPageSize = getPageSize();
	var stmnLEFT = 960 + (arrayPageSize[0]-950)/2;
	
  if ( bNetscape4plus ) {
    yMenuFrom   = document["divMenu"].top;
    yMenuTo     = top.pageYOffset  + window_height - 130;
  }
  else if ( bExplorer4plus ) {
    yMenuFrom   = parseInt (divMenu.style.top, 10);
    yMenuTo     = document.body.scrollTop  + window_height - 130;
  }
/*
arrayPageSize = getPageSize();
		//alert(arrayPageSize[2]);
		var stmnLEFT = 960 + (arrayPageSize[0]-960)/2;
*/

  timeoutNextCheck = 500;

  if ( Math.abs (yButtonFrom - (yMenuTo + 152)) < 6 && yButtonTo < yButtonFrom ) {
    setTimeout ("CheckUIElements()", timeoutNextCheck);
    return;
  }

  if ( yButtonFrom != yButtonTo ) {
    yOffset = Math.ceil( Math.abs( yButtonTo - yButtonFrom ) / 10 );
    if ( yButtonTo < yButtonFrom )
      yOffset = -yOffset;

    if ( bNetscape4plus )
      document["divLinkButton"].top += yOffset;
    else if ( bExplorer4plus )
      divLinkButton.style.top = parseInt (divLinkButton.style.top, 10) + yOffset;

    timeoutNextCheck = 10;
  }
  if ( yMenuFrom != yMenuTo ) {
    yOffset = Math.ceil( Math.abs( yMenuTo - yMenuFrom ) / 20 );
    if ( yMenuTo < yMenuFrom )
      yOffset = -yOffset;

    if ( bNetscape4plus ) {
      document["divMenu"].left = stmnLEFT + 'px';
      document["divMenu"].top += yOffset;
    } else if ( bExplorer4plus ) {
      divMenu.style.left = stmnLEFT + 'px';
      divMenu.style.top = parseInt (divMenu.style.top, 10) + yOffset;
	}
	
    timeoutNextCheck = 10;
  }

  setTimeout ("CheckUIElements()", timeoutNextCheck);
}

function OnLoad(){
	allblur();
	var y;
	arrayPageSize = getPageSize();
	var stmnLEFT = 960 + (arrayPageSize[0]-950)/2;
		
	if ( top.frames.length )
	if ( bNetscape4plus ) {
		document['divMenu'].left = stmnLEFT + 'px';
		document["divMenu"].top = top.pageYOffset + 135;
		document["divMenu"].visibility = "visible";
	}
	else if ( bExplorer4plus ) {
		divMenu.style.left = stmnLEFT + 'px';
		divMenu.style.top = document.body.scrollTop + 135;
		divMenu.style.visibility = "visible";
	}
	CheckUIElements();
	return true;
}

/************************************************************/