//////////////////////////////////////////////////////
//
//	The purpose of this file is to
//	apply a hover class on mouseover
//	on the <li> elements in the nav.
//	This is because IE doesn't put
//	the pseudo class :hover on <li> elements
//
//	This is code that uses the
//	jquery javascript library (http://jquery.com/)
//
//////////////////////////////////////////////////////
$(window).load(function() {

	$('.listingBox').each(function(){
		var anchors = $(this).find('a');
		
		$(this).find('.listingInfoLeft').load(anchors[0].href + ' .propertyInfo1');
		$(this).find('.listingInfoRight').load(anchors[0].href + ' .propertyInfo2');
		$(this).find('.listingDescription').load(anchors[0].href + ' .description');
		anchors.each(function(){
			$(this).replaceWith($(this).html());
		});
	});

	/*$('.listingImageBox').each(function()
	{
		var imageHolder = $(this).children('.listingImageHolder')[0];
		var images = $(imageHolder).children();
		this.numImages = images.length;
		this.images = images;
		if(this.numImages < 1)
			return;
		this.curr = 0;
		$(images[0]).show();
		var p = $(this).children('p');
		this.number = $(p).children('.number')[0];
	});
	
	$('.leftArrow').click(function()
	{
		var temp = $($(this).parent()).parent();
		var imageBox = temp[0];
		if(imageBox.curr != 0)
		{
			$(imageBox.images[imageBox.curr]).hide();
			imageBox.curr = Math.abs((imageBox.curr - 1) % imageBox.numImages);
			$(imageBox.images[imageBox.curr]).show();
			$(imageBox.number)[0].innerHTML = imageBox.curr + 1;
		}
		return false;
	});
	
	$('.rightArrow').click(function()
	{
		var temp = $($(this).parent()).parent();
		var imageBox = temp[0];
		if(imageBox.curr != (imageBox.numImages - 1))
		{
			$(imageBox.images[imageBox.curr]).hide();
			imageBox.curr = Math.abs((imageBox.curr + 1) % imageBox.numImages);
			$(imageBox.images[imageBox.curr]).show();
			$(imageBox.number)[0].innerHTML = imageBox.curr + 1;
		}
		return false;
	});*/
});
