function blurAnchors(){
if(document.getElementsByTagName) {
var a = document.getElementsByTagName("a");
for(var i = 0; i < a.length; i++){
a[i].onfocus = function(){this.blur();};
}
}
}

window.onload = blurAnchors;

$(document).ready(function(){

	var validator = $("#contact").validate({
	rules: {
	'first' : "required",
	'last' : "required",	
	'email' : { required: true, email: true },
	'enquiry': "required"
	},
	messages: {
	'first'  : "",
	'last'  : "",
	'email': "",
	'enquiry': ""	
	}
	});
	
	$("#gallery img").fadeTo("slow", 0.4); 
		$("#gallery img").hover(function(){
			$(this).fadeTo("fast", 1.0); 
		},function(){
			$(this).fadeTo("fast", 0.4); 
	});	
	
	thumbcontainerwidth = $('#thumbnails ul').children().size() * 72; 
	$("#thumbnails ul").width(thumbcontainerwidth);
	
	$("#arrow-right").mouseover(function() {
	    $("#gallery ul").animate({left: -$("#thumbnails ul").width()+610}, {duration: 5000, easing: "swing"});
	}).mouseout(function() {
	    $("#gallery ul").stop();
	});

	$("#arrow-left").mouseover(function() {
	    $("#gallery ul").animate({left: "0px"}, {duration: 5000, easing: "swing"});
	}).mouseout(function() {
	    $("#gallery ul").stop();
	});

	$("#gallery a").click(function(){

		var id = $(this).attr("href");
		var img = new Image();
	  
     $("#screen").hide().load(function() {
	  		$(this).fadeIn("slow")
	  }).attr('src', id);
		
		return false;
	});	 
	 
});

function addbookmark() {
	title = "StudioModerna.co.uk - creative protography";
	url = "http://www.studiomoderna.co.uk/";

	if (window.sidebar) {
		window.sidebar.addPanel(title, url,"");
	} else if( window.external ) {
		window.external.AddFavorite(url, title);
	}
}