var isPopup = false;
	
function chiudi()
	{
	
	parent.window.close();
	
	}
	
	
	function setIsPopup()
	{
		if(window.opener)			
		{
			openerHref = self.location.href;		
			if (openerHref!=''){
			   if (openerHref.indexOf("http://www.skirama.it") > -1 || openerHref.indexOf("http://skirama") > -1){
					isPopup = true; 
			   }else{
					isPopup = false;
			   }
			}
		}		
	}
	
	
	
	function onClickLink(linkHref)
	{
		if (isPopup){	
			//alert("popup");		
			if (window.opener){
				window.opener.location = linkHref;
			}
			window.close();
		}else{		
			//alert("no popup");				
			document.location = linkHref;
		}
	}	
	
	
	
	function fitPic() {
	
		iWidth = document.getElementById("fImg").img.width + 40;
		iHeight = document.getElementById("fImg").img.height + 280;	
		if(iWidth > 810)
		{
			iWidth = 810;
		}
		if(iHeight > 684)
		{
			iHeight = 684;
		}
		window.resizeTo(iWidth, iHeight);
		self.focus();
	};	