function preloadAllImages() {
	MM_preloadImages('images/header/Conran_dot_com_o.gif','images/header/mailing_list_o.gif','images/header/your_account_o.gif','images/nav_glob/womanswear_o.gif','images/nav_glob/menswear_o.gif','images/nav_glob/accessories_o.gif','images/nav_glob/beauty_fragrance_o.gif','images/nav_glob/model_shots_o.gif');
}

function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != "function") {
		window.onload = func;
	} else {
		window.onload = function() {
	  		oldonload();
	  		func();
		}
	}
}

var InfoNav = {/*
	link	: null,
	nav		: null,
	timer	: null,
	init : function() {
		if (!document.getElementById) { return; }
		this.link = document.getElementById('info-nav-link');
		this.menu = document.getElementById('info-nav-menu');
		if (this.link && this.menu) {
			this.link.onmouseover = function() {
				InfoNav.show();
			};
			this.link.onmouseout = function() {
				InfoNav.hide();
			};
			
			this.menu.onmouseover = function() {
				InfoNav.show();
			};
			this.menu.onmouseout = function() {
				InfoNav.hide();
			};
		}
	},
	show : function() {
	//	alert(this.getTop(this.link));
		this.menu.style.display = 'block';
		//alert(this.menu.offsetHeight);
		this.menu.style.top = (this.getTop(this.link) - this.menu.offsetHeight)+ 'px';
		clearTimeout(this.timer);
	},
	hide : function() {
		this.timer = setTimeout("InfoNav.menu.style.display = 'none'", 500);
	},
	getTop : function(e) {
		var curtop = 0;
		if (e.offsetParent) {
			while (e.offsetParent) {
				curtop += e.offsetTop
				e = e.offsetParent;
			}
		} else if (e.y) {
			curtop += e.y;
			}
		return curtop;
	}*/
};
function goBack() {
	history.go(-1);
}

function showProductQuantity() {
  var i,p,v,obj,args=showProductQuantity.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2]; d=args[i+3];
    if (obj.style) { 
	 	obj=obj.style; 
		v=(v=='show')?'visible':(v=='hide')?'hidden':v; 
		d=(d=='block')?'block':(d=='none')?'none':d; 
	}
    obj.visibility=v;
	 obj.display=d;
	 }
}

function crossBrowserLinkClick(element) {
	if (element.click) {
		element.click();
	} else {
		var href = element.href;
		//strip off the leading 'javascript:'
		var func;
		
		if (href.indexOf('javascript:') > -1) {
			func = href.substr(11);
		} else
			func = href;
			
		//strip the space off (encoded as %20)
		if (func.substr(0, 3) == '%20')
			func = func.substr(3);	

		//run the function
		eval(func);
	}
}

function updateInfoBox(txtHolder, newTxt){
	if (document.getElementById(txtHolder)) {
		document.getElementById(txtHolder).innerHTML = newTxt;
	}
}


/*
	This function should be overloaded in the page if you want to 
	validate a text box

function validate(txtbox)
{
	return true;
}
*/
// Summary: return DOM object
function eGetElementById(e) {
	if (!document.getElementById || !document.getElementById(e)) {
		return null;
	} else {
		return document.getElementById(e);
	}	
}

// Summary: detect if browser has basic DOM support of common objects
function eDomObjDetection() {
	if (!document.getElementById || !document.createElement || !document.createTextNode || !document.getElementsByTagName) {
		return null;
	} else {
		return true;
	}
}

// Summary: sets class name
function eSetClass(e, c) {
	var elem = getElement(e);
	if (elem) {
		elem.className = c
	}
}

// Summary: return DOM element
function getElement(e) {
	if (typeof(e) == "object") {
		return e;
	} else if (typeof(e) == "string") {
		if (eGetElementById(e)) {
			return eGetElementById(e);
		} else {
			return null;
		}
	}
	return null;
}

function eTop(e, c) {
	var elem = document.getElementById(e);
	if (elem) {
		elem.style.top = c + "px";
		elem.style.position = "absolute";
	}
}