// Email Validation
			
	function isValidEmailAddress( emailAddress ) {
	var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
	return pattern.test(emailAddress);
}

// Number Validation (Validates that a field contains only numbers.)

	function validateNumeric( strValue ) {

	var objRegExp  = new RegExp(/^\d+(?:\.\d{0,2})?$/i);

  	return objRegExp.test(strValue);
}


// Max Length Text Area

function imposeMaxLength(Object, MaxLen)
{
  return (Object.value.length <= MaxLen);
}


// Nav Buttons

$(document).ready(
				function(){
					$('.homebtn').hover(function() {
					  $(this).addClass('homebtn_hov');
					  
					}, function() {
					  $(this).removeClass('homebtn_hov');
					  
					});
					
			});
			
$(document).ready(
				function(){
					$('.shopbtn').hover(function() {
					  $(this).addClass('shopbtn_hov');
					  
					}, function() {
					  $(this).removeClass('shopbtn_hov');
					  
					});
					
			});
			
$(document).ready(
				function(){
					$('.eventsbtn').hover(function() {
					  $(this).addClass('eventsbtn_hov');
					  
					}, function() {
					  $(this).removeClass('eventsbtn_hov');
					  
					});
					
			});
			
$(document).ready(
				function(){
					$('.mediabtn').hover(function() {
					  $(this).addClass('mediabtn_hov');
					  
					}, function() {
					  $(this).removeClass('mediabtn_hov');
					  
					});
					
			});
			
$(document).ready(
				function(){
					$('.locationsbtn').hover(function() {
					  $(this).addClass('locationsbtn_hov');
					  
					}, function() {
					  $(this).removeClass('locationsbtn_hov');
					  
					});
					
			});
			
// Send Button

$(document).ready(
				function(){
					$('.sendBtn').hover(function() {
					  $(this).addClass('sendBtn_hover');
					  
					}, function() {
					  $(this).removeClass('sendBtn_hover');
					  
					});
					
			});
			
$(document).ready(
				function(){
					$('.sendBtn_finance').hover(function() {
					  $(this).addClass('sendBtn_finance_hover');
					  
					}, function() {
					  $(this).removeClass('sendBtn_finance_hover');
					  
					});
					
			});

			
// View Locations Button

$(document).ready(
				function(){
					$('.viewlocationsBtn').hover(function() {
					  $(this).addClass('viewlocationsBtn_hover');
					  
					}, function() {
					  $(this).removeClass('viewlocationsBtn_hover');
					  
					});
					
			});
			
// Ask Question Button

$(document).ready(
				function(){
					$('.askquestionbtn').hover(function() {
					  $(this).addClass('askquestionbtn_hover');
					  
					}, function() {
					  $(this).removeClass('askquestionbtn_hover');
					  
					});
					
			});
			
// Finance Button

$(document).ready(
				function(){
					$('.financebtn').hover(function() {
					  $(this).addClass('financebtn_hover');
					  
					}, function() {
					  $(this).removeClass('financebtn_hover');
					  
					});
					
			});
			
// Media Image Zoom

$(document).ready(function() {
	
	$("a.picpop").fancybox({
		'hideOnContentClick': false,
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	200, 
		'speedOut'		:	200,
		'titleShow'     :   false
	});	
});

// Home Innerfade

$(document).ready(
		
		function(){
			$('ul#imginner').innerfade({
				speed: 1000,
				timeout: 3000,
				type: 'sequence',
				containerheight: '165px'
			});	
});

// Home Jquery Paginate

$(function(){

		var wrap = $('#home_btmmid_inner');

		// set up click events to trigger the pagination plugins' behaviour 

		$('.prev').click(function(){
			wrap.trigger('prev.evtpaginate');
			return false;
		});

		$('.next').click(function(){
			wrap.trigger('next.evtpaginate');
			return false;
		});

		// listen out for events triggered by the plugin to update the counter

		wrap.bind( 'initialized.evtpaginate', function(e, startnum, totalnum ){
			$('#count').text(startnum);
			$('#total').text(totalnum);
		}); 

		wrap.bind( 'finished.evtpaginate', function(e, num, isFirst, isLast ){ $('#count').text(num); } ); 	

		wrap.evtpaginate({perPage:4}); // call the plugin!	

});

// Media Paginate

$(function(){

		var wrap = $('#mediawrap');

		// set up click events to trigger the pagination plugins' behaviour 

		$('.prev').click(function(){
			wrap.trigger('prev.evtpaginate');
			return false;
		});

		$('.next').click(function(){
			wrap.trigger('next.evtpaginate');
			return false;
		});

		// listen out for events triggered by the plugin to update the counter

		wrap.bind( 'initialized.evtpaginate', function(e, startnum, totalnum ){
			$('#count').text(startnum);
			$('#total').text(totalnum);
		}); 

		wrap.bind( 'finished.evtpaginate', function(e, num, isFirst, isLast ){ $('#count').text(num); } ); 	

		wrap.evtpaginate({perPage:9}); // call the plugin!	

});



