// JavaScript Document

var mainmenu=new Object()

if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ //test for MSIE x.x;
	mainmenu.isIe = true;
} else {
	mainmenu.isIe = false;
}

mainmenu.createMenu=function(treeid)
{

	if (mainmenu.isIe == false) {
		document.writeln('<ul class=\"blockeasing\">');
		  	document.writeln('<li class=\"main\"><a href=\"/index.html\">Home</a></li>');
		  	document.writeln('<li class=\"main\"><a href=\"/whatson/index.html\">What\'s On</a>');
			    document.writeln('<ul class=\"subnav\">');
					document.writeln('<li><a href=\"/whatson/index.html\">What\'s On</a></li>');
				    document.writeln('<li><a href=\"/whatson/regularevents.html\">Regular Entertaiment</a></li>');
			    document.writeln('</ul>');
		 	document.writeln('</li>');
		  	document.writeln('<li class=\"main\"><a href=\"/occasions/index.html\">Special Occasions</a>');
			    document.writeln('<ul class=\"subnav\">');
					document.writeln('<li><a href=\"/occasions/index.html\">Celebrate In Style</a></li>');
				    document.writeln('<li><a href=\"/occasions/weddings.html\">Weddings</a></li>');
					document.writeln('<li><a href=\"/occasions/weddingbrochure.html\">Wedding Brochure</a></li>');
					//document.writeln('<li><a href=\"/occasions/weddingpictures.php?level=album&id=3\">Weddings Styles</a></li>');
					//document.writeln('<li><a href=\"/occasions/weddingpictures.php?level=album&id=4\">Weddings Photos</a></li>');
				    document.writeln('<li><a href=\"/occasions/conference.html\">Conferences</a></li>');
					document.writeln('<li><a href=\"/occasions/conferencelayout.html\">Conferences Layout</a></li>');
					document.writeln('<li><a href=\"/occasions/conferenceprices.html\">Conferences Prices</a></li>');
				    document.writeln('<li><a href=\"/occasions/otherfunctions.html\">Other Functions</a></li>');
			    document.writeln('</ul>');
		  	document.writeln('</li>');
		  	document.writeln('<li class=\"main\"><a href="/guestrooms.html\">Accommodation</a></li>');
		  	document.writeln('<li class=\"main\"><a href=\"/restaurant/index.html\">Restaurant</a>');
				document.writeln('<ul class=\"subnav\">');
					document.writeln('<li><a href=\"/restaurant/mainmenu.html\">Main Menu</a></li>');
					document.writeln('<li><a href=\"/restaurant/lunchtimemenu.html\">Lunch Time Menu</a></li>');
					document.writeln('<li><a href=\"/restaurant/seniormenu.html\">Senior Main Menu</a></li>');
					document.writeln('<li><a href=\"/restaurant/sundaymenu.html\">Sunday Menu</a></li>');
					document.writeln('<li><a href=\"/restaurant/carvery.html\">Cavery</a></li>');
					document.writeln('<li><a href=\"/restaurant/midweekspecialsmenu.html\">Mid Week Menu</a></li>');
					document.writeln('<li><a href=\"/restaurant/throughtheweekmenu.html\">Through the Week</a></li>');
					document.writeln('<li><a href=\"/restaurant/steakmenu.html\">Steak Menu</a></li>');
					document.writeln('<li><a href=\"/restaurant/cocktailmenu.html\">Cocktail Menu</a></li>');
					document.writeln('<li><a href=\"/restaurant/kidsmenu.html\">Kids Menu</a></li>');
					document.writeln('<li><a href=\"/restaurant/sundaydiningexp.html\">Sunday Dining</a></li>');
					document.writeln('<li><a href=\"/restaurant/unlimitedfridaymenu.html\">Unlimited Curry</a></li>');
				document.writeln('</ul>');
			document.writeln('</li>');
		  	document.writeln('<li class=\"main\"><a href=\"/services/index.html\">Useful Services</a>');
			    document.writeln('<ul class=\"subnav\">');
				    document.writeln('<li><a href=\"/services/cateringservice.html\">Catering Service</a></li>');
				    document.writeln('<li><a href=\"/services/innstore.html\">Inn Store</a></li>');
			    document.writeln('</ul>');
		  	document.writeln('</li>');
		  	document.writeln('<li class=\"main\"><a href=\"/location.html\">Find Us</a></li>');
		document.writeln('</ul>');
		
	} else {
		document.writeln('<ul class=\"blockeasing\">');
		  	document.writeln('<li class=\"main\"><a href=\"/index.html\">Home</a></li>');
		  	document.writeln('<li class=\"main\"><a href=\"/whatson/index.html\">What\'s On</a></li>');
		  	document.writeln('<li class=\"main\"><a href=\"/occasions/index.html\">Special Occasions</a></li>');
		  	document.writeln('<li class=\"main\"><a href="/guestrooms.html\">Accommodation</a></li>');
		  	document.writeln('<li class=\"main\"><a href=\"/restaurant/index.html\">Restaurant</a></li>');
		  	document.writeln('<li class=\"main\"><a href=\"/services/index.html\">Useful Services</a></li>');
		  	document.writeln('<li class=\"main\"><a href=\"/location.html\">Find Us</a></li>');
		document.writeln('</ul>');
	}
	
	//this.setPage(treeid);
}

mainmenu.setPage=function(treeid)
{
	var litags=document.getElementById(treeid).getElementsByTagName("li");

	for (var i=0; i<litags.length; i++) 
	{
		var aTag = litags[i].getElementsByTagName("a");
		var hrefVal = aTag[0].href;

		if (document.URL.indexOf( hrefVal ) != -1)
		{
			var text = aTag[0].innerHTML;

			litags[i].removeChild(aTag[0]);

			var span = document.createElement('span');
			span.setAttribute("id", "nav_selected");
			span.innerHTML = text;

			litags[i].appendChild(span);
		}
	}

}

function twitter(){
	new TWTR.Widget({
        version: 2,
        type: 'profile',
        rpp: 4,
        interval: 6000,
        width: 184,
        height: 300,
        theme: {
          shell: {
            background: '#0d0534',
            color: '#ffffff'
          },
          tweets: {
            background: '#000000',
            color: '#ffffff',
            links: '#4aed05'
          }
        },
        features: {
          scrollbar: false,
          loop: false,
          live: false,
          hashtags: true,
          timestamp: true,
          avatars: false,
          behavior: 'all'
        }
      }).render().setUser('thewhitemare').start();
}

$(document).ready(function() {
           
    $("ul.blockeasing li.main").mouseover(
		function() { //When mouse over ...
        	//Following event is applied to the subnav itself (making height of subnav 60px)

		var el = $(this).find('.subnav');
		var itemCount = el[0].children.length;
		var pxStr = 'px';
		var menuHeight = itemCount * 26 + 4;  // 320
		
		el.stop().animate({height: menuHeight.toString()+pxStr, opacity:'1'},{queue:false, duration:1500, easing: 'easeOutElastic'});
	});

    $("ul.blockeasing li.main").mouseout(function(){ //When mouse out ...
    	//Following event is applied to the subnav itself (making height of subnav 0px)
	 	$(this).find('.subnav').stop().animate({height:'0px', opacity:'0'},{queue:false, duration:1600, easing: 'easeOutElastic'});
		//var el = $(this).find('.subnav');
		//$el[0].style.height= 0 + "px";

		//$el[0].setAttribute("height", '0px');
		//$el[0].setAttribute("opacity", '0');
	});
          	
        //menu itembackground color animation			
	$("li").hover(function() {
        	$(this).stop().animate({ backgroundColor: "#d2d2bb"}, 600);}, //d2d2bb
           	function() {
              $(this).stop().animate({ backgroundColor: "#000000" }, 600);
        	});
	});
	
	
	
	
