$(function()
{

	//$("#collapse-more").hide();
	if ($("#collapse-more").length && $("p.btn-read-more").length) {
		$("p.btn-read-more a").click(function() {
			$("#collapse-more").slideToggle(700, function() {
				$("p.btn-read-more a").toggleClass("more-hide");
				($("p.btn-read-more a").hasClass("more-hide")) ? $("p.btn-read-more a").html("Read More +") : $("p.btn-read-more a").html("Read Less -");
	      		});
		  
			return false;
		});
	}
	
	$(".equal-column").equalHeights();

  
	$('div.rotate, div.rotateLeft').cycle({ 
		fx: 'fade', 
		speed: 1500,
		timeout: 5500  
	});
	
	$('div.rotateRight').cycle({ 
		fx: 'fade', 
		speed: 1500,
		timeout: 7000  
	});
	
	
    //Res Widget Stuff

	$("form#tRes").submit(function(){
		var city 	= $("select[name='city']").val();
		var inDate 	= $("input[name='startDate']").val();
		var inTime	= $("select[name='ResTime']").val();
		var dtCombo = inDate+' '+inTime;
		$("input[name='d']").val(dtCombo);
		
		
		if (city==0){
			$("input[name='rid']").val('');
			$("input[name='rest']").val('');
			$("form#tRes").attr("action","http://www.opentable.com/cityhouse-reservations-new-york?rid=45520&restref=45520");

		}
		if (city==1){
			$("input[name='rid']").val('');
			$("input[name='rest']").val('');			
			$("form#tRes").attr("action","http://www.opentable.com/cityhouse-reservations-new-york?rid=45520&restref=45520");
		}

		if (city==2){
			$("input[name='rid']").val('');
			$("input[name='rest']").val('');
			$("form#tRes").attr("action","http://www.opentable.com/cityhouse-parc-55-hotel-reservations-san-francisco?rid=31408&restref=31408");
		}
		if (city==3){
			$("input[name='rid']").val('');
			$("input[name='rest']").val('');			
			$("form#tRes").attr("action","http://www.opentable.com/cityhouse-reservations-arlington?rid=840&restref=840");
		}
		if (city==4){
			$("input[name='rid']").val(62914);
			$("input[name='rest']").val(62914);
			$("form#tRes").attr("action","http://www.opentable.com/single.aspx?rid=62914&restref=62914");
		}
		
		
	});
  
	Cufon.replace('h1', { fontFamily: 'Humanst521 Cn BT' });
	Cufon.replace('h2', { fontFamily: 'Humanst521 Cn BT' });
	Cufon.replace('h3', { fontFamily: 'Humanst521 Cn BT' });
	Cufon.replace('.input-title', { fontFamily: 'Humanst521 Cn BT' });

});

