// JavaScript Document
	
function contact()
	{
	empty = false;
	fm 	= document.email_form;
	checker(fm.sender_name,"Please enter your Name");
	checker(fm.sender_email,"Please enter your E-mail address");
	checker(fm.sender_tel,"Please enter your contact phone number");
	checker(fm.message,"Please enter a message");
	email_validator(fm.sender_email)
	if (empty == false){document.email_form.submit()}
	}

function checker(obj,msg){if(obj.value=="" && empty==false){alert(msg);empty=true;obj.focus()}}
	
//Email Validator Functions
function email_validator(obj)
	{
	var emailStr=obj.value;var emailPat=/^(.+)@(.+)$/;
	var specialChars="\\(\\)!£$%^&*()+='#~?<>@,;:\\\\\\\"\\.\\[\\]";var validChars="\[^\\s" + specialChars + "\]";var quotedUser="(\"[^\"]*\")";var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
	var atom=validChars + '+';var word="(" + atom + "|" + quotedUser + ")";var userPat=new RegExp("^" + word + "(\\." + word + ")*$");var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");var matchArray=emailStr.match(emailPat)
	if ((matchArray==null) && empty==false){message("Email address seems incorrect (check @ and .'s)",obj)}
	if (empty==false){var user=matchArray [1];var domain=matchArray [2];if (user.match(userPat)==null){message("The username doesn't seem to be valid.",obj)}}
	if (empty==false){var IPArray=domain.match(ipDomainPat);if (IPArray!=null){for (var j=1;j<=4;j++){if (IPArray[j]>255){message("Destination IP address is invalid!",obj)}}}}
	if (empty==false){var domainArray=domain.match(domainPat);if (domainArray==null){message("The domain name doesn't seem to be valid.",obj)}}
	if (empty==false){var atomPat=new RegExp(atom,"g");var domArr=domain.match(atomPat);var len=domArr.length;if (domArr[domArr.length-1].length<2 || domArr[domArr.length-1].length>3){message("The address must end in a three-letter domain, or two letter country.",obj)}}
	if ((len<2) && empty==false){message("This address is missing a hostname!",obj)}
	}
function message(msg,obj){alert(msg);empty=true;obj.focus()}
// End Email Validator Functions


function flash_movie()
	{
	if (document.all)
	{
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="758" height="180" id="movie" align="middle">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="movie" value="/flash/fade.swf" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="bgcolor" value="#000000" />');
	document.write ('<param name="wmode" value="transparent"/>')
	document.write('<embed src="/flash/fade.swf" quality="high" bgcolor="#000000" width="758" height="180" name="movie" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
	}
	else
	{
   document.write ('<object type="application/x-shockwave-flash" data="/flash/fade.swf" width="758" height="180">')
	document.write ('<param name="movie" value="/flash/fade.swf"/>')
	document.write ('<param name="wmode" value="transparent"/>')
	document.write ('<img src="/flash/images/001.jpg" alt="" />')
	document.write ('</object>') 
	}
	}
	
	

var stripe = function() 
	{
	if(document.getElementById("filmstrip"))
		{
		var a=document.getElementById("filmstrip").getElementsByTagName("IMG");
		for(var b=0;b<a.length;b++)
			{
			a[b].onmouseover=function(){cursor_sniff(this.style)}
			a[b].onmouseout=function(){}
			a[b].onclick=function(){document.getElementById("master").src=this.src.replace("filmstrip","photos");var y=document.getElementById("filmstrip").getElementsByTagName("IMG");for(var z=0;z<y.length;z++){y[z].className="nomaster"};this.className="master"}				
			}
		}
			
	var tables = document.getElementsByTagName("table");  
	
	for(var x=0;x!=tables.length;x++){
	var table = tables[x];
	if (! table) { return; }
	
	var tbodies = table.getElementsByTagName("tbody");
	
	for (var h = 0; h < tbodies.length; h++) {
	  var even = true;
	  var trs = tbodies[h].getElementsByTagName("tr");
	  
	  for (var i = 0; i < trs.length; i++) {
		trs[i].onmouseover=function(){
		  this.className += " ruled"; return false
		}
		trs[i].onmouseout=function(){
		  this.className = this.className.replace("ruled", ""); return false
		}
		
		if(even)
		  trs[i].className += " even";
		
		even = !even;
	  }
	}
	}
	if (document.getElementById("thumbs"))thumbnails()	
	}

window.onload = stripe;