$(document).ready(function(){ 
						   
	extLinks();
	replaceHrTag();
	styleSecondCol();
		
	//$('#topimg').flash({
    //	swf: 'swf/fastfuels.swf',
    //	width: 862,
    //	height: 227
	//});	
	
	
	
	

	$(window).bind("load", function() { 				 
 		$('.smallboxes .bottombox').equalHeights;		 
 		$('#footer .inner').equalHeights;
	}); 
	
	$('img[@src$=png]').pngfix();

	var userAgent = navigator.userAgent.toLowerCase();
	// Is this a version of Safari?
	if($.browser.safari){
		$('body').addClass('safari');
		// Add the version number
		userAgent = userAgent.substring(userAgent.indexOf('version/') +8);
		userAgent = userAgent.substring(0,1);
		//$('body').addClass('safari' + userAgent);
	}
	$('.terms').hide();
    $('.slideterms').click(function () {
      if ($(".terms").is(":hidden")) {
        $(".terms").slideDown("slow");
      } else {
        $(".terms").slideUp("slow");
      }
    });
	
	
	
	// Hover emulation for IE 6.
  if ($.browser.msie && parseInt(jQuery.browser.version) == 6) {
   $('#navigation li').hover(function() {
      $(this).addClass('ieHover');
    }, function() {
      $(this).removeClass('ieHover');
    });
   
   
   $('#sidenavigation li').hover(function() {
      $(this).addClass('ieHover1');
    }, function() {
      $(this).removeClass('ieHover1');
    });
  }
  

});

function extLinks(){
	$('a[@rel*="external"]').click(function(){
		window.open(this.href);
		return false;
	});
}

function replaceHrTag(){	
	$("hr").wrap("<div class='divider2'></div>");
}

function StripeTable(){	// must include table plugin to use this function			
	$(".stripeMe tr").mouseover(function(){
		$(this).addClass("over");
	}).mouseout(function(){
		$(this).removeClass("over");
	});
	$(".stripeMe tr:even").addClass("alt");  
}

function styleSecondCol(){
    $('tr').each(function(){		  
		var count=1;
    	$('td').each(function(){
      		count++;
			//alert(count);
			if(count%2 != 0){ 
				$(this).addClass("txtright");
			}
    	})
    })
}


function addPrintLink(){
	// add print page link - since it can only work for JS, only add it for JS users
	$('#print') // create list item
    .addClass('print') //add relevant class to it
    .append('<a href="javascript:window.print();">Print this page</a>') //put in the link
    .insertBefore('li a.foo'); //add before the li item with link of class 'foo'
}

