// Basic jQuery for form and page functions //
$(document).ready(function() {
var gmap = "https://maps.googleapis.com/maps/api/staticmap?center="+ ip_address +"&zoom=8&size=1000x150&sensor=true&scale=2";

$("#header").css("background-image","url("+gmap+")");

//$('select.pbuy').val(pbuy);
//$('select.state').val(state);
$("#commentForm3").validate();
$("#selling").click(function () {
	$("#mainContent").fadeOut(300);
	$("#sellerContent").fadeIn(300);
	$("#commentForm").validate();
});
$("#buying").click(function () {
	$("#mainContent").fadeOut(300);
	$("#buyerContent").fadeIn(300);
	$("#commentForm2").validate();
});
$(".back").click(function () {
	$(this).parent().fadeOut(300);
	$("#mainContent").fadeIn(300);
});

$(".tip").focusin(
	function(){
		$(this).parent().prev().fadeIn(400);
        $(this).parent().addClass("focus");
        $(this).parent().prev().addClass("ftool_tip");
	});
$(".tip").focusout(
	function(){
		$(this).parent().prev().fadeOut(100);
        $(this).parent().removeClass("focus");
        $(this).parent().prev().removeClass("ftool_tip");
	});

$(".tip").hover(
	function(){
		$(this).parent().prev().fadeIn(400);
		$(this).parent().css("background","#DCFAFF");
	},
	function(){
		$(this).parent().prev().hide();
		$(this).parent().css("background","#fff");
	});
if(failed == "seller"){
	$("#mainContent").hide(1);
	$("#sellerContent").fadeIn(1);
	$("#commentForm").validate();
}
if(failed == "buyer"){
	$("#mainContent").hide(1);
	$("#buyerContent").fadeIn(1);
	$("#commentForm2").validate();
}
});

