$(function() {
	//Documentation located in special.docs.js
	
	//sifr
	$('body.home #content h3, body.home #content h4, #masthead-wrapper h1').sifr(
		{ strSWF: '/flash/neutra-book.swf', strColor: '#ffffff', strLinkColor: '#ffffff', strHoverColor: '#ffffff', strWmode: 'transparent', intPadding: [0, 0, 0, 0], strFlashVars: 'textalign=left&', strCase: 'upper' },
		{ expressInstall: true }
	);
	
	$('div#content h1').sifr(
		{ strSWF: '/flash/neutra-book.swf', strColor: '#ffffff', strLinkColor: '#ffffff', strHoverColor: '#ffffff', strWmode: 'transparent', intPadding: [0, 0, 0, 8], strFlashVars: 'textalign=left&', strCase: 'upper' },
		{ expressInstall: true }
	);
	
	$('div#subnav h5').sifr(
		{ strSWF: '/flash/neutra-book.swf', strColor: '#00334e', strLinkColor: '#00334e', strHoverColor: '#00334e', strWmode: 'transparent', intPadding: [0, 0, 0, 0], strFlashVars: 'textalign=left&', strCase: 'upper' },
		{ expressInstall: true }
	);
	
	$('.bold-two-column thead tr th.dark span').sifr(
		{ strSWF: '/flash/neutra-bold.swf', strColor: '#ffffff', strLinkColor: '#ffffff', strHoverColor: '#ffffff', strWmode: 'transparent', intPadding: [0, 0, 0, 0], strFlashVars: 'textalign=left&', strCase: 'upper' },
		{ expressInstall: true }
	);
	
	$('.bold-two-column thead tr th.light span').sifr(
		{ strSWF: '/flash/neutra-bold.swf', strColor: '#264e6b', strLinkColor: '#264e6b', strHoverColor: '#264e6b', strWmode: 'transparent', intPadding: [0, 0, 0, 0], strFlashVars: 'textalign=left&', strCase: 'upper' },
		{ expressInstall: true }
	);
	
	
	// Booking console - Check availability promo code click button
	$("form#reservations-console").each(function(){
		var x = $(this);
		$("a#promo-click", x).click(function(){
			$("#dropdown-fields",x).show();
			return false;
		});
		$("#extra-fields-close").click(function() {
			$("#dropdown-fields",x).hide();
			return false;
		});
	});
	$("#promo-done-btn").click(function(){
		$("#dropdown-fields").hide();
		if ($('#group-code').val() || $('#promo-code').val() || $('#iata-number').val()) {
			$("#promo-click").addClass("selected-promo-click");
		} else {
			$("#promo-click").removeClass("selected-promo-click");
		}
		return false;
	});
	
	//action switch for booking console
	$('.console select#property').change(function() {
		var form = $(this).parents('form.console');
	    if ( this.value == 'agr' ) {
			$("input[name='hotel']").val("26819");
			$("input[name='chain']").val("10237");
			$("input[name='template']").val("PHXAG");
			$("input[name='shell']").val("PHXAG");
		} else {
			$("input[name='hotel']").val("13911");
			$("input[name='chain']").val("6247");
			$("input[name='template']").val("");
			$("input[name='shell']").val("");
		}
		
		$('#group-code,#promo-code,#iata-number').val("");

	});
	
	//Flash content
	$('#photo-gallery').each(function(){
		var albumid = $(this).attr("title");
		$(this).html('').flash({
			swf:"/flash/photo-gallery.swf",
			width:"670",
			height:"480",
			params:{
				allowscriptaccess:"always",
				wmode:"transparent",
				flashvars:{
					xmlPath:'/flash/xml/photo-gallery.xml',
					curAlbum:albumid
				}
			}
		});
	});
	
	$('body.home #masthead').html('').flash({
        swf:"flash/home-masthead.swf",
        width:"944",
        height:"317",
        params:{
            allowscriptaccess:"always",
            wmode:"transparent",
            flashvars:{
                xmlPath:'flash/xml/home-masthead.xml'
            }
        }
    });
	
	//Standard, plain expand and collapse
	if(!CMT){
		$('.expand-details').hide();
	}
	
	$('.toggle-standard').click(function(event){
		event.preventDefault();
		$(this).siblings('.expand-details').toggle();
		$(this).toggleClass('active')
	});
	
	
	
});
