function addMouseEvents(thepage) {

	windownav=document.getElementById('l-windows');
	windownav.onmouseover=function(){domSwap('windows');};
	windownav.onmouseout=function(){domSwap(thepage);};
	
	windownav=document.getElementById('l-glazing');
	windownav.onmouseover=function(){domSwap('glazing');};
	windownav.onmouseout=function(){domSwap(thepage);};
	
	windownav=document.getElementById('l-doors');
	windownav.onmouseover=function(){domSwap('doors');};
	windownav.onmouseout=function(){domSwap(thepage);};
	
	windownav=document.getElementById('l-conservatories');
	windownav.onmouseover=function(){domSwap('conservatories');};
	windownav.onmouseout=function(){domSwap(thepage);};
	
	windownav=document.getElementById('l-roofline');
	windownav.onmouseover=function(){domSwap('roofline');};
	windownav.onmouseout=function(){domSwap(thepage);};
	
	windownav=document.getElementById('l-guide');
	windownav.onmouseover=function(){domSwap('guide');};
	windownav.onmouseout=function(){domSwap(thepage);};
}

function preloadImages() {
	im1 = new Image(); im1.src = "../x_img/image-windows.jpg";
	im2 = new Image(); im2.src = "../x_img/image-glazing.jpg";
	im3 = new Image(); im3.src = "../x_img/image-doors.jpg";
	im4 = new Image(); im4.src = "../x_img/image-conservatories.jpg";
	im5 = new Image(); im5.src = "../x_img/image-roofline.jpg";
	im6 = new Image(); im6.src = "../x_img/image-guide.jpg";
}



function domSwap(imagename){
	theImg=document.getElementById("main-image");
	thenewimage = "../x_img/image-" + imagename + ".jpg";
	theImg.setAttribute("src",thenewimage);
}

function verify() {
	var msg;
	var empty_fields = "";
	f = document.theform;
	if (f.email.value.length < 1) {
		empty_fields += "\n -       your email address";
	}
	if (f.name.value.length < 1) {
		empty_fields += "\n -       your name";
	}
	if ((f.email.value.length < 1)  || (f.name.value.length < 1)) {
		msg  = "=====   Barnet Window Company   ===== \n\n";
		msg += "In order for us to contact you we need:  \n" + empty_fields + "\n";
		alert(msg);
		return false;
	} else {
		return true;
	}

}

function popFlash(URL) {
	newwindow=window.open(URL,'name','height=300,width=400,top=15,left=15');
}
function popImage(URL) {
	newwindow=window.open(URL,'image','height=10,width=10,top=15,left=15');
}