function initAlternateRows() {
	$('.orange li:nth-child(odd)').addClass('alternate');
	$('.blue li:nth-child(odd)').addClass('alternate');
}
function initBigTargets() {
	$("ul#menu a").bigTarget();
	$("ul.bigTarget a").bigTarget();
	$("div.bigTarget a").bigTarget({
		hoverClass: 'over', // CSS class applied to the click zone onHover
		clickZone : 'div:eq(0)' // jQuery parent selector
	});		
	$("div.bigTarget div.bigTargetnested a").bigTarget({
		clickZone : 'div:eq(1)' // jQuery parent selector
	});		
}
function initContactFormSubmit() { 
	var options = { 
		target:        '#hiddenDIV',   // target element(s) to be updated with server response 
	    beforeSubmit:  beforePost,  // pre-submit callback 
	    success:       afterPost  // post-submit callback 
	}
	$('#quickContactForm').validate({
	    submitHandler: function(form) {
			$('#quickContactForm').ajaxSubmit(options);
		}
	});
	function beforePost() { 
		$("#contactSubmit").hide();
		$("#submitMessage").show();
	    return true; 
	} 
	function afterPost(rtn)  { 
	    if(rtn=="success") {
	      	$("#quickContactForm").hide();
			$("#contactNotification").fadeIn("slow");
		}else{
	      $("#errorMessage").html( $("#hiddenDIV #content ul").html() );
		  $("#hiddenDIV").empty(); 
	     }
	}
}
function initSBGSubmit() { 
	var options = { 
		target:        '#hiddenDIV',   // target element(s) to be updated with server response 
	    beforeSubmit:  beforePost,  // pre-submit callback 
	    success:       afterPost  // post-submit callback 
	}
	$('#sbgRequestForm').validate({
	    submitHandler: function(form) {
			$('#sbgRequestForm').ajaxSubmit(options);
		}
	});
	function beforePost() { 
		$("#sbgSubmit").hide();
		$("#sbgSubmitMessage").show();
	    return true; 
	} 
	function afterPost(rtn)  { 
	    if(rtn=="success") {
	      	$("#sbgForm").hide();
			$("#sbgNotification").fadeIn("slow");
			pageTracker._trackPageview("/conversion-sbg-hp");
		}else{
	      $("#errorsbgMessage").html( $("#hiddenDIV #content ul").html() );
		  $("#hiddenDIV").empty(); 
	     }
	}
}
function initContactLink() {
	$(".contactButton").click(function(){
		$(".quickContact").animate({ height: "440px" }).animate({ height: "340px" }, "fast");
		$("div.contactButton").toggle();
	});
	$("a.contactLink").click(function(){
		$(".quickContact").animate({ height: "440px" }).animate({ height: "340px" }, "fast");
		$("div.contactButton").toggle();
	});
	$('div.hideButton').click(function(){
		$(".quickContact").animate({ height: "0px" }, "fast");
	});	
	  $('div.doneButton').click(function(){
		$('.quickContact').animate({ height: "0px" }, "fast");
		$('div.contactButton').toggle();
	});	
}

function initZindex() {
	$(function() {
		var zIndexNumber = 1000;
		$('div').each(function() {
			$(this).css('zIndex', zIndexNumber);
			zIndexNumber -= 10;
		});
	});
	$('div#colorbox').css('zIndex', 1050);
	$('div#cboxOverlay').css('zIndex', 1050);
	$('div#cboxWrapper').css('zIndex', 1050);
}
function initColorBox() {
	$(".iframe").colorbox({width:"790px", height:"580px", iframe:true, opacity:.75});
}
function initValidateForms() {
	$('#LandingPageForm').validate();
}
$(document).ready(function() {
	initContactFormSubmit();
	initContactLink();
	initBigTargets();
/*	initZindex();  */
	initColorBox();
	initSBGSubmit();
	initValidateForms();
});