//Create Columns of even height on the same page

function evenHeights (col1, col2){
	//Make column heights even
	//alert("col1: " + $(col1).height() + " col2: "+ $(col2).height());
	$(col1).css('height','auto');
	$(col2).css('height','auto');
	//alert("col1: " + $(col1).height() + " col2: "+ $(col2).height());
	var col1height = $(col1).height();
	var col2height = $(col2).height();
	var col1total = $(col1).outerHeight();
	var col2total = $(col2).outerHeight();
	var dif = col1total - col2total;
	
	if (dif > 0) {
		$(col2).height(col2height + dif);
	}
	else {
		$(col1).height (col1height + (dif*-1));
	}
	//alert("col1: " + $(col1).height() + " col2: "+ $(col2).height());
}


$(document).ready(function(){


			Cufon.replace('nav, h1, h2, h2.form-title, h3, h4, #slideshow ul.itemlist-slides ul.subitemlist li.item-caption, .quote, ul.sidemenu li a', { fontFamily: 'DIN Offc', hover: true });
			Cufon.replace('.fuel, .quote li.item-author', {fontFamily: 'DIN Offc', hover: true, textShadow: '1px 2px 2px #000' });																														  					
	

	$('.newsbox .article-body a.article-more-link')
		.each(function(){
			var more = $(this).text();
			$(this).html(more.replace('[more]','continue &gt;'));
		});
	

	evenHeights('.newsbox', '.quote');

$('ul.itemlist-affiliationlogos li.item-logo a').attr('target','_blank');


$(".tracking")
       .fancybox({
           width: 600,
           height:300,
           padding:40,
           margin:0,
           type: 'iframe'
       });



var track_box = $("#trackinput");
 
        // If the user clicks the input box and the text is "search here!",
        //    set it to blank
	track_box.click(function() {
       if( track_box.attr("value") == "enter tracking number" ) {
 
       		// Set it to an empty string
        	track_box.attr("value", "").css({'color':'black','font-style':'normal'});
       }
});


	var termsbox = $('input.termsconditions');
	//var termsshow = $('.sponsoroptions');
	var termsshow = $('.accept');
	if(termsbox.is(':checked')){
		termsshow.show();
	}
	else{
		termsshow.hide();
	}
	
	termsbox.click(function(){
		if($(this).is(':checked')){
			termsshow.show();
		}
		else{
			termsshow.hide();
		}
	});




});		

