
      function isIE()
      {
      	return /msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent);
      }
	  
	  function scrollingDetector(){

			//alert("You are at " + document.body.scrollTop + " pixels.");
			if(isIE())
			{
				document.getElementById('blackoutDiv').style.top = document.body.scrollTop + "px";
			} else {
				document.getElementById('blackoutDiv').style.top = window.pageYOffset + "px";
			}
			
			
		}


	function showForm() {
		var w = document.getElementById('myDiv').style.width;
		var h = document.getElementById('myDiv').style.height;
		if(isIE())
		{
			document.getElementById('myDiv').style.left = (document.documentElement.clientWidth / 2) - (w.substring(0,w.length - 2) / 2) + "px";
			document.getElementById('myDiv').style.top = (document.documentElement.clientHeight / 2) - (h.substring(0,h.length - 2) / 2) + "px";			
			document.getElementById('blackoutDiv').style.width = document.documentElement.clientWidth - 25  + "px";
			//document.getElementById('blackoutDiv').style.height = document.documentElement.clientHeight + "px";
			document.getElementById('blackoutDiv').style.height = "100%";
		} else
		{	
			document.getElementById('myDiv').style.left = (window.innerWidth / 2) - (w.substring(0,w.length - 2) / 2) + "px";
			document.getElementById('myDiv').style.top = (window.innerHeight / 2) - (h.substring(0,h.length - 2) / 2) + "px";
			document.getElementById('blackoutDiv').style.width = window.innerWidth - 25  + "px";
			//document.getElementById('blackoutDiv').style.height = window.innerHeight + "px";
			document.getElementById('blackoutDiv').style.height = "100%";	
		}
		
		setInterval("scrollingDetector()", 50);
		

		//document.body.style.overflow="hidden";
		//document.scroll="no";
		document.getElementById('myDiv').style.visibility = "visible";
		document.getElementById('blackoutDiv').style.visibility = "visible";
		document.getElementById('myDiv').style.display = "block";
		document.getElementById('blackoutDiv').style.display = "block";
		window.location.href = "#top";
	}
	function hideForm() {
		document.body.style.overflow="visible";
		document.scroll = "yes";
		document.getElementById('myDiv').style.display = "none";
		document.getElementById('blackoutDiv').style.display = "none";
		document.getElementById('myDiv').style.visibility = "hidden";
		document.getElementById('blackoutDiv').style.visibility = "hidden";
		document.getElementById('blackoutDiv').style.width = "1px";
		document.getElementById('blackoutDiv').style.height = "1px";
		document.getElementById('myDiv').style.left = "0px";
		document.getElementById('myDiv').style.top = "0px";
		
		setInterval("scrollingDetector()", 5000000);
	}



//FUNCTION FOR PHOTOZ PAGE ONLY

	function showForm2(img2) {
		var w = document.getElementById('myDiv').style.width;
		var h = document.getElementById('myDiv').style.height;
		var imgpath = img2.src.substring(img2.src.lastIndexOf("/"));
		imgpath = imgpath.replace("-thumb.jpg", ".jpg");
		//alert(imgpath);
		if(isIE())
		{
			document.getElementById('myDiv').style.left = (document.documentElement.clientWidth / 2) - (w.substring(0,w.length - 2) / 2) + "px";
			document.getElementById('myDiv').style.top = (document.documentElement.clientHeight / 5) - (h.substring(0,h.length - 2) / 4) + "px";
			document.getElementById('blackoutDiv').style.width = document.documentElement.clientWidth - 25  + "px";
			document.getElementById('blackoutDiv').style.height = document.documentElement.clientHeight + "px";
		} else
		{	
			document.getElementById('myDiv').style.left = (window.innerWidth / 2) - (w.substring(0,w.length - 2) / 2) + "px";
			document.getElementById('myDiv').style.top = (window.innerHeight / 5) - (h.substring(0,h.length - 2) / 2) + "px";
			document.getElementById('blackoutDiv').style.width = window.innerWidth - 25  + "px";
			document.getElementById('blackoutDiv').style.height = window.innerHeight + "px";
			//alert( document.getElementById('myDiv').style.left );
			//alert(document.getElementById('myDiv').style.top);
		}		
		
		var tempdiv = document.getElementById('myDiv');
		tempdiv.innerHTML = "<center><table border='0' cellspacing='0' cellpadding='0' width='400' style='padding-top: 50px; padding-bottom: 50px;'><tr><td width='400' valign='top'><img src='/photos" + imgpath + "' alt='' /></td></tr><td align='center' valign='bottom'><br /><span style='cursor: pointer; text-decoration: underline;' onclick='hideForm();'><b>CLOSE</b></span></td></tr></table></center>";
		
		//var img = document.createElement("IMG");
		//img.src = "img/dir.gif";
		//document.getElementById('image').appendChild(img);

		document.body.style.overflow="hidden";
		document.scroll="no";
		document.getElementById('myDiv').style.visibility = "visible";
		document.getElementById('blackoutDiv').style.visibility = "visible";
		document.getElementById('myDiv').style.display = "block";
		document.getElementById('blackoutDiv').style.display = "block";
		//window.location.href = "#top";
	}
