<!--
var logotimer = 500;
var logopos = 0;

function updateLogos(){
	window.clearTimeout(logotimer);
	$.ajax({
		url: "/process/client_logos.php",
		cache: false,
		type: "POST",
		data: "&pos=" + logopos,
		success: function(data){
			if(logopos >= data.length){ logopos = 0; }
			$('#clientlink').html(data[logopos]);
			logopos++;
			logotimer = window.setTimeout('updateLogos()',5000);
		}
	});
}

$(document).ready(function(){
	var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;

	if(document.getElementById('tree')){
		Cufon.replace('#tree h1',{ fontFamily:'calibri bi', textShadow:'1px 1px #fff, -1px -1px #000' });
		Cufon.replace('#tree p',{ fontFamily:'arial tt', textShadow:'1px 1px 0px #fff' });
	}
	if(document.getElementById('boxes')){
		Cufon.replace('#boxes .read a',{ fontFamily:'arial tt' });
		Cufon.replace('#boxes .title',{ fontFamily:'GeoSlab' });
		Cufon.replace('.hometext h2',{ fontFamily:'GeoSlab' });
	}
	if(document.getElementById('counterwrap')){
		var n = $('#counterwrap').attr('class');
		loadticker(n);
	}
	if(document.getElementById('pagetitle')){
		Cufon.replace('#pagetitle p',{ fontFamily:'calibri bi', textShadow:'1px 1px #fff, -1px -1px #000' });
	}

	if(document.getElementById('pagetitle')){
		Cufon.replace('#rightpanel p.title',{ fontFamily:'GeoSlab', textShadow:'1px 1px 0px #fff, -1px -1px #e5e5e5', color: '-linear-gradient(#d8d6cf, #c4c2bc)' });
	}

	if(document.getElementById('rightpanel')){
		var str = $('#rightpanel').html()+"";
		if(str.length <= 3){
			$('#rightpanel').css({'display':'none'});
			$('#pagepanel').css({'width':'908px','margin-right':0})
		}
	}

	if(document.getElementById('clientlink')){ updateLogos(); }

	$('#navigation a.nav').mouseover(function(){
		if($(this).parent('li').find('ol').html()){
			var ol = $(this).parent('li').find('ol');
			var off = $(this).position();
			$(ol).css({'margin-left':(off.left) + 'px','z-index':'1000 !important'}).toggle();
		}
	}).mouseout(function(){
		if($(this).parent('li').find('ol').html()){
			var ol = $(this).parent('li').find('ol');
			var off = $(this).position();
			$(ol).css({'margin-left':(off.left) + 'px'}).toggle();
		}
	});

	$('#navigation ol').mouseover(function(){
		var par = $(this).parent('li').find('a.nav');
		par.addClass('sel');
		$(this).css({'display':'block','z-index':'1000 !important'});
	}).mouseout(function(){
		var par = $(this).parent('li').find('a.nav');
		par.removeClass('sel');		
		$(this).css({'display':'none'});
	});


	$('#boxes .panel').click(function(){
		if($(this).find('a').attr('onclick')){ window.open($(this).find('a').attr('href')); } else { window.location=$(this).find('a').attr('href'); return false; }
	});

	$('#header ul a').click(function(){ window.open( $(this).attr('href')); return false; });
	$('a.target').click(function(){ window.open( $(this).attr('href')); return false; });
	$('#navigation a:last').css({'margin-right':0})
	$('#boxes .panel:last').css({'margin-right':0})
	$('#pagepanel p:last').css({'padding-bottom':0})

	$('#contactsubmit').click(function(){ $("#contactform").submit(); });
	$('#contactform').bind('submit', function(){
		$('#contactsubmit').css('display','none');
		$('.req').css('border','1px solid #e7e4d7');
		if( ($("#data_fullname").val().length < 1) || ($("#data_companyname").val().length < 1) || ( ($("#data_emailaddress").val().length < 1) && emailReg.test($('#data_emailaddress').val()) ) || ($("#data_telephone").val().length < 1) ){
			$("#contactform p.error").html('Please ensure you complete all <span class=\"mandatory\">required</span> fields').slideDown().delay('3000').slideUp();
			$("#contactform .f").each(function(){ if($(this).val().length < 1 && $(this).hasClass('req')){ $(this).css('border','1px solid #c00'); } });
			$('#contactsubmit').css('display','block');
			return false;
		} else {
			$.ajax({
				url: "/process/contact_enquiry.php",
				cache: false,
				type: "POST",
				data: $(this).serializeArray(),
				success: function(data) {
					$('#contactform').html(data);
				},
				error: function(data){
					$("#contactform p.error").html('Sorry, there was an error processing your details. Please try again').slideDown().delay('3000').slideUp();
					$('#contactsubmit').css('display','block');
					return false;
				}
			});
		}
	});

});

//-->
