function checkFooter() {

		windowwidth = window.innerWidth;
		pagewidth = document.getElementById("pagewrapper").offsetWidth;

		if (!windowwidth) { 
			windowwidth = document.documentElement.clientWidth;
		}

		if (!windowwidth || windowwidth == 0) { 
			windowwidth = document.body.clientWidth;
			pagewidth = document.getElementById("pagewrapper").offsetWidth;
		}


		if(windowwidth < 960) {

			document.getElementById("pagewrapper").style.margin = "0px";		

		} else {

			if(windowwidth < 1100) {

				document.getElementById("pagewrapper").style.marginLeft = "0px";
				document.getElementById("pagewrapper").style.marginRight = "0px";
				if(document.getElementById("content")) {
					document.getElementById("content").style.paddingRight = "20px";
				}

			} else {

				document.getElementById("pagewrapper").style.marginLeft = "0px";
				document.getElementById("pagewrapper").style.marginRight = "0px";
				if(document.getElementById("content")) {
					document.getElementById("content").style.paddingRight = "100px";
				}

			}
			
		}

		if(document.getElementById("footer")) {
			document.getElementById("footer").style.paddingRight = (document.getElementById("rightcolumn").offsetWidth / 2) -160 + "px";
		}

		if(document.getElementById("leftcolumn")) {
			if(document.getElementById("leftcolumn").offsetHeight > document.getElementById("rightcolumn").offsetHeight) {
				document.getElementById("leftcolumn").style.borderRight = "1px solid #d6bed6";
			} else {
				document.getElementById("rightcolumn").style.borderLeft = "1px solid #d6bed6";
			}
		}


}

// STORE REQUIRED ACTIONS IN VARIABLE //

var W3CDOM = (document.getElementsByTagName);

function init() {

	var search = document.getElementById("search_input");

	if(search) {
		if(search.value == "Type in a brand or keyword.") {
			search.onfocus = clearfunc;
		}
	}

	// IF ACTIONS ARE NOT SUPPORTED STOP SCRIPT //
	if (!W3CDOM) return;

	var menu = document.getElementById('quickmenu');

	if(menu) {

		var ptags = menu.getElementsByTagName('li');

		for (var i=0;i<ptags.length;i++) {

			if(ptags[i].className == "first") {

				ptags[i].onmouseover = mousegoesover2;
				ptags[i].onmouseout = mousegoesout2;		

			} else if(ptags[i].className != "last") {

				ptags[i].onmouseover = mousegoesover;
				ptags[i].onmouseout = mousegoesout;
	
			}

		}

	}


/*
	// IF ACTIONS ARE NOT SUPPORTED STOP SCRIPT //
	if (!W3CDOM) return;

	if(document.getElementById("banner")) {

	var slides1 = document.getElementById("banner");
	var slides2 = document.getElementById("banner2");

	slides2.innerHTML = slides1.innerHTML;

	var scrollbar = document.getElementById("bannerwrapper");
	maxwidth = scrollbar.offsetWidth;

	slides1width = slides1.offsetWidth;
	slides2width = slides2.offsetWidth;
		
	slides1.style.right = 0 + "px";
	slides2.style.right = (slides1width) + "px";

	function move(pos1,pos2,obj1,obj2) {

		val1 = pos1 + 1;
		val2 = pos2 + 1;

		if(val1 > maxwidth) {
			val1 = - (slides1width + 152);
		}

		if(val2 > maxwidth) {
			val2 = - (slides1width + 152);
		}

		obj1.style.right = val1 + "px";
		obj2.style.right = val2 + "px";

		setTimeout( function () { move(val1,val2,obj1,obj2) } ,40);

	}

	move(- 0,- (slides1width + 0),slides1,slides2);

	}

	*/
}

function mousegoesover() {
	this.className = "over";
}

function mousegoesout() {
	this.className = "";
}

function mousegoesover2() {
	document.getElementById("homeicon").src = "/images/homeover.gif";
	this.className = "firstover";
}

function mousegoesout2() {
	document.getElementById("homeicon").src = "/images/home.gif";
	this.className = "first";
}

function clearfunc() {
	this.value = "";
}

function move_items_left() {

	if(document.getElementById("item_scroll")) {

	var slides3 = document.getElementById("item_scroll");

	var scrollbar2 = document.getElementById("itemwrapper");
	maxwidth = scrollbar2.offsetWidth;

	slides3width = slides3.offsetWidth;
		
//	slides3.style.right = 0 + "px";

	function move(obj1) {

		if(document.controls.status.value == 1) {

		pos1 = document.getElementById("item_scroll").offsetLeft;

		val1 = pos1 + 10;

		if(val1 > maxwidth) {
			val1 = - (slides3width + 70);
		}

		obj1.style.left = val1 + "px";

		setTimeout( function () { move(obj1) } ,40);

		}
		
	}

	move(slides3);

	}

}

function move_items_right() {

	if(document.getElementById("item_scroll")) {

	var slides3 = document.getElementById("item_scroll");

	var scrollbar2 = document.getElementById("itemwrapper");
	maxwidth = scrollbar2.offsetWidth;

	slides3width = slides3.offsetWidth;
		
//	slides3.style.right = 0 + "px";

	function move(obj1) {

		if(document.controls.status.value == 2) {

		pos1 = document.getElementById("item_scroll").offsetLeft;

		val1 = pos1 - 10;

		if(val1 > maxwidth) {
//			val1 = - (slides3width + 70);
		}

		obj1.style.left = val1 + "px";

		setTimeout( function () { move(obj1) } ,40);

		}
		
	}

	move(slides3);

	}

}










	function addEvent(obj,type,func) {
		if (obj.addEventListener) { obj.addEventListener(type,func,false); return true; }
		if (obj.attachEvent) { return obj.attachEvent("on"+type,func); }
		return false;
	}

	function removeEvent(obj,type,func) {
		if (obj.removeEventListener) { obj.removeEventListener(type,func,false); return true; }
		if (obj.detachEvent) { return obj.detachEvent("on"+type,func); }
		return false;
	}

	function findEvent(e) {
		if (!e) var e = window.event;
		return e;
	}
			
	function findTarget(e) {
		if (e.target) t = e.target;
		else if (e.srcElement) t = e.srcElement;
		while (t.nodeType != 1) t = t.parentNode;
		return t;
	}

    function findObjectSize(obj) {
        x = obj.offsetWidth; y = obj.offsetHeight;
        return [x,y];
    }

	function findObjectPosition(obj) {
		var x = y = 0;
		if (obj.offsetParent) {
			x = obj.offsetLeft;
			y = obj.offsetTop;
			while (obj = obj.offsetParent) {
				x += obj.offsetLeft
				y += obj.offsetTop
			}
		}
		return [x,y];
	}

	function findViewportSize() {
		var x = y = 0;
		if (self.innerHeight) { // if !ie
			x = self.innerWidth;
			y = self.innerHeight;
		} else if (document.documentElement && document.documentElement.clientHeight) { // if ie6 strict
			x = document.documentElement.clientWidth;
			y = document.documentElement.clientHeight;
		} else if (document.body) { // all other ie
			x = document.body.clientWidth;
			y = document.body.clientHeight;
		}
		return [x,y];
	}

	function findPageSize() {
		var x = y = 0;
		var test1 = document.body.scrollHeight;
		var test2 = document.body.offsetHeight
		if (test1 > test2) { // if !ie mac
			x = document.body.scrollWidth;
			y = document.body.scrollHeight;
		} else { // if ie mac
			x = document.body.offsetWidth;
			y = document.body.offsetHeight;
		}
		return [x,y];
	}

	function findPageOffset() {
		var x = y = 0;
		if (self.pageYOffset) { // if !ie 
			x = self.pageXOffset;
			y = self.pageYOffset;
		} else if (document.documentElement && document.documentElement.scrollTop) { // if ie6 strict
			x = document.documentElement.scrollLeft;
			y = document.documentElement.scrollTop;
		} else if (document.body) { // all other ie
			x = document.body.scrollLeft;
			y = document.body.scrollTop;
		}
		return [y];
	}

	function findMousePos(e)
	{
		var x = y = 0;
		if (e.pageX || e.pageY) {
			x = e.pageX;
			y = e.pageY;
		} else if (e.clientX || e.clientY) 	{
			x = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
			y = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
		}
		return [x,y];
	}

	function vector() {
		this.x = 0; this.y = 0; this.z = 0;
	}

	function addClass(object,classname) {
		object.className += " "+classname;
	}

	function checkClass(object,classname) {
		classes = object.className.split(' ');
		var i;
		for (i=0;i<classes.length;i++) {
			if (classes[i] == classname) return true;
		}
		return false;
	}

	function removeClass(object,classname)
	{
		classes = object.className.split(' ');
		var i; var newclass = "";
		for (i=0;i<classes.length;i++) {
			if (classes[i] != classname) newclass += " "+classes[i];
		}
		object.className = newclass;
	}
