// JavaScript Document

$(document).ready(function() {
	makeithappen();
});

$("#normal").click(function(){
	makeithappen();										
	$('#bigger').removeClass("current");
	$('#biggest').removeClass("current");
	$('#normal').addClass("current");
});

$("#bigger").click(function(){
	makeithappen();										
	$('#normal').removeClass("current");
	$('#biggest').removeClass("current");
	$('#bigger').addClass("current");
});

$("#biggest").click(function(){
	makeithappen();										
	$('#normal').removeClass("current");
	$('#bigger').removeClass("current");
	$('#biggest').addClass("current");
});


$(function()
	{
		// Call stylesheet init so that all stylesheet changing functions 
		// will work.
		$.stylesheetInit();
		
		// This code loops through the stylesheets when you click the link with 
		// an ID of "toggler" below.
		$('#toggler').bind(
			'click',
			function(e)
			{
				$.stylesheetToggle();
				return false;
			}
		);
		
		// When one of the styleswitch links is clicked then switch the stylesheet to
		// the one matching the value of that links rel attribute.
		$('.styleswitch').bind(
			'click',
			function(e)
			{
				$.stylesheetSwitch(this.getAttribute('rel'));
				return false;
			}
		);
	}
);


function makeithappen() {
		var accessibility = readCookie('style');
		if (accessibility=="normal" || accessibility==null) {
			removeClass()
			$.stylesheetSwitch('normal');
			$('#normal').addClass("current");
		}
		else if (accessibility=="bigger") {
			removeClass()
			$.stylesheetSwitch('bigger');
			$('#bigger').addClass("current");	
		}
		else if (accessibility=="biggest") {
			removeClass()
			$.stylesheetSwitch('biggest');
			$('#biggest').addClass("current");
		}
		return false;
}

function removeClass() {
	var normal=$('#normal').removeClass("current");
	var bigger=$('#bigger').removeClass("current");
	var biggest=$('#biggest').removeClass("current");
}

jQuery(document).ready(function() {
			jQuery('#slideshow').cycle({ 
				fx:    'fade', 
				speed: 2000,
				timeout:  3000,
				pause:  1
			});
		});


jQuery(".videothumb a").click(function() {
    var ajaxURL = jQuery(this).attr('href');
	jQuery("#videodisplay").load(ajaxURL);
	return false;
});

jQuery(".videothumb").hover(function(){jQuery(this).find(".thumbCaption").show();}, function(){jQuery(this).find(".thumbCaption").hide();});

jQuery(".defaultImage").hover(function(){jQuery(this).find(".thumbCaption").show();}, function(){jQuery(this).find(".thumbCaption").hide();});




// iContact Opt-in Form

var icpForm1927 = document.getElementById('icpsignup1927');

if (document.location.protocol === "https:")

	icpForm1927.action = "https://app.icontact.com/icp/signup.php";
function verifyRequired1927() {
  if (icpForm1927["fields_email"].value == "") {
    icpForm1927["fields_email"].focus();
    alert("The Email field is required.");
    return false;
  }


return true;
}
