function Interface(){

	var Interface = this;
	// global vars
	var g = {
		speed : 300
	};
//	
	Interface.init = function(){
		Interface.cufon();
//		Interface.readmore();
		Interface.lightbox();
		Interface.forms.init();
		Interface.buttons();
		Interface.rotators.init();
	};
//
	Interface.lightbox = function(){
		$('a.lightbox').colorbox();
	};
//
	Interface.cufon = function(){
		Cufon.replace(".fancy");
	};
//
        Interface.buttons = function(){
                $(".button").each(function(){
                        if( ! $(this).hasClass("checkRates") && ! $(this).is("input") ) {
                                var $span = $("<span />").text("\u25B6").addClass("icon");
                                $(this).append($span);
                        }
                });
        };
//
	Interface.readMore = function(){
	
		var text = {
			open : "- Read Less",
			closed : "+ Read More"
		};

		$("a.readMore").click(function(e){
			e.preventDefault();
			var id = $(this).attr("href");
			if( ! $(this).hasClass("open") || $(this).hasClass("closed") ){
				$(id).fadeIn(200);
				$(this).text(text.open).addClass("open").removeClass("closed");
			}
			else {
				$(id).fadeOut(200);
				$(this).text(text.closed).addClass("closed").removeClass("open");
			}
		});
	};
//
	Interface.forms = {
		
		init : function(){
			this.build();
			this.observe();
		},
		
		build : function(){
	
			$(".spicy").spicyselect();			

			$("input.date.today").datepicker({
				closeText: "Close",
				minDate: 0, 
				maxDate: "+1Y", 
				numberOfMonths: 1,
				showButtonPanel: true,

				onSelect: function(date,thisPicker){
					date = $(this).datepicker("getDate");
					date.setDate(date.getDate()+1);
					$("form[name=omni_reservation_form] input.date.tomorrow").datepicker("setDate",date);
					$("form[name=omni_reservation_form] input.date.tomorrow").datepicker("option","minDate",date);
				}
			});
			
			$("input.date.tomorrow").datepicker({
				closeText: "Close",
				minDate: 1, 
				maxDate: "+1Y", 
				numberOfMonths: 1,
				showButtonPanel: true
			});			
			
		},
		
		observe : function(){
			var $input = $("#stayConnectedEmail");
			var otext = $input.val();
			$input.focus(function(){
				if($(this).val() == otext){
					$(this).val('');
				}
			});
			$input.blur(function(){
				if($(this).val() == "" || $(this).val() == " "){
				 $(this).val(otext);
				}				
			});		
		}
	};
//
	Interface.rotators = {
		
		init : function() {
			this.build();
		},
		
		build : function(){
			if($("#photoContainer").length > 0){
				$('#photoContainer').cycle({ 
			    fx:     'fade', 
			    speed:  500,
			    timeout: 3000, 
			    pause: 0,     // true to enable "pause on hover" 
			    pauseOnPagerHover: 1   // true to pause when hovering over pager link      
				});			
			}			

			if($("#offers").length > 0){			
				$('#offers').cycle({ 
			    fx:     'scrollRight', 
			    speed:  700,
			    timeout: 3500, 
			    pager:  '#offersPager',
          cleartypeNoBg: true,
			    pause: 0,     // true to enable "pause on hover" 
			    pauseOnPagerHover: 1   // true to pause when hovering over pager link      
				});
			}
		}
	};
//	
};

