// JavaScript Document


function openWin(image_name) { 
        //var imagepath = "http://a820.g.akamai.net/f/820/822/1d/i.ivillage.co.uk/uk_en/a_ukpix/celebrity/" + image_name + ".jpg";
		var imagePath = "/images/products/" + image_name
        //first part above is an akamai tag - 

       	var newWindow = window.open(image_name,'Large','titlebar=no,toolbar=no,location=no,scrollbars=no');
		
		newWindowHTML = "<html><head><style>body{margin:0;padding:0} div.popup img{margin-left:17px;}</style></head><body><div class=\"popup\"><img onLoad=\"window.resizeTo(document.load_image.width + 100,document.load_image.height + 80)\" name=\"load_image\" src=\"" + imagePath + "\"></div></body></html>"
	
		newWindow.document.open()
		newWindow.document.write(newWindowHTML)
		newWindow.document.close()
		newWindow.document.focus() // make the winow jump to the front
		
		
 } 


function togglediv(menu,image){


	if (document.getElementById) { // check for a decent browser
		
			var menuToSwitch // which menu is to be displayed or hidden
			var menuStatus // current status of the menu
	
			menuToSwitch = document.getElementById(menu)
			imageToSwitch = document.getElementById(image)
			
	
			if (menuToSwitch != null){
	
			menuStatus = menuToSwitch.style.display
	
			if (menuStatus=="none" || menuStatus==""){ //if its none or blank show it
				//alert(menuToSwitch.className)	
				menuToSwitch.style.display = "block"
				imageToSwitch.src = "/images/contract.gif"
				//menuToSwitch.parentNode.className = "on"
			} else { // otherwise hide it
				menuToSwitch.style.display = "none"
				imageToSwitch.src = "/images/expand.gif"
				//menuToSwitch.parentNode.className = ""
			}
		}
	
	}
	
	
	
}




	
	
function dojump(){
	
	temp = QueryString("bkmark")
	
	
	
	if (temp){	
	window.location='#' + QueryString("bkmark")
	}
	
	
}
	


	
	

//
// QueryString
//

function QueryString(key)
{
	var value = null;
	for (var i=0;i<QueryString.keys.length;i++)
	{
		if (QueryString.keys[i]==key)
		{
			value = QueryString.values[i];
			break;
		}
	}
	return value;
}
QueryString.keys = new Array();
QueryString.values = new Array();

function QueryString_Parse()
{
	var query = window.location.search.substring(1);
	var pairs = query.split("&");
	
	for (var i=0;i<pairs.length;i++)
	{
		var pos = pairs[i].indexOf('=');
		if (pos >= 0)
		{
			var argname = pairs[i].substring(0,pos);
			var value = pairs[i].substring(pos+1);
			QueryString.keys[QueryString.keys.length] = argname;
			QueryString.values[QueryString.values.length] = value;		
		}
	}

}

QueryString_Parse();


