// jquery calendar 
    $($.date_input.initialize);


// jquery validator - bwac
    //initiate validator on load
    $(function() {
        // validate contact form on keyup and submit
        $("#bwac").validate({
            //set the rules for the field names
            rules: {
                "bwac[firstname]": {
                    required: true,
										minlength: 2
                },
    
                "bwac[lastname]": {
                    required: true,
										minlength: 2
                },
    
                "bwac[emailaddress]": {
                    required: true,
    		            email: true,
										minlength: 4
                },
    
                "bwac[emailaddressagain]": {
                    required: true,
    		            email: true,
										minlength: 4
                },
    
                "bwac[phonenumber]": {
                    required: true,
                    minlength: 10
                },
    
                "bwac[altphonenumber]": {
                    required: true,
                    minlength: 10
                },
    
                "bwac[hotelname]": {
                    required: true,
                    minlength: 10
                },
            },
    
            //set messages to appear inline
            messages: {
                "bwac[firstname]": "<sup> REQUIRED </sup>",
                "bwac[lastname]": "<sup> REQUIRED </sup>",
                "bwac[emailaddress]": "<sup> REQUIRED </sup>",
                "bwac[emailaddressagain]": "<sup> REQUIRED</sup>",
                "bwac[phonenumber]": "<sup> REQUIRED </sup>",
                "bwac[altphonenumber]": "<sup> REQUIRED </sup>",
                "bwac[hotelname]": "<sup> REQUIRED </sup>"
            }
        });
    });

// jquery validator - hicbus
    //initiate validator on load
    $(function() {
        // validate contact form on keyup and submit
        $("#hicbus").validate({
            //set the rules for the field names
            rules: {
                "hicbus[firstname]": {
                    required: true,
										minlength: 2
                },
    
                "hicbus[lastname]": {
                    required: true,
										minlength: 2
                },
    
                "hicbus[emailaddress]": {
                    required: true,
    		            email: true,
										minlength: 4
                },
    
                "hicbus[emailaddressagain]": {
                    required: true,
    		            email: true,
										minlength: 4
                },
    
                "hicbus[phonenumber]": {
                    required: true,
                    minlength: 10
                },
    
                "hicbus[altphonenumber]": {
                    required: true,
                    minlength: 10
                },
    
                "hicbus[hotelname]": {
                    required: true,
                    minlength: 10
                },
            },
    
            //set messages to appear inline
            messages: {
                "hicbus[firstname]": "<sup> REQUIRED </sup>",
                "hicbus[lastname]": "<sup> REQUIRED </sup>",
                "hicbus[emailaddress]": "<sup> REQUIRED </sup>",
                "hicbus[emailaddressagain]": "<sup> REQUIRED</sup>",
                "hicbus[phonenumber]": "<sup> REQUIRED </sup>",
                "hicbus[altphonenumber]": "<sup> REQUIRED </sup>",
                "hicbus[hotelname]": "<sup> REQUIRED </sup>"
            }
        });
    });
		
// jquery validator - hicss
    //initiate validator on load
    $(function() {
        // validate contact form on keyup and submit
        $("#hicss").validate({
            //set the rules for the field names
            rules: {
                "hicss[firstname]": {
                    required: true,
										minlength: 2
                },
    
                "hicss[lastname]": {
                    required: true,
										minlength: 2
                },
    
                "hicss[emailaddress]": {
                    required: true,
    		            email: true,
										minlength: 4
                },
    
                "hicss[emailaddressagain]": {
                    required: true,
    		            email: true,
										minlength: 4
                },
    
                "hicss[phonenumber]": {
                    required: true,
                    minlength: 10
                },
    
                "hicss[altphonenumber]": {
                    required: true,
                    minlength: 10
                },
    
                "hicss[hotelname]": {
                    required: true,
                    minlength: 10
                },
            },
    
            //set messages to appear inline
            messages: {
                "hicss[firstname]": "<sup> REQUIRED </sup>",
                "hicss[lastname]": "<sup> REQUIRED </sup>",
                "hicss[emailaddress]": "<sup> REQUIRED </sup>",
                "hicss[emailaddressagain]": "<sup> REQUIRED</sup>",
                "hicss[phonenumber]": "<sup> REQUIRED </sup>",
                "hicss[altphonenumber]": "<sup> REQUIRED </sup>",
                "hicss[hotelname]": "<sup> REQUIRED </sup>"
            }
        });
    });		
		
		


// jquery slideshow

    function slideSwitch() {
        var $active = $('#slideshow DIV.active');
    
        if ( $active.length == 0 ) $active = $('#slideshow DIV:last');
    
        // use this to pull the divs in the order they appear in the markup
        var $next =  $active.next().length ? $active.next()
            : $('#slideshow DIV:first');
    
        // uncomment below to pull the divs randomly
        // var $sibs  = $active.siblings();
        // var rndNum = Math.floor(Math.random() * $sibs.length );
        // var $next  = $( $sibs[ rndNum ] );
    
    
        $active.addClass('last-active');
    
        $next.css({opacity: 0.0})
            .addClass('active')
            .animate({opacity: 1.0}, 1000, function() {
                $active.removeClass('active last-active');
            }
				);
    }

    $(function() {
        setInterval( "slideSwitch()", 5000 );
    });

