/* add hover class to the li boxes */
$(document).ready(function(){
	$('#homepods ul li').mouseover(function(){
      	$(this).addClass("sfhover");
	});
	$('#homepods ul li').mouseout(function(){
      	$(this).removeClass("sfhover");
	});
});

/* add anchors to the li boxes */
$(document).ready(function(){  
	$('#homepods ul li').click(function() {
		var url = $(this).find('a').attr('href');
		window.location.href = "lps/" + url;
	});
});

/* preload images */
$(document).ready(function(){  
	var image1 = $('<img />').attr('src', 'mapping-on.png');
	var image2 = $('<img />').attr('src', 'land-registration-on.png');
	var image3 = $('<img />').attr('src', 'rating-on.png');
	var image4 = $('<img />').attr('src', 'valuation-on.png');
	var image5 = $('<img />').attr('src', 'contact-us-on.png');
	var image6 = $('<img />').attr('src', 'about-lps-on.png');
});

/* swap images on hover */
$(document).ready(function(){  	

    $('#homepods ul li').hover(function () {	
		var imageOn = $(this).find('img');
		imageOn.attr('src', function() { 
      		return this.src.replace('-off','-on'); 
    	});
    }, function () {
		var imageOff = $(this).find('img');
		imageOff.attr('src', function() { 
      		return this.src.replace('-on','-off'); 
    	});
    });
});

