//
// event.js
//
/*
*	UNIVERSAL EVENT OBJECT
*
*	This file contains a general non browser specific event object whose methods can be used to attach, remove, 
*	and cancel events, as well as retrieve the event source. 
*	Note: This should be the first javascript file imported if this event object is to be used to attach an initialisation routine 
*	to the windows onload event.
*
*	12 - April - 2006
*	version 1.0
*	
*/

EventObj = function(){
//non broweser specific event object 

// #### OBJECT METHODS ####
this.addEvent = function(eventType, element, fn, capture){
//add an event to an element
//parameters are: 	
//eventType:	string containing event type (without the 'on') eg "load", "mouseout", "keyup"
//element: 		element to which the event is to be attached
//fn:			function variable pointing to the handling routine
//capture:		boolean, usually set to false

	if(!element) return;
	
	if(element.addEventListener){//DOM browsers
		element.addEventListener(eventType, fn, capture);
	} else if(element.attachEvent){//older IE model browers
		element.attachEvent("on"+eventType, fn);
	} else {//very old browsers
		element["on"+eventType] = fn;
	}
}//addEvent

this.removeEvent = function(eventType, element, fn, capture){
//removes an evernt from an element
//parameters are:
//eventType: 	string containing event type (without the 'on') eg "load", "mouseout", "keyup"
//element: 		element to which the event is to be attached
//fn:			function variable pointing to the handling routine
//capture:		boolean, usually set to false
	
	if(!element) return;
	
	if(element.removeEventListener){//DOM browsers
		element.removeEventListener(eventType, fn, capture);
	} else if(element.detachEvent){//older IE model browers
		element.detachEvent("on"+eventType, fn);
	} else {//very old browsers
		element["on"+eventType] = null;
	}	

}//removeEvent

this.getEventSource = function(e){
//returns the source of event: e or
//returns null if not found
	var result = null;
	
	if(e && e.target) {//DOM browsers
		result = e.target;
	} else if (window.event && window.event.srcElement){//older IE browsers
		result = window.event.srcElement;
	}
	return result;
}//getEventSource

this.cancelEvent = function(e){
//cancels event: e	
	
	if(e && e.stopPropagation) {
		e.stopPropagation();
	} else if(window.event && window.event.cancelBubble) {
		window.event.cancelBubble = true;
	}
}//cancelEvent

this.getX = function(e){
//returns mouse x pos relative to page
	if(e && e.pageX) {
		return e.pageX;
	} else if(window.event && window.event.clientX){
		return window.event.clientX - 1;
	} else {
		return 0;
	}
}//getX

this.getY = function(e){
//returns mouse y pos relative to page	
	if(e && e.pageY) {
		return e.pageY;	
	} else if(window.event && window.event.clientY){
		return window.event.clientY - 1;
	} else {
		return 0;
	}
}//getY

// #### END OF METHOD DEFINITIONS ####

}//EventObj

//
// former jscripts.inc
//
	var innerspan = 1;
	var appearspan = 0;

   function createRequestObject() {

    var req;

    if(window.XMLHttpRequest){
       // Firefox, Safari, Opera...
       req = new XMLHttpRequest();
    } else if(window.ActiveXObject) {
       // Internet Explorer 5+
       req = new ActiveXObject("Microsoft.XMLHTTP");
    } else {
       // There is an error creating the object,
       // just as an old browser is being used.
       alert('Problem creating the XMLHttpRequest object');
    }

    return req;

   }

  // Make the XMLHttpRequest object
  var http = createRequestObject();



  function removeFromCart(cartPos) {
   input_box=confirm("Are you sure you want to remove this product ?");  
	 
   if(input_box == true) {  
    http.open('get', '/removeproduct.php?pos=' + cartPos);

    http.onreadystatechange = handleResponseRemove;
    http.send(null);
   }//if

  }


  //HANDLE RESPONSES FOR CART REMOVE
  //
  function handleResponseRemove() {

   if(http.readyState == 4 && http.status == 200){

     // Text returned FROM the PHP script
     var response = http.responseText;
	 var DELIMITER = "!*-"; 

	 
     if (response == "NOWT ") {

		var el = document.getElementById("innercart");
		el.innerHTML = "<p>Empty</p><br/>";


     } else {

      if(response.indexOf(DELIMITER != -1)) {
          UPDATE = response.split(DELIMITER); 

		  var el = document.getElementById("innercart");
          el.innerHTML = "";

          var i = 0;
		  var dataSize = 6;  
          var totalprice = 0;
          while (i < UPDATE[0]) {
			  var prodTitle 	= UPDATE[((i * dataSize) + 1)];
			  var prodPrice 	= UPDATE[((i * dataSize) + 2)];
			  var prodQty 		= UPDATE[((i * dataSize) + 3)];
			  var totalDel 		= UPDATE[((i * dataSize) + 4)];
			  var prodLink 		= UPDATE[((i * dataSize) + 5)];
			  var delCode 		= UPDATE[((i * dataSize) + 6)];	 
			  
			  var el = document.getElementById("innercart");

			  var updatestring = "<p align='left'><a href='/store/" + prodLink + "'>" + prodTitle + "</a><br />&pound;" + addCommas(prodPrice) + "<br />";
			  if (totalDel != "none") {
				  if (delCode == "collect") {
					  updatestring = updatestring + "<small> + Collection (free)</small><br />";
				  } else if(delCode == "free") {
					   updatestring = updatestring + "<small> + FREE Delivery</small><br />";	
				  } else if(totalDel > 0) {
					  updatestring = updatestring + "<small> + Delivery &pound;" + addCommas(totalDel) + "</small><br />";
					  totalprice = totalprice + (totalDel * prodQty);
				  }//if
			  }//if
           		updatestring = updatestring + "<em>Quantity : " + prodQty + "</em><br /><small>( <a href=\"javascript:removeFromCart(" + i + ")\">remove</a> )</small>";
				updatestring = updatestring + "&nbsp;<small>( <a href='/basket.php'>edit</a> )</small><br /></p><br />";   

			   el.innerHTML = el.innerHTML + updatestring;
			   totalprice = totalprice + (prodPrice * prodQty);
	
			  i++;
          }//while

			if (UPDATE[((i * dataSize) + 1)] != 0) {
			  el.innerHTML = el.innerHTML + "<small>less : Multi-buy Discount of &pound;" + addCommas(UPDATE[((i * dataSize) + 1)]) + "</small><br /><br />";
			  totalprice = totalprice - UPDATE[((i * dataSize) + 1)];
			}//if

           el.innerHTML = el.innerHTML + "<strong>TOTAL : &pound;" + addCommas(totalprice) + "</strong>";
        }//if

		
	   el.innerHTML += "<p id='butEditCheckout'><a href='/>basket.php'><img src='/images/site/editCheckout.png' border='0' width='84' height='21' alt='Edit/Checkout' title=''/></a></p>";

      } // end of check for nowt

   } // end of http ready state

  } // end of handleresponse funct

 function checknl(){
  var str=document.nl_form.nl_email.value
  var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
  if (filter.test(str))
   if (document.nl_form.nl_email.value == "") {
     alert('Please enter an email address');
   }
   else {
     document.forms['nl_form'].submit();
   }
  else{
     alert('Please enter a valid email address');
  }
 }


  function getSuggestions() {
	  //use AJAX to get search suggestions

	  if(!suggestionsOn){
		  return;
	  }//if
	  var searchquery = document.getElementById("searchquery");
	  if(!searchquery) {
		  return;
	  }//if
	  
    http.open('get', '/dynamicSearch.php?word=' + searchquery.value + "&site=" + searchSiteID);
    http.onreadystatechange = showSuggestions;
    http.send(null);
	  
 }//getSuggestions
 
 
 function showSuggestions() {
	    
	 if(http.readyState == 4 && http.status == 200) {
		 var sList = document.getElementById("searchList");

		 if(http.responseText == "") {
			 sList.style.display = 'none';
		 } else {
			 sList.style.display = 'block';
			 sList.innerHTML = http.responseText;
			 //handle old IE non-support for css max-height
			 sList.style.height = "auto";
			 if(sList.offsetHeight > 200) {
				 sList.style.height = "200px";
			 }//if
		 }//if
	 }//if
	 
 }//showSuggestions
 
 
 function searchNow() {
	 
	 var searchTxt = document.getElementById("searchquery").value;
	 return (searchTxt == "search") ? false : true;
 }//test 
 
 
 function addCommas(num) {
   num = num.toString().replace(/\$|\,/g,'');
   if(isNaN(num))
   num = "0";
   sign = (num == (num = Math.abs(num)));
   num = Math.floor(num*100+0.50000000001);
   cents = num%100;
   num = Math.floor(num/100).toString();
   if(cents<10)
   cents = "0" + cents; 
   for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
   num = num.substring(0,num.length-(4*i+3))+','+
   num.substring(num.length-(4*i+3));
   return (((sign)?'':'-') + num + '.' + cents);
 } //addCommas        
 
//
// menusystem.js
// 
 
//Chrome Drop Down Menu v2.01- Author: Dynamic Drive (http://www.dynamicdrive.com)
//Last updated: November 14th 06- added iframe shim technique

var cssdropdown={
disappeardelay: 100, //set delay in miliseconds before menu disappears onmouseout
disablemenuclick: true, //when user clicks on a menu item with a drop down menu, disable menu item's link?
enableswipe: 0, //enable swipe effect? 1 for yes, 0 for no
enableiframeshim: 0, //enable "iframe shim" technique to get drop down menus to correctly appear on top of controls such as form objects in IE5.5/IE6? 1 for yes, 0 for no

//No need to edit beyond here////////////////////////
dropmenuobj: null, ie: document.all, firefox: document.getElementById&&!document.all, swipetimer: undefined, bottomclip:0,

getposOffset:function(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;

while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
},

swipeeffect:function(){
if (this.bottomclip<parseInt(this.dropmenuobj.offsetHeight)){
this.bottomclip+=10+(this.bottomclip/10) //unclip drop down menu visibility gradually
this.dropmenuobj.style.clip="rect(0 auto "+this.bottomclip+"px 0)"
}
else
return
this.swipetimer=setTimeout("cssdropdown.swipeeffect()", 10)
},

showhide:function(obj, e){
if (this.ie || this.firefox)
this.dropmenuobj.style.left=this.dropmenuobj.style.top="-500px"
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover"){
if (this.enableswipe==1){
if (typeof this.swipetimer!="undefined")
clearTimeout(this.swipetimer)
obj.clip="rect(0 auto 0 0)" //hide menu via clipping
this.bottomclip=0
this.swipeeffect()
}
obj.visibility="visible"
}
else if (e.type=="click")
obj.visibility="hidden"
},

iecompattest:function(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
},

clearbrowseredge:function(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=this.ie && !window.opera? this.iecompattest().scrollLeft+this.iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
this.dropmenuobj.contentmeasure=this.dropmenuobj.offsetWidth
if (windowedge-this.dropmenuobj.x < this.dropmenuobj.contentmeasure)  //move menu to the left?
edgeoffset=this.dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=this.ie && !window.opera? this.iecompattest().scrollTop : window.pageYOffset
var windowedge=this.ie && !window.opera? this.iecompattest().scrollTop+this.iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
this.dropmenuobj.contentmeasure=this.dropmenuobj.offsetHeight
if (windowedge-this.dropmenuobj.y < this.dropmenuobj.contentmeasure){ //move up?
edgeoffset=this.dropmenuobj.contentmeasure+obj.offsetHeight
if ((this.dropmenuobj.y-topedge)<this.dropmenuobj.contentmeasure) //up no good either?
edgeoffset=this.dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
},

dropit:function(obj, e, dropmenuID){

if (this.dropmenuobj!=null) {//hide previous menu
this.dropmenuobj.style.visibility="hidden" //hide menu
}
this.clearhidemenu()
if (this.ie||this.firefox){
obj.onmouseout=function(){cssdropdown.delayhidemenu()}
obj.onclick=function(){return !cssdropdown.disablemenuclick} //disable main menu item link onclick?
this.dropmenuobj=document.getElementById(dropmenuID)
this.dropmenuobj.onmouseover=function(){cssdropdown.clearhidemenu()}
this.dropmenuobj.onmouseout=function(e){cssdropdown.dynamichide(e)}
this.dropmenuobj.onclick=function(){cssdropdown.delayhidemenu()}
this.showhide(this.dropmenuobj.style, e)
this.dropmenuobj.x=this.getposOffset(obj, "left")
this.dropmenuobj.y=this.getposOffset(obj, "top")
this.dropmenuobj.style.left=this.dropmenuobj.x-this.clearbrowseredge(obj, "rightedge")+"px"
this.dropmenuobj.style.top=this.dropmenuobj.y-this.clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+1+"px"
this.positionshim() //call iframe shim function
}
},

positionshim:function(){ //display iframe shim function
if (this.enableiframeshim && typeof this.shimobject!="undefined"){
if (this.dropmenuobj.style.visibility=="visible"){
this.shimobject.style.width=this.dropmenuobj.offsetWidth+"px"
this.shimobject.style.height=this.dropmenuobj.offsetHeight+"px"
this.shimobject.style.left=this.dropmenuobj.style.left
this.shimobject.style.top=this.dropmenuobj.style.top
}
this.shimobject.style.display=(this.dropmenuobj.style.visibility=="visible")? "block" : "none"
}
},

hideshim:function(){
if (this.enableiframeshim && typeof this.shimobject!="undefined")
this.shimobject.style.display='none'
//######################################################
/*
var menuShadow = document.getElementById("menuShadow");
menuShadow.style.display = "none";
*/
//######################################################
},

contains_firefox:function(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
},

dynamichide:function(e){
var evtobj=window.event? window.event : e
if (this.ie&&!this.dropmenuobj.contains(evtobj.toElement))
this.delayhidemenu()
else if (this.firefox&&e.currentTarget!= evtobj.relatedTarget&& !this.contains_firefox(evtobj.currentTarget, evtobj.relatedTarget))
this.delayhidemenu()
},

delayhidemenu:function(){
this.delayhide=setTimeout("cssdropdown.dropmenuobj.style.visibility='hidden'; cssdropdown.hideshim()",this.disappeardelay) //hide menu
},

clearhidemenu:function(){
if (this.delayhide!="undefined")
clearTimeout(this.delayhide)
},

startchrome:function(){
for (var ids=0; ids<arguments.length; ids++){
var menuitems=document.getElementById(arguments[ids]).getElementsByTagName("a")
for (var i=0; i<menuitems.length; i++){
if (menuitems[i].getAttribute("rel")){
var relvalue=menuitems[i].getAttribute("rel")
menuitems[i].onmouseover=function(e){
var event=typeof e!="undefined"? e : window.event

cssdropdown.dropit(this,event,this.getAttribute("rel"))

//###############################################
/*
var menuBlock = document.getElementById(this.getAttribute("rel"));
var menuShadow = document.getElementById("menuShadow");

menuShadow.style.top = (parseInt(menuBlock.offsetTop) + 3) + "px";
menuShadow.style.left = (parseInt(menuBlock.offsetLeft) + 3) + "px";
menuShadow.style.width = menuBlock.offsetWidth + "px";
menuShadow.style.height = menuBlock.offsetHeight + "px";
menuShadow.style.display = "block";
*/
//################################################

}
}
}
}

if (window.createPopup && !window.XmlHttpRequest){ //if IE5.5 to IE6, create iframe for iframe shim technique
document.write('<IFRAME id="iframeshim"  src="" style="display: none; left: 0; top: 0; z-index: 90; position: absolute; filter: progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)" frameBorder="0" scrolling="no"></IFRAME>')
this.shimobject=document.getElementById("iframeshim") //reference iframe object
}
}

}


//
// infotrack.js
//
/*

	Mouse Tracking Into Box

	version 1.0
	
	19 - Apr - 07
	
	G. Stevens
	
	Implements a tool tips type info box at the mouse cursor and tracks its movement
	
	Required Libraries: event.js

*/


InfoBoxTrackObj = function() {
	
	
	var PREFIX = "gs1907_";
	
	var infoBox = document.getElementById(PREFIX + "infBox");
	var infoBoxShadow = document.getElementById(PREFIX + "infBoxShadow");
	var body = document.getElementsByTagName("body")[0];
	var infoWidth, infoHeight;
	var xOffset, yOffset;
	
	var evnt;//ref to event object
	
	var hasShadow = true;
	var isHidden = true;
	
	var DEF_CLASS = "gsInfoBox";
	var DEF_SHADOW_CLASS = "gsInfoBoxShadow";
	var DEF_Z_INDEX = 2;//default z-index
	var DEF_WIDTH = 50;
	var UNITS = "px";
	var SHADOW_OFFSET = 3;
	var MOUSE_OFFSET = 20;
	var MAX_WIDTH = 300;
	
	//create elements if they dont already exist
	if(!infoBox) {
		infoBox = document.createElement("div");
		infoBox.id = PREFIX + "infoBox";
		document.getElementsByTagName("body")[0].appendChild(infoBox);
		var cInfoBox = "{position: absolute !important; color: #333333; background: rgb(255,255,245); border: 1px solid #333333; ";
		cInfoBox +=	"z-index: " + DEF_Z_INDEX + "; display: none; padding: 0 4px;}";
		createRule("." + DEF_CLASS, cInfoBox);
		infoBox.className = DEF_CLASS;
	}//if
	if(!infoBoxShadow) {
		infoBoxShadow = document.createElement("div");
		document.getElementsByTagName("body")[0].appendChild(infoBoxShadow);
		var cInfoBoxShadow = "{position: absolute !important; background: black !important; opacity: .3; border-color: black !important; ";
		cInfoBoxShadow += "filter:Alpha(Opacity=30); -khtml-opacity: 0.3; -moz-opacity: 0.3; color: black !important; padding: 0 4px;";
		cInfoBoxShadow +=	"z-index: " + (DEF_Z_INDEX - 1) + "; display: none; border-width: 1px; border-style: solid !important;}";
		createRule("." + DEF_SHADOW_CLASS, cInfoBoxShadow);
		infoBoxShadow.className = DEF_SHADOW_CLASS;
	}//if
	
	try {
		evnt = new EventObj();
	} catch(e) {
		alert("Error creating EventObj instance: " + e)
	}//try



	//
	//###### public methods ######
	//
	
	this.setZIndex = function(zIndex) {

		if(infoBox) infoBox.style.zIndex = (zIndex > DEF_Z_INDEX) ? zIndex : DEF_Z_INDEX;
		if(infoBoxShadow) infoBoxShadow.style.zIndex = (zIndex > DEF_Z_INDEX) ? zIndex - 1 : DEF_Z_INDEX - 1;
	}//setZIndex
	
	this.setClass = function(aClass){
	//sets class to use
	//aClass = string containing a class name. If null or empty, class used will be default
		if(infoBox && infoBoxShadow && typeof aClass == "string") {
			if(aClass != "" && aClass != null) {
				infoBox.className = DEF_CLASS + " " + aClass;
				infoBoxShadow.className = aClass + " " + DEF_SHADOW_CLASS;
							
			} else {//use default class
				infoBox.className = DEF_CLASS;
				infoBoxShadow.className = DEF_SHADOW_CLASS;					
			}//if

		}//if
	}//setClass
	
	this.setContent = function(content){
		
		if(infoBox && typeof content == "string") {
			infoBox.style.width = "auto";
			infoBox.innerHTML = content;
			infoBoxShadow.style.width = "auto";
			infoBoxShadow.innerHTML = content;
			infoWidth = getOffsetProperty(infoBox, infoBox, "offsetWidth");
			if(infoWidth > MAX_WIDTH) infoBox.style.width = MAX_WIDTH + UNITS;//limit width to max width
			infoBoxShadow.style.width = infoBox.style.width;
			infoWidth =  getOffsetProperty(infoBox, infoBox, "offsetWidth");
			infoHeight = getOffsetProperty(infoBox, infoBox, "offsetHeight");
		}//if
	}//setContent
	
	this.setWidth = function(width){
		if(typeof width != "number" || width < 1) return;
		MAX_WIDTH = width;
	}//setWidth
	
	this.setShadow = function(state){
		if(infoBoxShadow && typeof state == "boolean" && !isHidden) infoBoxShadow.style.display = (state) ? "block" : "none";
		hasShadow = state;
	}//setShadow
	
	this.isHidden = function(){
		return isHidden;
	}//isHidden
	
	this.show = function(text, direction){
	//show infobox
	//text = any text to display
	//direction = string containing infobox compass direction relative to mouse pointer
	//		allowed values = NE, NW, SE, SW - default is SE
		if(text != null && text != "") this.setContent(text);

		if(infoBox) infoBox.style.display = "block";
		if(infoBoxShadow && hasShadow) infoBoxShadow.style.display = "block";
		
		//calc infobox position offset from mouse pointer
		if(direction) direction = direction.toUpperCase();

		
		if(direction == "NE") {//top right
			xOffset = MOUSE_OFFSET - InfoBoxTrackObj.prototype.OFFSET_ADJUST;
			yOffset = -MOUSE_OFFSET - infoHeight + InfoBoxTrackObj.prototype.OFFSET_ADJUST;
			
		} else if(direction == "NW") {//top left
			xOffset = -MOUSE_OFFSET - infoWidth + InfoBoxTrackObj.prototype.OFFSET_ADJUST;
			yOffset = -MOUSE_OFFSET - infoHeight + InfoBoxTrackObj.prototype.OFFSET_ADJUST;
			
		} else if(direction == "SW") {//bottom left
			xOffset = -MOUSE_OFFSET - infoWidth + InfoBoxTrackObj.prototype.OFFSET_ADJUST;
			yOffset = MOUSE_OFFSET - InfoBoxTrackObj.prototype.OFFSET_ADJUST;
			
		} else {//default - botton right
	
			xOffset = MOUSE_OFFSET;
			yOffset = MOUSE_OFFSET;		
		}//if
		
		evnt.addEvent("mouseover", body, updatePosition, false);				
		evnt.addEvent("mousemove", body, updatePosition, false);		
		
	}//show
	
	this.hide = function(){
	//hides infobox
		if(infoBox) infoBox.style.display = "none";
		if(infoBoxShadow) infoBoxShadow.style.display = "none";
		isHidden = true;
		evnt.removeEvent("mousemove", body, updatePosition, false);
	}//hide
	
	//
	//###### private methods ######
	//
	
	function createRule(selctor, rule) {
	//creates a css rule
	//selector = string containing css selector ie "body" or ".someClass p"
	//rule = string containing css rule eg "{color: red; font-size: 120%;}"
		with(document.styleSheets[0]){
			if(typeof insertRule == "function") {
				insertRule(selctor + " " + rule, cssRules.length);//CSS2 browsers
	
			} else if(typeof addRule != "undefined") {//IE
				addRule(selctor, rule);
			}
		}//with
	}//createRule
	
	function getOffsetProperty(elem1, elem2, prop){
	//retrives an offset property that is only visible if element or its accedents is exposed ie has style.display != "none"
	//elem1: ref to HTML element to expose; elem2: ref to HTML to find offset property of; prop: string containing offset property name
		if(typeof elem1 != "object" || typeof elem2 != "object" || typeof prop != "string") return null;
		var result;
		var vis = elem1.style.visibility;//store settings
		var display = elem1.style.display;
		elem1.style.visibility = "hidden";//expose element
		elem1.style.display = "block";
		result = eval("elem2." + prop);//get the offset property
		elem1.style.display = display;//restore original settings
		elem1.style.visibility = vis;		
		return result;
	}//getOffsetProperty
	

	//
	//###### event handler function ######
	//	
	function updatePosition(e) {
	//mouse movement event handler
	
		var x = evnt.getX(e);
		var y = evnt.getY(e);
		
	var IS_IE = document.all && document.getElementById && !document.defaultView;//test for IE
	

	if(IS_IE) {//IE
		if(infoBoxShadow && hasShadow){
			infoBoxShadow.style.top = (y + yOffset + SHADOW_OFFSET + document.documentElement.scrollTop) + UNITS;
			infoBoxShadow.style.left = (x + xOffset + SHADOW_OFFSET + document.documentElement.scrollLeft) + UNITS;			
		}//if
		
		if(infoBox){
			infoBox.style.top = (y + yOffset + document.documentElement.scrollTop) + UNITS;
			infoBox.style.left = (x + xOffset + document.documentElement.scrollLeft) + UNITS;				
		}//if	
	
	} else {//non-IE
		if(infoBoxShadow && hasShadow){
			infoBoxShadow.style.top = (y + yOffset + SHADOW_OFFSET) + UNITS;
			infoBoxShadow.style.left = (x + xOffset + SHADOW_OFFSET) + UNITS;			
		}//if
		
		if(infoBox){
			infoBox.style.top = (y + yOffset) + UNITS;
			infoBox.style.left = (x + xOffset) + UNITS;				
		}//if
		
	}//if

	
	}//updatePosition	
	
	
}//InfoBoxTrackObj

//OFFSET_ADJUST allows fine control over gap between mouse cursor and info box.
//increasing this value moves info box closer to mouse cursor for NW, SW and NE positions
InfoBoxTrackObj.prototype.OFFSET_ADJUST = 10;

//
// FROM STANDARD TOP
//
var info;

init = function() {
	//resize product tables to all the same size in a row
	createInfoBox();
}//init

function helpShow(txt) {
	if(!info) {
		createInfoBox()
	}
	info.show(txt);
}

function createInfoBox() {
	
	try {
	  info = new InfoBoxTrackObj();
	} catch(e) {//some problem, so warn
	  alert('ERROR: ' + e);
	}//try
	
	//set up info box
	
	with(info) {
	  setWidth(300); //limit info box width to a maximum of 300px
	  setClass('infoStyle'); //set info box class name to apply
	}//with
	
}//test


function getTableRows(tbl) {
	//generate arrays of TR elements in table element: tbl
	var rows = new Array();
	var root = tbl;
	if(tbl == null) return;
	
	//see if root table has a tbody element
	for(var n=0; n<tbl.childNodes.length; n++){
		if(tbl.childNodes[n].nodeName == 'TBODY'){
			root = tbl.childNodes[n];
			break;
		}//if
	}//for
	
	//create array of tr elements
	for(var n=0; n<root.childNodes.length; n++){
		if(root.childNodes[n].nodeName == 'TR'){
			rows.push(root.childNodes[n]);
		}//if
	}//for
	
	return rows;
	
}//getRows

window.onload = init;
window.onresize = init; 

 //<![CDATA[

 // If you don't want to put unstandard properties in your stylesheet, here's yet
 // another means of activating the script. This assumes that you have at least one
 // stylesheet included already. Remove the /* and */ lines to activate.

 var root = "<?php echo $root; ?>";
 
 if (document.all && document.styleSheets && document.styleSheets[0] &&
  document.styleSheets[0].addRule)
 {
  // Feel free to add rules for specific tags only, you just have to call it several times.
  	document.styleSheets[0].addRule('img', 'behavior: url(<?php echo $root; ?>iepngfix.htc)');
	//use span for elements with transparent png background images
  	document.styleSheets[0].addRule('span', 'behavior: url(<?php echo $root; ?>iepngfix.htc)');
  	//document.styleSheets[0].addRule('td', 'behavior: url(<?php echo $root; ?>iepngfix.htc)');
  	document.styleSheets[0].addRule('h3', 'behavior: url(<?php echo $root; ?>iepngfix.htc)');
 }
 

 //]]>