             SA.redirection_mobile ({
                redirection_paramName:"fullsite",
                mobile_prefix : "mobile",
                cookie_hours : "1" 
            });


function popupPostcard(href,width,height,scroll)
	{
		postCard= window.open(href,'myPostcard','resizable=no,toolbar=no,left=200,top=200,status=no,location=no,height=' + height + ',width=' + width + ',scrollbars=' + scroll + "'");
	};


function spryMyLinks() 
	{
	var myDiv = document.getElementById('bionav');
	var aLinks=myDiv.getElementsByTagName('a');
	for(var i=0;i<aLinks.length;i++) 
		{
			var myCurrentItem = aLinks[i];
			//aLinks[i].setAttribute('onclick', 'pe.loadContent(this.href);return false;');
			if( myCurrentItem.attachEvent )
				{
				   myCurrentItem.setAttribute('name', myCurrentItem.href);
				   myCurrentItem.href = 'javascript: pe.loadContent("' + myCurrentItem.href + '")';				   
				} 
			else 
				{
				   myCurrentItem.setAttribute('name', myCurrentItem.href);
				   myCurrentItem.setAttribute('onClick', 'pe.loadContent(this.href);return false;');
				}
			
		}
	}

function spryMyNav()
{
if(document.getElementById('bionav'))
	{
	pe = new Spry.Widget.HTMLPanel("bioArea");	
	var mybDiv = document.getElementById('bionav');
	var bLinks=mybDiv.getElementsByTagName('a');
	var myFirstItem = bLinks[0];
	spryMyLinks();
/*Removed by ASR - uncomment if you want to show the first item automatically*/	
/*if ( (top.location.href) == (window.location.href) )
		{
		pe.loadContent(myFirstItem.name);
		}*/
	}
}

function omniturizeLinks(){
	var aLinks=document.getElementsByTagName('a');
	for(var q=0; q < aLinks.length; q++) {
		if(aLinks[q].href.length>0 && aLinks[q].href.toLowerCase().indexOf('ichotelsgroup.com') > 0)
			{
				aLinks[q].onclick=function(){addParamsAndRedirect(this.href);return false;};
			}
			
	}
	
}

window.onload=omniturizeLinks;



jQuery.flvlightbox = function(options){
        
    var c = '';
    if(typeof(options)=='string')c=options;
    
    var o = {
        height: '400',
        width: '600',
        content: c,
        modalcss: {
            background:'#000000',
            filter: 'alpha(opacity=70)',
            opacity: .7
        },
        wincss: {
            background: '#FFFFFF',
            border: '1px solid #000000',
            zIndex: '9999'
        }
    };
    $.extend(o,options);
    
    $(document.body).css('overflow','hidden');
    var removeIt = function(){
        $(modal).remove();
        $(win).remove();
        $(window).unbind('resize scroll',moveIt);
        $(document.body).css('overflow','');
    };
    var modal = document.createElement('div');
    $(modal).css($.extend(o.modalcss,{
        position:	'absolute',
        top: $(document).scrollTop()+'px',
        left: $(document).scrollLeft()+'px',
        height: $(window).height()+'px',
        width: $(window).width()+'px'
    })).click(removeIt).appendTo(document.body);
    
    var closebox = document.createElement('div');
    $(closebox).css({
        position: 'absolute',
        cursor: 'pointer',
        top: '-12px',
        left:  (o.width-8)+'px'
    }).html('<img src="/i/SITE_080229_15541262_1GCMK/templates/btn_close.gif"').click(removeIt);
    
    var win = document.createElement('div');
    $(win).css($.extend(o.wincss,{
        position: 'absolute',
        top: ($(document).scrollTop()+($(window).height()-o.height)/2)+'px',
        left: ($(document).scrollLeft()+($(window).width()-o.width)/2)+'px',
        height: o.height+'px',
        width: o.width+'px'
    })).html(o.content).prepend(closebox).appendTo(document.body).animate({
    },500,'linear',function(){
        $(this).animate({
        },500,'linear',function(){
            $(window).bind('resize scroll',moveIt);
        });
    });
    var moveIt = function(){
        $(win).css({
            top: ($(document).scrollTop()+($(this).height()-o.height)/2)+'px',
            left: ($(document).scrollLeft()+($(this).width()-o.width)/2)+'px'
        });
        $(modal).css({
            top: $(document).scrollTop()+'px',
            left: $(document).scrollLeft()+'px',
            height: $(this).height()+'px',
            width: $(this).width()+'px'
        });
    };
};

function addDays(myDate,days) {
//myDate = starting	date, days = no. days to add.
	var temp_date = new Date();
	var i = 0;
	var days_to_add = 0;
	while (i < (days)){
		temp_date = new Date(myDate.getTime() +	(days_to_add*24*60*60*1000));
			i+=1;
		days_to_add += 1;
	}
	return new Date(myDate.getTime() + days_to_add*24*60*60*1000);
}
function comparedate(date1str,date2str){
	var date1 = new Date(date1str);
	var date2 = new Date(date2str);
	if (date1 > date2){
		return true;
	}else if (date1 < date2){
		return false;
	}else{
		return true;
	}
}
function trim(stringToTrim) {
	return stringToTrim.toString().replace(/^\s+|\s+$/g,"");
}


$(document).ready(function() {

			  $("#checkindate").datepicker({
				minDate:0,
				showAnim: "fadeIn",
				showOn: 'both',
				buttonText: 'Select Check In Date',
				buttonImage: '/i/SITE_080229_15541262_1GCMK/images/cal.gif',
				buttonImageOnly: true,
				onSelect:function(theDate) {
					$("#checkoutdate").datepicker('option','minDate',addDays(new Date(theDate),1))
					if(($("#checkoutdate").datepicker( 'getDate' )===null)||(trim($("#checkoutdate").datepicker( 'getDate' ))=="")||(comparedate($("#checkindate").datepicker( 'getDate' ),$("#checkoutdate").datepicker( 'getDate' )))){
						$("#checkoutdate").datepicker('setDate' ,addDays(new Date(theDate),1))
					}
				}
			});
	
			$("#checkoutdate").datepicker({
				minDate:1,
				showAnim: "fadeIn",
				showOn: 'both',
				buttonText: 'Select Check Out Date',
				buttonImage: '/i/SITE_080229_15541262_1GCMK/images/cal.gif',
				buttonImageOnly: true,
				defaultDate: +1,
				gotoCurrent: true
			});
	
	$('input[placeholder], textarea[placeholder]').placeholder();

	$('#ksl-dropdown').bind('change',function(){
		if(this.value!=''){
			window.open(this.value);
		}
	});

    $("#terms").dialog({
               bgiframe: true,
               modal: true,
               autoOpen: false,
               height:300,
               width:475,
               show: "fold",
               position:"center",
               buttons: {"Thank You": function() {$(this).dialog("close");}}
    });
    
   /*try and center all our component tables for new design [RSG] 7-1-2011*/
   $('table[width="876"]').attr('align','center');
    
    $('a.disclaimerID').click(function(e) {
		var ourContent = $('#' + $(this).attr("title")+ '').html();
		$('#terms').html('<div class="popDis">'+ ourContent + '</div>')
			$("#terms").dialog('open');
			$('.ui-widget-overlay').css({'z-index':'999'});
		return false;
	});



});


	$.fn.scaleMe = function() {
		return this.each(function() {
			var $this = $(this);
			if($this.data('scaleMe')) return true;
			$this.data('scaleMe',true)
			var originalWidth = $this.width();
			var originalHeight = $this.height();
			var divHeight = $this.closest('div').height();

			$(window).resize(function() {
				var divWidth = $this.closest('div').width();
				var newWidth = divWidth;
				var newHeight = (divWidth/originalWidth)*originalHeight;

				if( newHeight < divHeight ) {
					newHeight = divHeight;
					newWidth = originalWidth*(newHeight/originalHeight);
				}

				var topMargin = (divHeight-newHeight)/2;
				var leftMargin = (divWidth-newWidth)/2;

				$this.height(newHeight)
				.width(newWidth)
				.css({
					'margin-top' : topMargin,
					'margin-left' : leftMargin
				});

			}).resize();
		});
	};
	$(window).load(function(){
		$('div.background img').scaleMe();
		$('div.subphoto img').scaleMe();
		
		if ($('.subphoto img').length==1)
			$('.subphoto img').fadeIn();
	});


$(document).ready(function(){
    $('a[href^="https://gc.synxis.com/rez.aspx"]').click(function (event) {
        SynLink($(this).attr('href'));
        event.preventDefault();
    });
});

function SynLink(theSpecialsUrl){
    _gaq.push(function() {
            var tracker = _gat._getTrackerByName(); 
            window.open(tracker._getLinkerUrl(theSpecialsUrl));
         });
     }



/*
* Placeholder plugin for jQuery
* ---
* Copyright 2010, Daniel Stocks (http://webcloud.se)
* Released under the MIT, BSD, and GPL Licenses.
*/

(function(b){function d(a){this.input=a;a.attr("type")=="password"&&this.handlePassword();b(a[0].form).submit(function(){if(a.hasClass("placeholder")&&a[0].value==a.attr("placeholder"))a[0].value=""})}d.prototype={show:function(a){if(this.input[0].value===""||a&&this.valueIsPlaceholder()){if(this.isPassword)try{this.input[0].setAttribute("type","text")}catch(b){this.input.before(this.fakePassword.show()).hide()}this.input.addClass("placeholder");this.input[0].value=this.input.attr("placeholder")}},
hide:function(){if(this.valueIsPlaceholder()&&this.input.hasClass("placeholder")&&(this.input.removeClass("placeholder"),this.input[0].value="",this.isPassword)){try{this.input[0].setAttribute("type","password")}catch(a){}this.input.show();this.input[0].focus()}},valueIsPlaceholder:function(){return this.input[0].value==this.input.attr("placeholder")},handlePassword:function(){var a=this.input;a.attr("realType","password");this.isPassword=!0;if(b.browser.msie&&a[0].outerHTML){var c=b(a[0].outerHTML.replace(/type=(['"])?password\1/gi,
"type=$1text$1"));this.fakePassword=c.val(a.attr("placeholder")).addClass("placeholder").focus(function(){a.trigger("focus");b(this).hide()});b(a[0].form).submit(function(){c.remove();a.show()})}}};var e=!!("placeholder"in document.createElement("input"));b.fn.placeholder=function(){return e?this:this.each(function(){var a=b(this),c=new d(a);c.show(!0);a.focus(function(){c.hide()});a.blur(function(){c.show(!1)});b.browser.msie&&(b(window).load(function(){a.val()&&a.removeClass("placeholder");c.show(!0)}),
a.focus(function(){if(this.value==""){var a=this.createTextRange();a.collapse(!0);a.moveStart("character",0);a.select()}}))})}})(jQuery);
