function initBigTargets() {
	$("div.bigTarget h4 a").bigTarget({
		hoverClass: 'over', // CSS class applied to the click zone onHover
		clickZone : 'div:eq(0)' // jQuery parent selector
	});		
}
function initRequestBalanceSubmit() { 
	var options = { 
		target:        '#hiddenDIV',   // target element(s) to be updated with server response 
	    beforeSubmit:  beforePost,  // pre-submit callback 
	    success:       afterPost  // post-submit callback 
	}
	$('#RequestAcctBal').validate({
	    submitHandler: function(form) {
			$('#RequestAcctBal').ajaxSubmit(options);
		}
	});
	// pre-submit callback 
	function beforePost() { 
		$("#RequestAcctBalSubmit").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") {
	      	$("#RequestAcctBal").hide();
			$("#notification").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 initBecomeCustomer() { 
	var options = { 
		target:        '#hiddenDIV',   // target element(s) to be updated with server response 
	    beforeSubmit:  beforePost,  // pre-submit callback 
	    success:       afterPost  // post-submit callback 
	}
	$('#BecomeCust').validate({
	    submitHandler: function(form) {
			$('#BecomeCust').ajaxSubmit(options);
		}
	});
	// pre-submit callback 
	function beforePost() { 
		$("#BecomeCustSubmit").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") {
	      	$("#BecomeCust").hide();
			$("#notification").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 initRequestServiceCallSubmit() { 
	var options = { 
		target:        '#hiddenDIV',   // target element(s) to be updated with server response 
	    beforeSubmit:  beforePost,  // pre-submit callback 
	    success:       afterPost  // post-submit callback 
	}
	$('#ServiceCallRequest').validate({
	    submitHandler: function(form) {
			$('#ServiceCallRequest').ajaxSubmit(options);
		}
	});
	// pre-submit callback 
	function beforePost() { 
		$("#ServiceCallRequestSubmit").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") {
	      	$("#ServiceCallRequest").hide();
			$("#notification").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 initUpdateAcctInfoSubmit() { 
	var options = { 
		target:        '#hiddenDIV',   // target element(s) to be updated with server response 
	    beforeSubmit:  beforePost,  // pre-submit callback 
	    success:       afterPost  // post-submit callback 
	}
	$('#UpdateAcctInfo').validate({
	    submitHandler: function(form) {
			$('#UpdateAcctInfo').ajaxSubmit(options);
		}
	});
	// pre-submit callback 
	function beforePost() { 
		$("#UpdateAcctInfoSubmit").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") {
	      	$("#UpdateAcctInfo").hide();
			$("#notification").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 initPayBillOnline() { 
	$('#PayBillOnlineCheckout').validate();
	$('#PayBillOnline').validate();
}
function initMapPopUp() {
	$("div#serviceArea a").fancybox({
		'titleShow'		: false,
		'transitionIn'	: 'none',
		'transitionOut'	: 'none'
	});
}
function initZindex() {
	$(function() {
		var zIndexNumber = 1000;
		$('div').each(function() {
			$(this).css('zIndex', zIndexNumber);
			zIndexNumber -= 10;
		});
	});
	$('div#cboxOverlay').css('zIndex', 1050);
	$('div#colorbox').css('zIndex', 1051);
	$('div#cboxWrapper').css('zIndex', 1052);
}
$(document).ready(function() {
	initBigTargets();
	initRequestBalanceSubmit();
	initBecomeCustomer();
	initRequestServiceCallSubmit();
	initUpdateAcctInfoSubmit();
	initPayBillOnline();
	initMapPopUp();
//	initZindex();
	});
