var menuTopMargin	= -70;
var menuSpeed		= 4;
var timerSpeed		= 100;
var timer;
var heightLimit	= 0;

function checkBannerRight() {
	if(document.body.offsetHeight > heightLimit) {
		var reTimer = timerSpeed;
		var startPoint = parseInt(document.all.rightBannerScroll.style.top,10);
		var endPoint = document.body.scrollTop;
		endPoint = (menuTopMargin <= endPoint ) ? endPoint - menuTopMargin : 0;
		if(startPoint != endPoint) {
			moveAmount = Math.ceil(Math.abs(endPoint - startPoint) / 15);
			document.all.rightBannerScroll.style.top = parseInt(document.all.rightBannerScroll.style.top,10) + ((endPoint<startPoint) ? -moveAmount : moveAmount);
			reTimer = menuSpeed;
		}
	} else document.all.sMenu.style.top = 0;
	timer = setTimeout("checkBannerRight();",reTimer);
}
function initBannerRight() {
	if(document.body.offsetHeight > heightLimit) document.all.leftBannerScroll.style.top = document.body.scrollTop;
	checkBannerLeft();
}
function checkBannerLeft() {
	if(document.body.offsetHeight > heightLimit) {
		var reTimer = timerSpeed;
		var startPoint = parseInt(document.all.leftBannerScroll.style.top,10);
		var endPoint = document.body.scrollTop;
		endPoint = (menuTopMargin <= endPoint ) ? endPoint - menuTopMargin : 0;
		if(startPoint != endPoint) {
			moveAmount = Math.ceil(Math.abs(endPoint - startPoint) / 15);
			document.all.leftBannerScroll.style.top = parseInt(document.all.leftBannerScroll.style.top,10) + ((endPoint<startPoint) ? -moveAmount : moveAmount);
			reTimer = menuSpeed;
		}
	} else document.all.sMenu.style.top = 0;
	timer = setTimeout("checkBannerLeft();",reTimer);
}
function initBannerLeft() {
	if(document.body.offsetHeight > heightLimit) document.all.leftBannerScroll.style.top = document.body.scrollTop;
	checkBannerRight();
}

//Function banner scroll
function bannerScroll(){
	if(document.body.clientWidth >= 1000){
		document.all.leftBannerScroll.style.display 	= "inline";
		document.all.rightBannerScroll.style.display	= "inline";
		document.all.leftBannerScroll.style.top		= 0;
		document.all.rightBannerScroll.style.top		= 0;
		if(navigator.appName == "Microsoft Internet Explorer"){
			document.all.leftBannerScroll.style.left	= (document.body.clientWidth-con_page_size)/2 - 112;
			document.all.rightBannerScroll.style.left	= (document.body.clientWidth-con_page_size)/2 + con_page_size + 2;
		}
		else if(navigator.userAgent.indexOf("Firefox") != 1){
			document.all.leftBannerScroll.style.left	= (document.body.clientWidth-con_page_size)/2 - 113;
			document.all.rightBannerScroll.style.left	= (document.body.clientWidth-con_page_size)/2 + con_page_size + 1;
		}
		initBannerRight();
		initBannerLeft();
	}else{
		document.all.leftBannerScroll.style.display	= "none";
		document.all.rightBannerScroll.style.display	= "none";
	}
}