// 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/uploads/" + 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 + 50,document.load_image.height + 60)\" 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 showmenu(menu){
	
		//toggle the menus visibility
		
		
		if (document.getElementById) { // check for a decent browser
		
		
			//  //close all open menus
		
			//closeAll()
			
			var menuToSwitch // which menu is to be displayed or hidden
			var menuStatus // current status of the menu
	
			menuToSwitch = document.getElementById(menu)
						
			menuStatus = menuToSwitch.style.display

	
	
			if (menuStatus=="none" || menuStatus==""){ //if its none or blank show it
				//alert(menuToSwitch.className)	
				menuToSwitch.style.display = "block"
				menuToSwitch.parentNode.className = "on"
			} else { // otherwise hide it
				
				menuToSwitch.style.display = "none"
				menuToSwitch.parentNode.className = ""
			}
			
			
		}
	}
	
	
	function setupMenu(target){
	
	
		if (target.length > 0){
		
			showmenu('section' + target)
		}
	
	}
	
	
	function closeAll(){
	
	
		varTemp = document.getElementById("submenu").getElementsByTagName("UL")
		
		//alert(varTemp.length)
		
		for(i=0;i<varTemp.length;i++){
			varTemp[i].style.display = "none"
		}
	
	}