function imgOver(el) {
	var p=el.src.lastIndexOf(".");
	var srcExt=el.src.substr(p+1);
	var srcClean=el.src.substr(0,p);
	if (srcClean.substr(srcClean.length-5,5) != "_over") el.src = srcClean+"_over"+"."+srcExt;
}

function imgOut(el) {
	var p=el.src.lastIndexOf(".");
	var srcExt=el.src.substr(p+1);
	var srcClean=el.src.substr(0,p);
	if (srcClean.substr(srcClean.length-5,5) == "_over") el.src = el.src.substr(0,p-5)+"."+srcExt;
}


function popUp(url) {
  window.open(url, "prev", "width=465, height=540, scrollbars=yes, resizable=yes");
}

function checkBanner() {
	var page_width = 870 + 40;
	var sidebar_width = 120;
	// Measure window...
	if (self.innerHeight) {					// all except Explorer (FF, Opera)
		var width = self.innerWidth;
		var height = self.innerHeight;
		if (!document.body.scrollTop)
			var top = document.documentElement.scrollTop;
		else
			var top = document.body.scrollTop;
		
		width -= 16;						// Firefox always needs that or it will spawn some scrollbars
		if (width < page_width) height -= 16;		// horizontal scrollbars
		if (height < 600) width -= 16;		// vertical scrollbars
	} else if (document.documentElement && document.documentElement.clientHeight) {  // ie6 Strict Mode
		var width = document.documentElement.clientWidth;
		var height = document.documentElement.clientHeight;
		var top = document.documentElement.scrollTop;
		
	} else if (document.body) {			// other ie
		var width = document.body.clientWidth;
		var height = document.body.clientHeight;
		var top = document.scrollTop;
	}
	
	var el_footer=document.getElementById("footer");
	

	el_footer.style.position = "absolute";
	el_footer.style.top   = (height - el_footer.clientHeight + top)+"px";
	el_footer.style.left  = (0)+"px";
	el_footer.style.width = (width)+"px";

	var el_banner_left=document.getElementById("banner_left");
	var el_banner_right=document.getElementById("banner_right");
	if ((width > (page_width+sidebar_width+sidebar_width)) && (el_banner_left) && (el_banner_right)) {
		el_banner_left.style.display = "block";
		el_banner_left.style.left = (0) + "px";
		el_banner_left.style.top = (top) + "px";
		el_banner_left.style.width = (sidebar_width) + "px";
		el_banner_left.style.height = (height) + "px";
		
		el_banner_right.style.display = "block";
		el_banner_right.style.left = (width - el_banner_right.clientWidth) + "px";
		el_banner_right.style.top = (top) + "px";
		el_banner_right.style.width = (sidebar_width) + "px";
		el_banner_right.style.height = (height) + "px";
		
		el_footer.style.left  = (150)+"px";
		el_footer.style.width = (width - 300)+"px";
	} else {
		if (el_banner_left) {
			el_banner_left.style.display = "none";
			el_banner_left.style.left = (0) + "px";
			el_banner_left.style.top = (0) + "px";
			el_banner_left.style.width = (0) + "px";
			el_banner_left.style.height = (0) + "px";
		}
		
		if (el_banner_right) {
			el_banner_right.style.display = "none";
			el_banner_right.style.left = (0) + "px";
			el_banner_right.style.top = (0) + "px";
			el_banner_right.style.width = (0) + "px";
			el_banner_right.style.height = (0) + "px";
		}

		el_footer.style.left  = (0)+"px";
		el_footer.style.width = (width)+"px";
	}
}

window.onscroll=checkBanner;
window.onresize=checkBanner;
window.onload  =checkBanner;

document.onscroll=checkBanner;
document.onresize=checkBanner;
document.onload  =checkBanner;
