function addOnLoad(func) {
	var oldonload = window.onload;

	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}

//==================== CSS drop menu
function activateMenu() {  

	nav = document.getElementById('menu_nav');  
	if (document.all && nav.currentStyle) {    
	    var navroot = nav;
	    var lis=navroot.getElementsByTagName("LI");  
	    for (i=0; i<lis.length; i++) {
	        if(lis[i].lastChild.tagName == "UL"){
	         	lis[i].onmouseover = function() 
					{
						this.lastChild.style.display="block"; 
						this.lastChild.style.left="0"; 
					}
	            lis[i].onmouseout=function()    
					{
						this.lastChild.style.display="none";
						this.lastChild.style.left="-999em"; 
					}
	        }
	    }
	}
}
//addOnLoad(activateMenu);  





function getMenu(id, item) {   
  if($(id).style.display == 'none')
  	item.className = 'menu_nav_opened';
  else	
  	item.className = '';
  	
  Effect.toggle(id, 'blind', {duration: 0.2}); 
}


function hideEmail(event)
{
	var target = Event.element(event);
	if (initial_text == '')
	{
		var value = target.value;
		target.value = initial_text;
		initial_text = value;
	}
	else
	{
		if (initial_text == target.value)
		{
			target.value = '';
		}
	}
}

function showEmail(event)
{
	var target = Event.element(event);
	if (target.value == '')
	{
		target.value = initial_text;
	}
}

var initial_text = '';
function email_reservation()
{
	
	var target = $('subscribe_input');
	if (target)
	{
		Event.observe(target, 'focus', hideEmail);
		Event.observe(target, 'blur', showEmail);
	}
}

Event.observe(window, 'load', email_reservation);
