/*
function DoSideBar(){
var dom = (document.getElementById)? true : false;
var ns6 = dom && !document.all;
var GetSideBar=document.getElementById("sidebar");
var clearTotal=925;
if (parseInt(navigator.appVersion)>3) {
 if (navigator.appName=="Netscape") {
  winW = window.innerWidth;
  winH = window.innerHeight;
 }
 if (navigator.appName.indexOf("Microsoft")!=-1) {
  winW = document.body.offsetWidth;
  winH = document.body.offsetHeight;
 }
}
	if(winW > clearTotal) {
		document.getElementById("sidebar").style.display = "block";
		document.getElementById("sidebar").style.visibility = "visible";
	} else {
		document.getElementById("sidebar").style.display = "none";
		document.getElementById("sidebar").style.visibility= (dom && !ns6)? "hidden" : "hide";
	}	
}
window.onload=window.onresize=DoSideBar;
*/

var bookmarkurl="http://www.autogeek.net/"
var bookmarktitle="AutoGeek - Car Care,Detailing Supplies & Car Accessories"

function addbookmark(){
if (document.all)
	window.external.AddFavorite(bookmarkurl,bookmarktitle);
else
	alert("Please press \"ctrl + D\" to bookmark us");
}


var addListener = function () {
    if (window.addEventListener) {
	return function (el, type, fn) {
		el.addEventListener(type, fn, false);
	};
    } else if (window.attachEvent) {
	return function (el, type, fn) {
		var f = function () {
			fn.call(el, window.event);
		};
		el.attachEvent("on" + type, f);
	};
    } else {
	return function (el, type, fn) {
		element["on" + type] = fn;
	};
    }
}();

function moveBG() {
	var a = document.getElementById('homepage');
	var b = document.getElementById('actbody');
	var c = document.getElementById('overall');
	if (a && b && c) {
		var offset = (b.offsetHeight % 5) - 1;
		a.style.backgroundPosition = '181px ' + offset + 'px';
		c.style.backgroundPosition = '0 ' + offset + 'px';
	}
}

addListener(window, 'load', moveBG);


