
Cufon.replace('.sidebar .entry h2 span.cufon');

$(function(){
    
	$('a.details-link').click(function(){
		$('.pop-up').slideUp();
		$('.pop-up').parent().css('z-index', '2');
		
		var pop_up = $(this).parent().parent().parent().parent().parent().parent().find('.pop-up');
		var _height = $(this).parent().parent().parent().parent().parent().parent().find('.box-b').height();
		
		$(pop_up).parent().css('z-index', '100');
		$(pop_up).css('top', _height+17+'px')
		if($(pop_up).is(":visible"))
		{
			$(pop_up).slideUp();
		}
		
		else
		{
			$(pop_up).slideDown();	
		}
		
		return false;
	});
    
	
	$('.options-table tr').each(function() {
		$(this).find('td:eq(3)').bt(
		'Between the main arrival station and your "TO" address',{
		  padding: 15,
		  width: 133,
		  spikeLength: 80,
		  spikeGirth: 40,
		  cornerRadius: 20,
		  fill: '#f0d9af',
		  strokeWidth: 3,
		  strokeStyle: '#7f7f7f',
		  cssStyles: {color: '#000', fontSize: '12px'},
		  
	          shadow: true,
	          shadowOffsetX: 3,
		  shadowOffsetY: 3,
		  shadowBlur: 8,
		  shadowColor: 'rgba(0,0,0,.9)',
		  shadowOverlap: false,
		  noShadowOpts: {strokeStyle: '#999', strokeWidth: 2}	
		});
	});
	
	$('.options-table tr').each(function() {
		$(this).find('td:eq(2)').bt(
		'Between main transit stations',{
		  padding: 20,
		  width: 135,
		  spikeLength: 80,
		  spikeGirth: 20,
		  cornerRadius: 20,
		  fill: '#f0d9af',
		  strokeWidth: 3,
		  strokeStyle: '#7f7f7f',
		  cssStyles: {color: '#000', fontSize: '12px'},
		  
		shadow: true,
		shadowOffsetX: 3,
		shadowOffsetY: 3,
		shadowBlur: 8,
		shadowColor: 'rgba(0,0,0,.9)',
		shadowOverlap: false,
		noShadowOpts: {strokeStyle: '#999', strokeWidth: 2}
		});
	});
	
	$('.options-table tr').each(function() {
		$(this).find('td:eq(1)').bt(
		'Between your "FROM" address and the main departure station',{
		  padding: 20,
		  width: 150,
		  spikeLength: 80,
		  spikeGirth: 20,
		  cornerRadius: 20,
		  fill: '#f0d9af',
		  strokeWidth: 3,
		  strokeStyle: '#7f7f7f',
		  cssStyles: {color: '#000', fontSize: '12px'},
		  
		shadow: true,
		shadowOffsetX: 3,
		shadowOffsetY: 3,
		shadowBlur: 10,
		shadowColor: 'rgba(0,0,0,.9)',
		shadowOverlap: false,
		noShadowOpts: {strokeStyle: '#999', strokeWidth: 2}
		});
	});
	
	$('.sidebar .travel-modes h2').bt('Clicking a <input type="checkbox"/> or a <a href="#">link</a> will turn on/off that kind of transportation from your results <br /><strong>Example: <em>Clicking <a href="#">Walk</a> will exclude results with any amount of walking, even just to a subway stop (you\'ll probably get lots of taxi results) </em></strong>', {
	  contentSelector: "$(this).attr('rel')",
	  paddingTop: 15,
	  paddingBottom: 15,
	  width: 333,
	  spikeLength: 80,
	  spikeGirth: 40,
	  cornerRadius: 20,
	  fill: '#f0d9af',
	  strokeWidth: 3,
	  strokeStyle: '#7f7f7f',
	  cssStyles: {color: '#000', fontSize: '12px', left: '-30px'},
	  
	shadow: true,
	shadowOffsetX: 3,
	shadowOffsetY: 3,
	shadowBlur: 8,
	shadowColor: 'rgba(0,0,0,.9)',
	shadowOverlap: false,
	noShadowOpts: {strokeStyle: '#999', strokeWidth: 2}
	});
	
	$('a.save-link').bt(
	'Click <a href="#">HERE</a> to take taxi only for this leg of your trip!<br/><span style="color:red">Warning</span>! This may change your best option, so we"ll refresh your results' ,{
	  padding: 15,
	  width: 210,
	  spikeLength: 80,
	  spikeGirth: 40,
	  cornerRadius: 20,
	  fill: '#f0d9af',
	  strokeWidth: 3,
	  strokeStyle: '#7f7f7f',
	  cssStyles: {color: '#000', fontSize: '12px', textAlign:'center', left: '0'},
	  
	shadow: true,
	shadowOffsetX: 3,
	shadowOffsetY: 3,
	shadowBlur: 8,
	shadowColor: 'rgba(0,0,0,.9)',
	shadowOverlap: false,
	noShadowOpts: {strokeStyle: '#999', strokeWidth: 2},
	positions: ['left']
	});
	
	$('.search-form label:eq(0)').bt('If you type in your address, Catapulter will give you DOOR TO DOOR DIRECTIONS - This includes WALKING, METRO or TAXI <br /><strong>directions to the station!</strong>',{
	  padding: 15,
	  width: 200,
	  spikeLength: 80,
	  spikeGirth: 40,
	  cornerRadius: 20,
	  fill: '#f0d9af',
	  strokeWidth: 3,
	  strokeStyle: '#7f7f7f',
	  cssStyles: {color: '#000', fontSize: '11px', textAlign: 'center'},
	  positions: ['left'],
	shadow: true,
	shadowOffsetX: 3,
	shadowOffsetY: 3,
	shadowBlur: 8,
	shadowColor: 'rgba(0,0,0,.9)',
	shadowOverlap: false,
	noShadowOpts: {strokeStyle: '#999', strokeWidth: 2}
	});
	
	$('.search-form label:eq(1)').bt('If you type in your address, Catapulter will give you WALKING, METRO or TAXI <strong>directions from the station to your EXACT destination!</strong>',{
	  padding: 15,
	  width: 200,
	  spikeLength: 80,
	  spikeGirth: 40,
	  cornerRadius: 20,
	  fill: '#f0d9af',
	  strokeWidth: 3,
	  strokeStyle: '#7f7f7f',
	  cssStyles: {color: '#000', fontSize: '11px', textAlign: 'center'},
	  
	shadow: true,
	shadowOffsetX: 3,
	shadowOffsetY: 3,
	shadowBlur: 8,
	shadowColor: 'rgba(0,0,0,.9)',
	shadowOverlap: false,
	noShadowOpts: {strokeStyle: '#999', strokeWidth: 2}
	});
	
	$('.blink').focus(function () {
		if ($(this).val() == $(this).attr('title')) {
			$(this).css('color', '#000').val('');
		}
	});
	
	$('.blink').blur(function () {
		if ($(this).val() == '') {
			$(this).css('color', '#000').val($(this).attr('title'));
		}
	});
	
	
})

