	function mainmenu(){
		jQuery("#nav ul").css({display: "none"}); // Opera Fix
	
		jQuery("#nav li").hover(function(){
			jQuery(this).find('ul:first').css({visibility: "visible",display: "none"}).show(700);
			
			var liId = jQuery(this).attr("id");	
			var getClass = jQuery("#"+liId).attr("class");

			if(getClass != "cureentActive"){
				if(jQuery("#"+liId+" a.innerselected").length == 0) {
					//jQuery("#"+liId).prepend("<span id=s"+liId+">&nbsp;</span>");
					//jQuery("#"+liId+" a").attr("class","innerselected");					

					var aObj = jQuery("#"+liId).children('a').eq(0); // Get first anchor tag in li
					jQuery(aObj).attr("class","innerselected");
				}
			}
			
		},function(){
			var liId = jQuery(this).attr("id");			
			var getClass = jQuery("#"+liId).attr("class");	
			
			var result;
			result = getClass.search("cureentActive");			
			
			if(result > 0 ){
			} else {
				jQuery('span').remove("#s"+liId); 
				jQuery("#"+liId+" a").attr("class","");				
			}
			
			jQuery(this).find('ul:first').css({visibility: "hidden"}).hide(200); 
		});		
	}
	 

	/**
	 * Active menu
	 * @para navLiid is the menu li id
	 * return prepend to li id span tag(html) and add class to a of li id. 
	 */
	function showActiveMenu(navLiid){
		
		//alert(navLiid);
		var getClass = jQuery("#"+navLiid).attr("class");
		jQuery("#"+navLiid).attr("class",""+getClass+" cureentActive"); //Add one more class name to cureent ativative menu item
				
		//jQuery("#"+navLiid).prepend("<span>&nbsp;</span>");
		
		var aObj = jQuery("#"+navLiid).children('a').eq(0); // Get first anchor tag in li
		jQuery(aObj).attr("class","innerselected");	
		
		jQuery(".innerselected").css("color","#ffffff");
		jQuery(".innerselected").css("background","#01ADDD");
	}

	jQuery(document).ready(function(){					
		mainmenu();		
		
		jQuery('#submenu1').mouseover(function() {		
			jQuery("#navLi3").addClass('selected'); 
		});
		
		jQuery('#submenu1').mouseout(function() {		
			jQuery("#navLi3").removeClass('selected'); 
		});
		
		jQuery('#submenu2').mouseover(function() { 
			jQuery("#navLi4").addClass('selected'); 
		});
		
		jQuery('#submenu2').mouseout(function() {		
			jQuery("#navLi4").removeClass('selected'); 
		});		
		
		jQuery('#submenu3').mouseover(function() { 
			jQuery("#navLi2").addClass('selected'); 
		});
		
		jQuery('#submenu3').mouseout(function() {		
			jQuery("#navLi2").removeClass('selected'); 
		});		
		
		
		jQuery('#submenu4').mouseover(function() { 
			jQuery("#navLi7").addClass('selected'); 
		});
		
		jQuery('#submenu4').mouseout(function() {		
			jQuery("#navLi7").removeClass('selected'); 
		});		
		
		
		
		
		if(jQuery('#rotator').length != 0) {
			jQuery('#rotator').cycle({ 
				fx:     'fade', 
				speed:   1500, 
				timeout: 5000, 
				//next:   '#rotator',  // This is for when user click on image or text inside the cycle it will move to that place only
				pause:   1 			
			});			 
			jQuery('#rotator').css("margin-top","8px").css("float","left"); 			
			
			/**
			*  Check the browser is IE or not if IE then set the height to 20px for #rotator
			*/
			//if (jQuery.browser.msie && jQuery.browser.version.substr(0,1) < 7) {
			if (jQuery.browser.msie) {
				jQuery('#rotator').css("height","20px"); 	
			}
		}		
		
	});
