// Show floating image by Ilya Titov for clifton hotel
//get scroll position


function showIt(picLink, picTitle, picHeight, picWidth){
	var y;
	var test1 = document.body.scrollHeight;
	var test2 = document.body.offsetHeight
	if (test1 > test2) // all but Explorer Mac
	{
		y = document.body.scrollHeight;
	}
	else // Explorer Mac;
		 //would also work in Explorer 6 Strict, Mozilla and Safari
	{
		y = document.body.offsetHeight;
	}
	var scrollTop = document.body.scrollTop;
	if (scrollTop == 0){
		if (window.pageYOffset){
			scrollTop = window.pageYOffset;
		}else {
			scrollTop = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0;
		}
	}
	//visible area
	 var winW;
	 var winH;
	 
	 // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
	 
	 if (typeof window.innerWidth != 'undefined')
	 {
		  winW = window.innerWidth,
		  winH = window.innerHeight
	 }else if (typeof document.documentElement != 'undefined'// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
		 && typeof document.documentElement.clientWidth !=
		 'undefined' && document.documentElement.clientWidth != 0)
	 {
		   winW = document.documentElement.clientWidth,
		   winH = document.documentElement.clientHeight
	 }else {// older versions of IE
		   winW = document.getElementsByTagName('body')[0].clientWidth,
		   winH = document.getElementsByTagName('body')[0].clientHeight
	 }
	

	var e = document.getElementById("floatingPic");
	e.style.top = (scrollTop+((winH)/2)-((picHeight+20)/2))+'px';
	e.style.marginLeft = "-"+((picWidth+20)/2)+"px";
	e.innerHTML = '<img src="'+picLink+'" alt="'+picTitle+'" /><br /><!--span style=\"position:absolute; margin-top:10px; color:#ddd; font-size:.8em; background-color:#707070; margin-left:-10px; padding:.3em 1em .3em 10px; \">This photograph is&nbsp;protected by&nbsp;copyright and&nbsp;can&nbsp;not be&nbsp;used without written permission.</span -->';
	var f = document.getElementById("fill");
	f.style.top = 0+'px';
	f.style.height = y+'px';

}
function hideIt(){
	var e = document.getElementById("floatingPic");
	e.style.top = "-2000px";
	var f = document.getElementById("fill");
	f.style.top = "-2000px";
	f.style.height = "1px";
}