$(function() {
	//var theForm = $('#concierge');
/*    $('div#canoehouse-dining-reservations1').hide();
	$('div#canoehouse-dining-reservations2').hide();
	$('a#add-dining-reservation1').hide();
	$('a#add-dining-reservation2').hide();*/

	$("div#golf-accolades").flash(
	{src:"flash/golf-accolades.swf",
	 width:351,
	 height:110,
	 wmode:"transparent",
	 quality:"high"},
	 {version:"7"});
     
     $("#flashobject").html('').flash({
        swf:"homepage.swf",
        width:"100%",
        height:"100%",
        params:{
            allowscriptaccess:"always",
            wmode:"window",
            flashvars:{
                xmlPath:'flash/xml/homepage.xml'
            }
        }
    });
	
    $('p.sIFR').sifr({path:'flash/sifr/', size:'36', color:'#591b0e' });
    
	var theForm = $('div#rfp form');
    $('div#rfp form div.add-reservation').each(function() {$(this).hide();});	
    $('div#rfp form a.add-dining-reservation').each(function() {
	if ($(this).attr('id') != 'dining-reservation0') {
	    $(this).hide();
	}
    });
	 var diningCounter = 0;
    $('a.add-dining-reservation').toggle(
	function() {
	    if ( diningCounter < 3 ) {
		diningCounter++;
		
		$(this).next().show();
		$('.add-reservation p').remove();
		$('#dining-reservation' + diningCounter + '').show();
		
	    }
		if ( diningCounter >= 2 ) {
			$('a#dining-reservation2').remove();
			}
	    return false;
	}, 
	function() {
	    $(this).next().hide();
	    $('#dining-reservation' + diningCounter+ '').hide();
	    diningCounter--;
	
	});
	
	$('div#rfp form div.spa-reservation').each(function() {$(this).hide();});
	 $('div#rfp form a.add-spa-reservation').each(function() {
	if ($(this).attr('id') != 'spa-reservation0') {
	    $(this).hide();
	}
    });	
   
	
    
	var spaCounter = 0;
    $('a.add-spa-reservation').toggle(
	function() {
	    if ( spaCounter < 3 ) {
		spaCounter++;
		
		$(this).next().show();
		$('#spa-reservation' + spaCounter + '').show();
		
	    }
		if ( spaCounter >= 2 ) {
			$('a#spa-reservation2').remove();
			}
	    return false;
	}, 
	function() {
	    $(this).next().hide();
	    $('#spa-reservation' + spaCounter+ '').hide();
	    spaCounter--;
	
	});
	
	$('div#rfp form div.golf-reservation').each(function() {$(this).hide();});
	 $('div#rfp form a.add-golf-reservation').each(function() {
	if ($(this).attr('id') != 'golf-reservation0') {
	    $(this).hide();
	}
    });

	var golfCounter = 0;
    $('a.add-golf-reservation').toggle(
	function() {
	    if ( golfCounter < 3 ) {
		golfCounter++;
		
		$(this).next().show();
		$('#golf-reservation' + golfCounter + '').show();
		
	    }
		if ( golfCounter >= 2 ) {
			$('a#golf-reservation2').remove();
			}
	    return false;
	}, 
	function() {
	    $(this).next().hide();
	    $('#golf-reservation' + golfCounter+ '').hide();
	    golfCounter--;
	
	});
	
	$('.styleswitch').click(function()
	{
		switchStylesheet($(this).attr("rel"));
		window.print();
		return false;
	});
});

//stylesheet switcher for driving directions
function switchStylesheet(sheet) {
	$('link[@rel*=style][@title]').each(function() {
			$(this).attr('disabled', true);
			if ($(this).attr('title') == sheet) {
				$(this).attr('disabled', false);
			}
	});
}

