function validate(evt) {
  var theEvent = evt || window.event;
  var key = theEvent.keyCode || theEvent.which;
 // alert(key);
  if(key == 46 || key == 8){
  }
  else{
	  key = String.fromCharCode( key );  
	  var regex = /[0-9]|\./;
	  if( !regex.test(key) ) {
		theEvent.returnValue = false;
		theEvent.preventDefault();
	  }
  }
}


$(document).ready(function() {	
	$("ul#mnav li#"+section).addClass("active");//Highlight the users current location

	//set background images
	if(section == 'home'){
		$('body').css({ 'background': 'url(images/imgBkgHome.jpg)', 'background-repeat': 'no-repeat', 'background-position': 'center top'});
	}
	//set background images
	if(section == 'splash'){
		$('body').css({ 'background': 'url(images/bkgSplash.jpg)', 'background-repeat': 'no-repeat', 'background-position': 'center top'});
	}
	
	//Why Structured Settlement Nav
	$('#whyStructNav ul li:nth-child(1)').addClass('active');	
	$('#whyStruct div:nth-child(1)').addClass('active');	
	$('#whyStructNav ul li').click(function(evt){
		var theIndex = $('#whyStructNav ul li').index(this) +1;
		//alert(theIndex);
		$(this).siblings("li").removeClass("active");
		$(this).addClass("active");
		$("#whyStruct").fadeOut('fast',function() {
			$("#whyStruct div").hide();							  
			$("#whyStruct div:nth-child("+theIndex+")").css({ 'display': 'block'});					  
			$("#whyStruct").fadeIn('fast');					  
			
		});		
		
	});
	
	// FAQs
	$('#faqs .grey-Column-Main h2').click(function(){	
		$(this).next("div").slideToggle("fast");
		$(this).toggleClass("active");				
 	 });
	
	if($("input#email").val() ==""){
		$("input#email").val("myname@address.com");
	}
	$("input#email").focus(function(){
		if(this.value=='myname@address.com'){this.value=''}
	});
	
	//Rollovers for downloads	
	$('.download img').each(function () {	
		var $span = $(this).css('opacity', 0.9);																																														
		$(this).hover(function () {	
			$span.stop().animate({opacity: 1}, 100);
		}, function () {		
			$span.stop().animate({opacity: 0.9}, 100);				
		});
	});
	
	//Rollovers for proceed	
	$('#proceed img').each(function () {	
		var $span = $(this).css('opacity', 0.9);																																														
		$(this).hover(function () {	
			$span.stop().animate({opacity: 1}, 100);
		}, function () {		
			$span.stop().animate({opacity: 0.9}, 100);				
		});
	});
	//Rollovers for email	
	$('#search-btn').each(function () {	
		var $span = $(this).css('opacity', 0.9);																																														
		$(this).hover(function () {	
			$span.stop().animate({opacity: 1}, 100);
		}, function () {		
			$span.stop().animate({opacity: 0.9}, 100);				
		});
	});
	
	//Rollovers for buttons	
	$('#btnSearch').each(function () {	
		var $span = $(this).css('opacity', 0.8);																																														
		$(this).hover(function () {	
			$span.stop().animate({opacity: 1}, 100);
		}, function () {		
			$span.stop().animate({opacity: 0.8}, 100);				
		});
	});
	$('#search-btn input').each(function () {	
		var $span = $(this).css('opacity', 0.8);																																														
		$(this).hover(function () {	
			$span.stop().animate({opacity: 1}, 100);
		}, function () {		
			$span.stop().animate({opacity: 0.8}, 100);				
		});
	});
	
	
	
});



