$(document).ready(function() {
	
	if ( $("#VC-navigation li a:contains('Equipment for sale')").length ) { 
		
		$(".rollovermenu li a:contains('Equipment for sale')").removeAttr("href").attr("name", "");
	}
	
	if ( $("table.clearance") ) {
		$("table.clearance").parent().find("h2").remove()

		$("table.clearance").wrap("<div class='sidepod-wrap'><div class='sidepod-bottom'/></div>").parent().before("<div class='sidepod-top'><h2>Featured equipment</h2></div>");
	}
});



 
this.imagePreview = function(){	
	
		xOffset = 10;
		yOffset = 30;
			
	var text = new String;
	
	$("#inventory-table-ajax td a").mouseenter(function(e){
		
		 
		if ( $(this).attr("href") == "javascript:newWindow('[PDF LOCATION][PDF FILENAME]');") {
	
		
			$(this).parent().find('.pdf-sect').text("No PDF available").css({"background" : "#fff", "padding-left" : "10px", "text-align" : "center" });
			
			$(this).click(function(e) { 
				e.preventDefault();
			})
		
		}
		
		
		
		text = $(this).parent().find("div.preview").html();

		$("body").append("<div id='preview'>" + text + "</div>");								 
		$("#preview")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");
			
			
		
    });
	
	
	
	$("#inventory-table-ajax td a").mouseout(function(e){
		$("#preview").empty().remove();
		text = "";
	});
	
	

			
};



	
	function newWindow(currentLink){if(currentLink!==null||currentLink!=='undefined'){window.open("http://www.macquarie.com" + currentLink,'_blank');}}
