

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}



function passFocus(oEle) {
	if(oEle.value == ""){
		oEle.style.backgroundImage = 'url()';
	}
}

function passBlur(oEle) {
	if(oEle.value == ""){
		oEle.style.backgroundImage = 'url(../pics/password_bg.gif)';
	}
}

function defaultFocus(oEle, sValue){
	if(oEle.value == sValue){
		oEle.value = '';
	}
}

function defaultBlur(oEle, sValue){
	if(oEle.value == ''){
		oEle.value = sValue;
	}
}

function verifyCallUs() {

	if (document.callUs.email.value == '' || document.callUs.email.value == 'email address' ) {
		alert('Please enter your email address');
		document.callUs.email.focus();
	} else if (document.callUs.name.value == '' || document.callUs.name.value == 'your name') {
		alert('Please enter your name');
		document.callUs.name.focus();
	} else if (document.callUs.enquiry.value == '' || document.callUs.enquiry.value == 'enquiry') {
		alert('Please enter your enquiry');
		document.callUs.enquiry.focus();
	} else {
		document.callUs.submit();
	}
}


function verifyContactForm() {
	if (document.contactForm.name.value == '') {
		alert('Please enter your name');
		document.contactForm.name.focus();
		return false;
	} else if (document.contactForm.email.value == '') {
		alert('Please enter your email address');
		document.contactForm.email.focus();
		return false;
	} else if (document.contactForm.address.value == '') {
		alert('Please enter your address');
		document.contactForm.address.focus();
		return false;
	} else if (document.contactForm.postCode.value == '') {
		alert('Please enter your postcode');
		document.contactForm.postCode.focus();
		return false;
	} else if (document.contactForm.phone.value == '') {
		alert('Please enter your phone number');
		document.contactForm.phone.focus();
		return false;
	} else if (document.contactForm.enquiry.value == '') {
		alert('Please enter your enquiry');
		document.contactForm.enquiry.focus();
		return false;
	} 
	return true;
}

function verifyRegisterForm() {
	if (document.registerForm.title.value == '') {
		alert('Please enter your Title');
		document.registerForm.title.focus();
		return false;
	} else if (document.registerForm.firstname.value == '') {
		alert('Please enter your Firstname');
		document.registerForm.firstname.focus();
		return false;
	} else if (document.registerForm.surname.value == '') {
		alert('Please enter your Surname');
		document.registerForm.surname.focus();
		return false;
	} else if (document.registerForm.h_fromemail.value == '') {
		alert('Please enter your email address');
		document.registerForm.h_fromemail.focus();
		return false;
	} else if (document.registerForm.address.value == '') {
		alert('Please enter your Address');
		document.registerForm.address.focus();
		return false;
	} else if (document.registerForm.town.value == '') {
		alert('Please enter your Town');
		document.registerForm.town.focus();
		return false;
	} else if (document.registerForm.postcode.value == '') {
		alert('Please enter your Postcode');
		document.registerForm.postcode.focus();
		return false;
	}       
	return true;
}

function printPage() {
  if (window.print)
    window.print()
  else
    alert("Sorry, your browser doesn't support this feature.");
}




function popUpWindow(str_URL, str_winName, int_width, int_height) {
	newwindow = window.open(str_URL, str_winName, 'width='+int_width+',height='+int_height+',menubar=off,directories=off,toolbar=off');
	if (window.focus) {newwindow.focus()};
}

function openImage(str_URL, str_title, int_width, int_height, str_resize, str_scroll, str_autoSize) {
	if (int_width == 0) {
		int_width = 600
	} if (int_height == 0) {
		int_height = 400
	} if (str_resize != 'yes') {
		str_resize = 'no'
	} if (str_scroll != 'yes') {
		str_scroll = 'no'
	} if (str_autoSize != 'yes') {
		str_autoSize = 'no'
	}
	
	newWindow = window.open('', '_blank', 'width='+int_width+',height='+int_height+',menubar=off,directories=off,toolbar=off,resizable='+str_resize+',scrollbars='+str_scroll);
	newWindow.document.write("<html>")
	newWindow.document.write("<title>" + str_title + "</title>")
	
	if (str_autoSize == 'yes') {
		if (str_resize == 'yes') {
			newWindow.document.write("<body onload=\"window.resizeTo(800,500); document.getElementById('myImage').width = 750 \">")
		} else {
			newWindow.document.write("<body onload=\"window.resizeTo(document.getElementById('myImage').width+30, document.getElementById('myImage').height+70)\">")
		}
	} else {
		newWindow.document.write("<body>")
	}
	
	newWindow.document.write("<img src='" + str_URL + "' alt='" + str_title + "' id='myImage' />")
	newWindow.document.write("</body>")
	newWindow.document.write("</html>")
	newWindow.document.close()
	if (window.focus) {newWindow.focus()};
}


function init() {
	// on load initialisations here
	// preloadImages();
}
window.onload = init;

function showBigPic(oImage) {
	oZoom = document.getElementById("zoom");
	oPics = document.getElementById("pics");
	oZoomPic = document.getElementById("zoomPic");

	sImage = oImage.src;
	sImage = sImage.replace(/_thumb/,"_large");

	oZoomPic.src = oImage.src;
//	oPics.style.display = "none";
	oZoom.style.display = "block";
	oZoomPic.src = sImage;
}

function hideBigPic() {
	oZoom = document.getElementById("zoom");
	oPics = document.getElementById("pics");

	oPics.style.display = "block";
	oZoom.style.display = "none";
}