$(document).ready(function(){
	$('#lg_frame li').click(function(){  //Scroll To DIV
		var current = $(this).attr('id');
		var new_id = "#slide"+current.substring(2,3);
//		$.scrollTo(new_id,800); // ISSUE IS HERE
	});
	$('#location').focus(function(){ //SET FOCUS OF SEARCH BOX
		if($(this).val() == "City, State Zip"){ //Clear Search from Value
			$(this).val('');
		}
		$(this).addClass('focus');
	});
	$('#location').blur(function(){ //SET FOCUS OF SEARCH BOX
		if($(this).val() == ""){
			$(this).val('City, State Zip');
			$(this).removeClass('focus');
		}
	});
	
	$('#s').focus(function(){ //SET FOCUS OF SEARCH BOX
		if($(this).val() == "Search"){ //Clear Search from Value
			$(this).val('');
		}
		$(this).addClass('focus');
	});
	$('#s').blur(function(){ //SET FOCUS OF SEARCH BOX
		if($(this).val() == ""){
			$(this).val('Search');
			$(this).removeClass('focus');
		}
	});
	$('form ul li').click(function(){
		if($(this).is('.check') && $('input',this).is(':checked')){
			$(this).toggleClass('uncheck');
			$('input',this).removeAttr('checked');
		}
		else{
			$(this).removeClass('uncheck');
			$(this).addClass('check');
			
			$('input',this).attr('checked', true);
		}
	});
	$('form ul li input').click(function(){
		if($(this).is(':checked')){
			$(this).removeAttr('checked');
			$(this.parentNode).toggleClass('uncheck');
		}
		else{
			$(this).attr('checked',true);
			$(this.parentNode).removeClass('uncheck');
			$(this.parentNode).addClass('check');
		}
	});
	$('a.link_external').click(function(){  //External Pages
		this.target = "_blank";
	});
	$('#facebook_orange').click(function(){  //External Pages
		this.target = "_blank";
	});
	$("#bottom_solicit").submit(function(){	//On Submit, Check Form Validation
		if($('#bottom_solicit').validationEngine({returnIsValid:true})){ // Validation
			var email = $('#usr_email').val();
			var postString = 'usr_email='+email;
			$.ajax({
				type: "POST",
				url: "http://homeguy.com/src/news_post.php",
				data: postString,
				success: function(){
					$.validationEngine.closePrompt('.formError',true);					
					$('#bottom_solicit').slideUp(300,function(){
						$('#srv_msg').slideDown(300);
					});
				}
			});
		return false;
		
		}
	});
	
	
	
});
