function checkFooter() {

		windowheight = window.innerHeight;

		pageheight = document.getElementById("pagewrapper").offsetHeight;
		headerheight = document.getElementById("headerwrapper").offsetHeight;
		footerheight = document.getElementById("footerwrapper").offsetHeight;
		contentheight = document.getElementById("contentwrapper").offsetHeight;		

		if (!windowheight) { 
			windowheight = document.documentElement.clientHeight;
		}

		if (!windowheight || windowheight == 0) { 
			windowheight = document.body.clientHeight;
		}

		
		headfoot = headerheight + footerheight;

		if(pageheight < windowheight) {

			difference = windowheight - pageheight;

			document.getElementById("contentwrapper").style.height = contentheight + difference + "px";

		}

	
}


	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 [x,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;
	}

	function imagescroll()
        {
                zimage = document.getElementById("scrollimage");

//              zimageheight = zimage.height;
//              zframeheight = 281;
                zimageheight = zimage.width;
                zframeheight = 360;

                if(zimageheight > zframeheight)
                {
                        zdifference = zimageheight - zframeheight;

                        zstartdelay = 20;
                        zmaxdelay = 30;

                        for(zi=0;zi<=zdifference;zi++)
                        {
                                zp = zi/zdifference;
                                zdelay = zstartdelay + zp * (zmaxdelay - zstartdelay);
                                setTimeout('imagescroll_setpos(\'scrollimage\','+zi+')',zi*zdelay);
                        }

                }
        }

        function imagescroll_setpos(zid,zpos)
        {
                document.getElementById(zid).style.left = "-"+zpos+"px"
        }



// STORE REQUIRED ACTIONS IN VARIABLE //

var W3CDOM = (document.getElementsByTagName);

function init() {

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

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

	if(menu) {

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

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

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

				if(i % 2 == 0){ 
					ptags[i].style.backgroundColor = "#b6d6e8"
				} else { 
					ptags[i].style.backgroundColor = "#9ec5dd"
				}

			}

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

				if(i % 2 == 0){ 
					ptags[i].style.backgroundColor = "#9ec5dd"
				} else { 
					ptags[i].style.backgroundColor = "#b6d6e8"
				}

			}

		}

	}

}
