var pos = 0;

function ticker() {
	if(jQuery('#nws_inner').height()+pos >= 480) pos = pos-240;
	else pos = 0;
	
	jQuery('#nws_inner').animate({ 
		marginTop: pos
	}, 1000, function() {
		setTimeout(function(){
			ticker();
		}, 8000);
	});	
}

jQuery(document).ready(function($) {

	if ($.browser.safari) {
		$('#NWS').css('margin-left','19px');
		$('#NWS ul li').css('line-height','0px');
	}
	
	pos = parseInt( Math.random() *  ($('#nws_inner').height()/240) )*-240;
	$('#nws_inner').css('marginTop',pos).fadeIn(500);
	$('#HEADER_IMGS .small').fadeIn(1000);
	$('#HEADER_IMGS .large').fadeIn(2000);
	$('#FOOTER_IMGS .footer').fadeIn(2000);
	setTimeout(function(){
		ticker();
	}, 5000);
	
	$("#arrival").datepicker({
		minDate: 0,
		onSelect: function() {
			$("#departure").datepicker('option', 'minDate', $("#arrival").datepicker('getDate'));
		}
	});
	$("#departure").datepicker();
});
