/**
 * This code will help to make the Tinbu content more user-friendly.
 * This code requires jquery.
 *
 */
 
$(function()
{
	//Removes the div that pops up when hovering over the gas prices or locations
	$('#tinbu_content tr').removeAttr('onmouseover').removeAttr('onmouseout');
	
	//Removes the onclick events from table cells
	$('#tinbu_content td.TdWx').removeAttr('onclick');
	
	//Wraps the top zip code search box in a div
	$('#tinbu_content table.WxSearchTbl:first').wrap('<div class="search_tinbu"></div>');
	
	//Wraps first table in a div
	$('#tinbu_content table:has(span[class=titletext]):first').wrap('<div class="tinbu_460"></div>');	
		
	//Wraps the "My Gas Prices" table in a div
	$('#tinbu_content table:has(span[class=titletext]:contains("My Gas Prices")):first').wrap('<div class="tinbu_460"></div>');	
	
	//Wraps U.S. Gas Prices table in a div (becasue it has a flash in it which is a specific size)
	$('#tinbu_content table:has(span[class=titletext]:contains("U.S. Gas Prices")):first').wrap('<div class="tinbu_440"></div>');	
	
	//Wraps Price table cell in a div
	$('#tinbu_content td.TdWx:has(div[class=PriceFont])').addClass('tinbu_price');
	
	//Removes specific width for tables
	$('#tinbu_content table[width]').attr('width', '100%');
	
	//Add a class to the Average, Low and High gas prices td
	$('#tinbu_content td.TdWx:has(span[class=GasPriceBox]):eq(0)').addClass('gas_price_average');
	$('#tinbu_content td.TdWx:has(span[class=GasPriceBox]):eq(1)').addClass('gas_price_low');
	$('#tinbu_content td.TdWx:has(span[class=GasPriceBox]):eq(2)').addClass('gas_price_high');
	
	//Makes the Tinbu content visible once all the formatting has taken place
	$('#tinbu_content').css('display','block');
});
