// JavaScript Document



window.addEvent("domready", function(){
	$$("div.galleryimage").each(function(element){
		element.fader=new Fx.Styles(element, {duration:150, wait:false});
		element.setStyle("background-color", "#FFF");
		element.onmouseover=function(){
			this.fader.start({
				backgroundColor: "#e6c687"
			});
		}
		element.onmouseout=function(){
			this.fader.start({
				backgroundColor: "#FFFFFF"
			});
		}
	});
	
	$$("div.galleryimage a").each(function(element){
		element.onclick=function(){
			WH=window.getHeight();
			SH=window.getScrollHeight();
			if(WH>SH){
				coverHeight=WH;
			} else {
				coverHeight=SH;
			}
			window.cover.setStyles({
				height:coverHeight
			});
			window.cover.fader.start({
				opacity:.7
			});
			return false;
		}
	});
	
	window.cover=new Element("Div");
	window.cover.setStyles({
		backgroundColor:"#FFF",
		width:"100%",
		position:"absolute",
		left:"0px",
		top:"0px",
		opacity:0
	});
	window.cover.injectInside(document.body);
	window.cover.fader=new Fx.Styles(window.cover);
});