
$(document).ready(function() {

	$(".roundbox").corners('12px');
    $(".rounded").corners('6px');

	// gallery
	$('img').click(function() {
		$('.main_photo').attr('src', $(this).attr('src'));
	});
    
	$("#keywords_search_form .inp").focus(function(){
		$(this).attr('value', '');
	});
	
 	$("#marquee ul").marquee({yScroll: "right"});

	// change dropdown width
	if ($.browser.msie) {
		$(".search_form #category_id").hover(function(){
			$(this).data("origWidth", $(this).css("width")).css("width", "auto");
		}).change(function(){
			$(this).css("width", $(this).data("origWidth"));
		}).blur(function(){
			$(this).css("width", $(this).data("origWidth"));
		});
	}

	$(".search_form #group_id").change(function(){
		$(".search_form #category_id").load('/journeys/ajax_actions/reload_categories/' + $(this).attr('value'));
	});	

	$("#advanced_search_form #group_id").change(function(){
		$("#advanced_search_form #category_id").load('/journeys/ajax_actions/reload_categories/' + $(this).attr('value'));
	});

	// tertmenu toggle
	$("#tertmenu > ul > li > a").hover(function(e){
		$("#tertmenu ul ul").css('display', 'none');
		$(this).parent().children("ul").css('display', 'block');
	});
	$("#tertmenu ul ul").mouseleave(function(){
		$(this).css('display', 'none');
	});

	// toggle departures/arrivals
	$("#schedule_filter_form #type").change(function(){
		$("#schedule_filter_form #to_label, #schedule_filter_form #from_label").toggle();
	});

}); 
