$(document).ready(function(){
	$("div#claw-nav li.cl_link.link a").each(function(){
		var src = $("img",this).attr("src");
		src = src.replace(/([-]link)/,"-hover");
		claw.navigation.link($(this),src);
	});
	$("div#claw-content div.cl_features li.cl_link a").each(function(){
		var src = $("img",this).attr("src");
		src = src.replace(/([.]png)/,"-hover.png");
		claw.navigation.link($(this),src);
	});
	$("div#claw-sidebar div.cl_content div.cl_buttons ul.cl_links li.cl_link a").each(function(){
		var src = $("img",this).attr("src");
		src = src.replace(/([.]png)/,"-hover.png");
		claw.navigation.link($(this),src);
	});	
	$("div.cl_thumb a").each(function(){
		var imgSrc = $(this).attr("href");
		$(this).attr("href","javascript:void(0);");
		var imgSrcStart = imgSrc.search(/imagepath=/i);
		var imgSrc = imgSrc.slice(imgSrcStart+10,imgSrc.length);
		var imgSrcEnd = imgSrc.search(/[&]/);
		var imgSrc = imgSrc.slice(0,imgSrcEnd);
		var img = $('<img src="'+imgSrc+'" />');
		claw.modal.trigger($(this),img,$(this).text());
	});
	$("div#option1").hover(function () {
			$(this).css('background-position', 'bottom');
		},
		function(){
			$(this).css('background-position', 'top');
		});
	$("div#option2").hover(function () {
			$(this).css('background-position', 'bottom');
		},
		function(){
			$(this).css('background-position', 'top');
		});
	$("div#viewademoquick").hover(function () {
			$(this).css('background-position', 'right');
		},
		function(){
			$(this).css('background-position', 'left');
		});
	$("div#downloadinfoquick").hover(function () {
			$(this).css('background-position', 'right');
		},
		function(){
			$(this).css('background-position', 'left');
		});
	$("div#contactusquick").hover(function () {
			$(this).css('background-position', 'right');
		},
		function(){
			$(this).css('background-position', 'left');
		});
	$("span.listheadersblue").hover(function () {
			$(this).css('text-decoration', 'underline');
		},
		function(){
			$(this).css('text-decoration', 'none');
		});
	$(".scrollylink").each(function(){
          var x=$(this).attr("href").match(/[#][a-z0-9_-]+/i).toString();
          $(this).attr("href","javascript:void(0);").click(function(){
                    $("html,body").animate({scrollTop:$(x).offset().top},1000);
              });
     });
	$(".scrollylinkfaq").each(function(){
          var x=$(this).attr("href").match(/[#][a-z0-9_-]+/i).toString();
          $(this).attr("href","javascript:void(0);").click(function(){
                    $("html,body").animate({scrollTop:$(x).offset().top},1000);
              });
     });
	 
	swfobject.embedSWF("http://www.youtube.com/v/ZG_jZBzvLi0&hl=en_GB&fs=1&", "flashMovie", "425", "344", "9.0.0");
	
	/*if (document.images)
	{
	  pic1= new Image(100,25); 
	  pic1.src="../img/topNavHover_BG.jpg"; 

	  pic2= new Image(240,55); 
	  pic2.src="../img/homeButton_BG.jpg"; 

	  pic3= new Image(88,31); 
	  pic3.src="../img/dl_panelBF_movie.jpg"; 
	  
	  pic4= new Image(240,55); 
	  pic4.src="../img/dl_panelBF_rapi.jpg"; 

	  pic5= new Image(88,31); 
	  pic5.src="../img/dl_panelBF_pdf.jpg"; 
	}*/


});


/** Validates the sales form **/

function validateSalesForm() {

	var stopForm = 0;

	$(".validate").each(function() {

		if ($(this).val() == ""){

			stopForm = 1;

		}		

	});
	
	if (stopForm == 0) {

		var emailString = $(".validateEmail").val();

		
	
		var apos=emailString.indexOf("@");
		var dotpos=emailString.lastIndexOf(".");
		
		if (apos<1||dotpos-apos<2) {
			alert('Please enter a valid email address');
			return false;
		}
	    
	
	}

	if (stopForm) {

		alert('Please complete the required fields.');

		return false;

	} 

}



