var BaseUI = 
{
    initialize : function () 
    {
		BaseUI.IntializeHero      ()
		BaseUI.InitializeAccordian()
		BaseUI.InitializeColorBox ()

       $('a').each(function(idx,el)
       {
           var theHref = el.getAttribute('href')

           if (theHref != null)
           {
               if (theHref.toLowerCase().indexOf('.synxis.com') != -1)
               {
                   el.onclick = function()
                   {
                       window.open(pageTracker._getLinkerUrl(this.href))
                       return false
                   }
               }
           }
       })
    },
	IntializeHero : function ()
	{
		$('#slideshow').cycle({
			fx:     'fade',
			timeout: 7000,
			fadeOutSpeed: "slow",
			prev:    '#prev',
			next:    '#next'
		})
	},
	InitializeAccordian : function ()
    {
        $('li.accordian_header a').click(function ()
        {
            if($(this).siblings('ul.accordian_body:visible').length) 
            {
                $(this).siblings('ul.accordian_body').slideUp('fast')
                $(this).parent('li').removeClass('arrow_R')
            }
            else 
            {
                $(this).siblings('ul.accordian_body').slideDown()
                $(this).parent('li').addClass('arrow_R')
            }
            return false
        })
    },
	InitializeColorBox : function ()
	{
		$(".gallery a.photo").colorbox();
	},
    OpenWindow: function(url)
    {
        window.open(url,'','resizable,scrollbars,width=800,height=600,top=500,left=500,toolbar=yes');
    },
    OpenDropDownAnchor: function(ddl)
    {
	    var theIndex = ddl.selectedIndex; 

	    if (theIndex != 0)  
        { 
		    window.location.assign(ddl.options[theIndex].value); 
	    } 
    },
    ShowMeetingRFPForm: function()
    {
    	srfp_widget.setUid(BaseUI.GetHotelIDs());
	    srfp_widget.show();
    },
    GetHotelIDs: function()
    {
	    var uid = "";
	    var hotelcart = document.getElementById("hotels");
	    for ( i=0; i<hotelcart.options.length; i++ )
	    {
		    if ( hotelcart.options[i].selected )
		    {
			    if ( !hotelcart.options[i].value ) continue;	// skip blank uids
			    uid = ( uid ) ? uid + "," + hotelcart.options[i].value : hotelcart.options[i].value;
		    }
	    }

	    return uid;
    }

}

$(document).ready(BaseUI.initialize)
