	//extend location 
	location.siteURL=function() {		
		var ret ='';
		ret =  location.protocol +'//' + location.host;

		return ret; }
	
	
	
	//neat idea, may be useful on more global level 
	Array.prototype.has = function(value) 
	{

		var i;

		for (var i = 0, loopCnt = this.length; i < loopCnt; i++) 
		{

			if (this === value) {

			return true;
	
								}

		}

		return false;

	};


	
	var xmlhttp = null;
	//XMLHTTP Request function
	function makeXMLHTTPReq(method, url, doc, evHandler)
	{
		
		if (window.XMLHttpRequest) {
		  xmlhttp = new XMLHttpRequest();
		  if ( typeof xmlhttp.overrideMimeType != 'undefined') { 
		    xmlhttp.overrideMimeType('text/xml'); 
		  }
		} else if (window.ActiveXObject) {
		  xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} else {
		
		}
		xmlhttp.open(method, url, true);
		xmlhttp.send(doc);		

		xmlhttp.onreadystatechange = evHandler;
		
	}

	
	function getCartIDFromCookie(){
		//this will parse the cartID from the cookie
		var cartInfoCookie = readcookie("CartInfo");
		return cartInfoCookie.substring(0, cartInfoCookie.indexOf('%'))
	}
	
	//this function will read a sing from a cookie
	function readcookie(name){
		var cookies = document.cookie.split(';');
		var i;
		
		
		for (i = 0; i< cookies.length; i=i+1){
			if (cookies[i].substring(1, name.length+1) == name) 
			{
				if (cookies[i].substring(name.length+1, name.length+2) == '='){
					return cookies[i].substring(name.length+2,  cookies[i].length);
				}
			}
		}
		return '';
	
	}
	
	
	function getElementsByName_iefix(tag, name) //document.getElementsBYName doesn't really always work in IE
	{

		var elem = document.getElementsByTagName(tag);
		var arr = new Array();
		for(i = 0,iarr = 0; i < elem.length; i++) 
			{
			att = elem[i].getAttribute('name');
				if(att == name) 
					{
				arr[iarr] = elem[i];
				iarr++;
					}
			}
	return arr;
	}


	function URLDecode(psEncodeString) 
	{
	  // Create a regular expression to search all +s in the string
	  var lsRegExp = /\+/g;
	  // Return the decoded string
	  return unescape(String(psEncodeString).replace(lsRegExp, " ")); 
	}
	
	function globalFindPos(obj) {
		//stolen from psychic search. 
		var curleft = curtop = 0;
		if (obj.offsetParent) {
			curleft = obj.offsetLeft
			curtop = obj.offsetTop
			while (obj = obj.offsetParent) {
				curleft += obj.offsetLeft
				curtop += obj.offsetTop
			}
		}
		return [curleft,curtop];
	}
	
	
	function operahelper(){
		if (window.opera)
		
			document.body.style += "";	// Force Opera redraw.
	}
