/*
	Scroller JS: 
	by Michael Ganz

	Licensed under the Creative Commons Attribution 2.5 License - http://creativecommons.org/licenses/by/2.5/
	(basically, do anything you want, just leave my name)
	
*/

function scroll(direction) {
   var getLi = document.getElementById("gallery").getElementsByTagName("LI");

   for(var i=getLi.length-1; i>0; i--){
      if(getLi[i].style.display != "none"){
         myPos = i;
         break;
      }
   }
   
   myPos++;

   if(direction == "left"){
      if(myPos > 4){
         document.getElementById("galpic"+(myPos)).style.display = "none";
         document.getElementById("galpic"+(myPos-4)).style.display = "block";
      }
   }

   if(direction == "right"){
      if(myPos < getLi.length){
         document.getElementById("galpic"+(myPos+1)).style.display = "block";
         document.getElementById("galpic"+(myPos-3)).style.display = "none";
      }   
   }

   return false;
}

function openPopup(url,width,height,name) {
	var l = (screen.availWidth - width) / 2;
	var t = (screen.availHeight - height) / 2;
	popup = window.open(url,name,"width="+width+",height="+height+",screenX="+l+",screenY="+t+",left=" +l+",top="+t+",location=0,scrollbars=1,resizable=0,menubar=no");
	popup.focus();
	return true;
}
