// JavaScript Document

// home reports code - september/october 2008

$(document).ready(function() {
	$("#hrExtraLinks").show();
	$("#hrFriendLink").click(function()
		{
			$("#hrSEND").show();
		});
	$("#hrCloseFriend").click(function()
		{
			$("#hrSEND").hide();
		});
});

function checkHRform()
{
	var myName1 = $("#name1").val();
	var myEmail1 = $("#email1").val();
	var myName2 = $("#name2").val();
	var myEmail2 = $("#email2").val();
	
	var AtPos1 = myEmail1.indexOf("@");
	var AtPos2 = myEmail2.indexOf("@");
	
	if (AtPos1 == -1 || AtPos2 == -1)
	{
		$("#hrError").show();
		return false;
	}

	
	if ( (myName1 == '') || (myEmail1 == '') || (myName2 == '') || (myEmail2 == ''))
	{
		$("#hrError").show();
		return false;
	}
}

//end


// video on buying page - 0ct 08

$(document).ready(function() {
	
	$("#newVideoHolder").css({'display': "block"});
	$("#newVideoHeader").toggle(
		function ()
		{
			$(this).css({'background-image': "url(/images/video_open.gif)"});
			$("#newVideoBody").slideToggle("normal");
		},
		function ()
		{
			$(this).css({'background-image': "url(/images/video_closed.gif)"});
			$("#newVideoBody").slideToggle("normal");
		}
	);
	
	$("#videoReportLink").click(function()
		{
			$("#videoReportLink").hide();
			$("#videoReportLink2").show();
			$("#videoReportForm").show();
		});
		
	$("#videoReportLink2").click(function()
		{
			$("#videoReportLink2").hide();
			$("#videoReportLink").show();
			$("#videoReportForm").hide();
			$("#videoMSG1").hide();
		});
});

// end

// video contact form validation - oct 08

function checkVideoForm() {
	var videoName = $("#videoName").val();
	var videoEmail = $("#videoEmail").val();
	var videoComments = $("#videoComments").val();
	
	if ( (videoName == '') || (videoEmail == '') || (videoComments == '') )
	{
		$("#videoMSG1").slideToggle();
		return false;
	}
}

// end


// iGoogle widget - November 2008 

$(document).ready(function() {
	
	$("#spHeader").hover(
      function () {
		$(this).addClass("hover");
      }, 
      function () {
		$(this).removeClass("hover");
      }
    );
	
	$("#spHeader").toggle(
			function ()
			{
				$(this).find('img').attr({src:"/images/widget_arrow_2.gif", alt:"Hide stored properties", title:"Hide stored properties"});
				$("#spTag").show();
			},
			function ()
			{
				$(this).find('img').attr({src:"/images/widget_arrow_1.gif", alt:"Show stored properties", title:"Show stored properties"});
				$("#spTag").hide();
			}
	);
	
});

// end



// new post a home page - nov 08

$(document).ready(function() {

	$(".myTB").show();

	$(".pyoTable tbody tr").hover(	
		function ()
		{
			$(this).addClass("pyoTableHover");
      	}, 
      	function ()
		{
			$(this).removeClass("pyoTableHover");
      	}
	);
	
	$("#pyoShowSuspended a").click(function()
			{
				$("#pyoShowSuspended a").hide();
				$("#pyoSuspended").show();
			}
		);
	
	$("#pyoHideSuspended a").click(function()
			{
				$("#pyoShowSuspended a").show();
				$("#pyoSuspended").hide();
			}
		);

});				   

// end


// iGoogle widget - hide footer workaround - november 2008

/*

$(document).ready(function() {

	$("#widgetPic a").hover(	
		function ()
		{
			$("#footer").css({'display': "none"});
      	}, 
      	function ()
		{
			$("#footer").css({'display': "block"});
      	}
	);

});

*/

// end





//  street view links on details page

$(document).ready(function() {

	$(".svLink").show();

});

// end



