function preloadAllImages() {
	MM_preloadImages('images/header/GrundigUK_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 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 imageswapper_swap(targetImage, newImagePath) {
	if (!document.getElementById(targetImage)) // If the target image exists
	  return;
	 
	if (!document.images[targetImage]) // If not an image
	  return;
	
	document.images[targetImage].src = newImagePath;
}

/*
 * A function handle the onkeydown event for a text box.
 * Requires the id of an image button to call a click event on.
 * NOTE: Enabling any of the alert boxes stops the function from
 * working correctly if there is an input box before the target
 * button in the form.
 */
function handleOnKeyDownEvent (evt, targetButton)
{
  // assign the event argument if available.
  evt = (evt) ? evt : ((window.event) ? window.event : "");
  
  //alert('calling keydown event handler for target ' + targetButton);
  
  if (!evt) return true;
  
	if ((evt.which && evt.which == 13) || (evt.keyCode && evt.keyCode == 13)) {
	  
	  //alert('Processing event.');
	  var targetButtonControl = document.getElementById(targetButton);
		
/*		if (document == null)
		  alert('doc is null');
		
		if (document.forms[0] == null)
		  alert('doc.frm is null');
		
		if (document.forms[0].elements == null)
		  alert('doc.frm.elem is null');
		
		if (document.forms[0].elements[targetButton] == null)
		  alert('doc.frm.elem.ctrl is null');*/
		
		if (targetButtonControl == null) { targetButtonControl = document.forms[0].elements[targetButton]; }

	  //alert('Got control with id [' + targetButton + '].');
	  
	  if (targetButtonControl != null) {// && targetButtonControl.click) {
			//alert('Found target button to click. ' + targetButtonControl.id);
	    targetButtonControl.click(); 
			//alert('Target button clicked.');
	  }
	  /*else 
	  {
		  if (targetButtonControl == null) {
				alert('Control is null.'); 
			}
		  else { alert('Control has no click.'); }
	  }*/
	  return false;
	}
	/*else 
	{ 
		alert('not enter button clicked but: '); 
	}*/
	return true; 
}