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);
		}
	});
	// pre-submit callback 
	function beforePost() { 
		$("#contactSubmit").hide();
		$("#submitMessage").show();
	    // here we could return false to prevent the form from being submitted; 
	    // returning anything other than false will allow the form submit to continue 
	    return true; 
	} 
	// post-submit callback 
	function afterPost(rtn)  { 
	    if(rtn=="success") {
	      	$("#quickContactForm").hide();
			$("#contactNotification").fadeIn("slow");
		}else{
	        //there was an error, so grab the UL in the content ID, 
	        //inside the hidden DIV, and put it into the Message Notification
	      $("#errorMessage").html( $("#hiddenDIV #content ul").html() );
		  $("#hiddenDIV").empty(); 
	     }
	}

}
function initContactFormSubmitbak() { //Bind ajaxForm to the FreeForm 
	var rtn="";
	$('#quickContactForm').validate();
	$('#quickContactForm').ajaxForm(
	  {  target:"#hiddenDIV",     //set response to go into hidden div    
	  beforeSubmit:function() {   //before sending submit, give user notification...
		$("#contactSubmit").hide();
		$("#submitMessage").show();
	  },
	   success:function(rtn) { 
	    if(rtn=="success") {
	      	$("#quickContactForm").hide();
			$("#contactNotification").fadeIn("slow");
		}else{
	        //there was an error, so grab the UL in the content ID, 
	        //inside the hidden DIV, and put it into the Message Notification
	      $("#errorMessage").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});
}
$(document).ready(function() {
	initContactFormSubmit();
	initContactLink();
	initBigTargets();
/*	initZindex();  */
	initColorBox();
});