// JavaScript Documentfunction init() {	checkEnvironment(); //check for valid brower and include corrective CSS	dT();  //init date-time ticker	insRandImg(); //load random welcome image}function openMenuOn(liID) {	$(liID).addClass('hilite');	$(liID).parents($(this)).show('slow');	$(liID).parent('ul').parent('li').children('a').addClass('rotate');	$(liID).parent('ul').parent('li').parent('ul').parent('li').children('a').addClass('rotate');	}function gotoSelected(select) {    var index = select.selectedIndex    if (select.options[index].value != "") {        window.open(select.options[index].value,'_self');    }}function get_random(scope){    var ranNum= Math.floor(Math.random()*scope);    return ranNum;}function setImageSlider(startNumber) {		var TotalImageNumber = imgObj.length-1; // "-1" to make the number 0 based index	var CurrentImageIndex = startNumber;		$('#slide-0').attr({ // get the img on the page with ID imgObj			 	src: imgFolder + imgObj[CurrentImageIndex][0],  // set the source of this image to a random number in the img array.			 	title: imgObj[CurrentImageIndex][2], // set title tag			 	alt: imgObj[CurrentImageIndex][1] // set alt tag	 });		if (CurrentImageIndex == TotalImageNumber){		CurrentImageIndex = 0;	} else {		CurrentImageIndex += 1;	}	 	 $('#slide-1').attr({ // get the img on the page with ID imgObj			 	src: imgFolder + imgObj[CurrentImageIndex][0],  // set the source of this image to a random number in the img array.			 	title: imgObj[CurrentImageIndex][2], // set title tag			 	alt: imgObj[CurrentImageIndex][1] // set alt tag	 });	 	if (CurrentImageIndex == TotalImageNumber){		CurrentImageIndex = 0;	} else {		CurrentImageIndex += 1;	}	 	 $('#slide-2').attr({ // get the img on the page with ID imgObj			 	src: imgFolder + imgObj[CurrentImageIndex][0],  // set the source of this image to a random number in the img array.			 	title: imgObj[CurrentImageIndex][2], // set title tag			 	alt: imgObj[CurrentImageIndex][1] // set alt tag	 });	 	var prevIndex = startNumber -1;	var nextIndex = startNumber +1;		if (startNumber-1 < 0){prevIndex = TotalImageNumber;}	if (startNumber >= TotalImageNumber){nextIndex = 0;}		$('#button-previous').unbind('click'); 	$('#button-next').unbind('click');  	 	$('#button-previous').click(function(){setImageSlider(prevIndex);});	$('#button-next').click(function(){setImageSlider(nextIndex);});}function insRandImg() {		var imgFolder="/media/showcase/homePage/"; // folder where jpegs are WITH TRAILING FORWARD SLASH -> /		var imgObj=new Array(); // array holding a list of all the filenames of the mag covers.		imgObj[0]= new Array("Untitled-2.jpg","image of hotel-e","Welcome to Hotel-e");	imgObj[1]= new Array("Untitled-1.jpg","image of hotel-e","Welcome to Hotel-e");	imgObj[2]= new Array("Untitled-4.jpg","image of hotel-e","Welcome to Hotel-e");		$("#home-photo").fadeTo(0, 0, 			function injectImg() {			if (BrowserDetect.browser != "Explorer"){$('#home-photo').fadeTo(0,0); } // run only in non IE browsers because of IE rendering bug			randItem = get_random(imgObj.length);			//randItem = 0; // hook to test specific array items						$(this).attr({ // get the img on the page with ID imgObj			 src: imgFolder + imgObj[randItem][0],  // set the source of this image to a random number in the img array.			 title: imgObj[randItem][2], // set title tag			 alt: imgObj[randItem][1] // set alt tag			});			$(this).fadeTo('slow', 1, function showText(){		    	if (BrowserDetect.browser != "Explorer"){$('#home-photo').fadeTo('slow',1); } // run only in non IE browsers because of IE rendering bug			});			randItem = null;		}	); }function thisYear() {    var mydate = new Date()    var year = mydate.getYear()    if (year < 1000)        year += 1900    var day = mydate.getDay()    var month = mydate.getMonth() + 1    if (month < 10)        month = "0" + month    var daym = mydate.getDate()    if (daym < 10)        daym = "0" + daym    //document.write(year+"/"+month+"/"+daym);    document.write(year);}// START date/time ticker 	function tS(){ x=new Date(); x.setTime(x.getTime()); return x; } function lZ(x){ return (x>9)?x:'0'+x; } function tH(x){ if(x==0){ x=12; } return (x>12)?x-=12:x; } function y2(x){ x=(x<500)?x+1900:x; return String(x).substring(2,4) } function dT(){ document.getElementById('tP').innerHTML=eval(oT); setTimeout('dT()',1000); } function aP(x){ return (x>11)?'pm':'am'; } var dN=new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'),mN=new Array('January','February','March','April','May','June','July','August','September','October','November','December'),oT="'<strong>'+dN[tS().getDay()]+' '+tS().getDate()+' '+mN[tS().getMonth()]+' 20'+y2(tS().getYear())+'</strong> &nbsp;  | &nbsp; <strong>'+' '+tH(tS().getHours())+':'+lZ(tS().getMinutes())+':'+lZ(tS().getSeconds())+' '+aP(tS().getHours())+'</strong>'";// END date/time ticker/*********************//* jQuery Multi Level CSS Menu #2- By Dynamic Drive: http://www.dynamicdrive.com///* Last update: Nov 7th, 08': Limit # of queued animations to minmize animation stuttering//* Menu avaiable at DD CSS Library: http://www.dynamicdrive.com/style/*********************///Specify full URL to down and right arrow images (23 is padding-right to add to top level LIs with drop downs):var arrowimages={down:['downarrowclass', '/media/blank.gif', 23], right:['rightarrowclass', '/media/blank.gif']}var jqueryslidemenu={animateduration: {over: 200, out: 100}, //duration of slide in/ out animation, in millisecondsbuildmenu:function(menuid, arrowsvar){	jQuery(document).ready(function($){		var $mainmenu=$("#"+menuid+">ul")		var $headers=$mainmenu.find("ul").parent()		$headers.each(function(i){			var $curobj=$(this)			var $subul=$(this).find('ul:eq(0)')			this._dimensions={w:this.offsetWidth, h:this.offsetHeight, subulw:$subul.outerWidth(), subulh:$subul.outerHeight()}			this.istopheader=$curobj.parents("ul").length==1? true : false			$subul.css({top:this.istopheader? this._dimensions.h+"px" : 0})			$curobj.children("a:eq(0)").css(this.istopheader? {paddingRight: arrowsvar.down[2]} : {}).append(				'<img src="'+ (this.istopheader? arrowsvar.down[1] : arrowsvar.right[1])				+'" class="' + (this.istopheader? arrowsvar.down[0] : arrowsvar.right[0])				+ '" style="border:0;" />'			)			$curobj.hover(				function(e){					var $targetul=$(this).children("ul:eq(0)")					this._offsets={left:$(this).offset().left, top:$(this).offset().top}					var menuleft=this.istopheader? 0 : this._dimensions.w					menuleft=(this._offsets.left+menuleft+this._dimensions.subulw>$(window).width())? (this.istopheader? -this._dimensions.subulw+this._dimensions.w : -this._dimensions.w) : menuleft					if ($targetul.queue().length<=1) //if 1 or less queued animations						$targetul.css({left:menuleft+"px", width:this._dimensions.subulw+'px'}).slideDown(jqueryslidemenu.animateduration.over)				},				function(e){					var $targetul=$(this).children("ul:eq(0)")					$targetul.slideUp(jqueryslidemenu.animateduration.out)				}			) //end hover		}) //end $headers.each()		$mainmenu.find("ul").css({display:'none', visibility:'visible'})	}) //end document.ready}}//build menu with ID="myslidemenu" on page:jqueryslidemenu.buildmenu("myslidemenu", arrowimages)/**/// subscribe to emailfunction Subscribe() {    txtEmail = $("#txtEmailSubscribe").val();    if (txtEmail == "" || txtEmail.indexOf("@") == "-1" || txtEmail.indexOf(".") == "-1") {        alert("Please enter valid email address");        return;    }    $.ajax({        type: "POST",        url: "/AjaxWebMethod/AjaxController.aspx/SubscribeToEmail",        data: "{'email':'" + txtEmail + "'}",        contentType: "application/json; charset=utf-8",        dataType: "json",        success: function(msg) {            $("#txtEmailSubscribe").val("");            alert("Thank you !");        }    });}// On Document Ready$(document).ready(function() {    init();});