// JavaScript Document

//////////
var currentNav = "Home";
var previousNav = "";
/////////
function changeHeight() 
{ 
var divHeight = document.getElementById("mainBox").offsetHeight;
document.getElementById("contentMiddleBackground").style.height = (divHeight-1240)+"px"; 
}
//

/*function mainNav(myId,whichPage){
	if(myId.id != currentNav){
		previousNav = currentNav;
		currentNav = myId.id;

		$("#highlight"+previousNav).css("opacity", "0");  /////// turn off previous image highlight
		$("#highlight"+currentNav).css("opacity", "1");  /////// turn on current image highlight
		 
		$(".the"+previousNav).css({ "opacity": ".37" });  /////// restore previous nav type
	
		$("#logo"+previousNav).css("opacity", "0");  /////// turn old logo color off
		$("#logo"+currentNav).css("opacity", "1");  /////// turn new logo color on
	
		//document.getElementById('mainContent').innerHTML = "<object width="+"1040"+" height="+"1500"+" type="+"text/html"+" data="+currentNav+".html"+"></object>";
		//alert(currentNav);
		

	}
	
}*/
function rollOver(id){
	var checkId = id.id;
	//alert(checkId);
		$(".the"+checkId).css({ "opacity": "1" });
}
function rollOut(myId){
	var checkId = myId.id;
	 $(".the"+checkId).css({ "opacity": ".37" });
}
//////////
function rollOver2(myId){
	var checkId = myId.id;
	 $("#"+checkId+"Text").css({"color":"#FFFFFF"});
}
function rollOut2(myId){
	var checkId = myId.id;
	 $("#"+checkId+"Text").css({ "color": "#8C8481" });
}
/////// Contact Form Handler /////////////
jQuery(document).ready(function(){
	
	$('#contactform').submit(function(){
	
		var action = $(this).attr('action');
		
		$("#nameErrorMessage").slideUp(0,function() {
			$('#nameErrorMessage').hide();
		
 			$('#submit')
				.after('<img src="images/loading.gif" class="loader" />')
				.attr('disabled','disabled');
		
			$.post(action, { 
				name: $('#name').val(),
				email: $('#email').val(),
				comments: $('#comments').val(),
				verify: $('#verify').val()
		},
		function(data){
			document.getElementById('nameErrorMessage').innerHTML = data;
			$('#nameErrorMessage').slideDown(0);
			$('#contactform img.loader').fadeOut('slow',function(){$(this).remove()});
			$('#submit').removeAttr('disabled'); 
			if(data.match('success') != null) $('#contactform').slideUp(0);
				
		}
	);
});
		
		return false; 
	
	});
	
});
