$(document).ready(function() { 
				$('#bkg_animation').innerfade({ 
					animationtype: 'fade', 
					speed: 2000, 
					timeout: 4000,
					type: 'sequence', 
					containerheight: '0' });
					
				$("#newsletter_form").click(function(event){
					event.stopPropagation();
				});
				
				// If this superfish menu is defined ...
				if($('ul.sf-menu').length)
				{
					$('ul.sf-menu').superfish({ 
						delay:       200,				// one 200ms delay on mouseout 
						animation:   {opacity: 1.0, height:'show'},	// fade-in and slide-down animation 
						speed:       'fast',				// faster animation speed 
						autoArrows:  false,				// disable generation of arrow mark-up 
						dropShadows: false,				// disable drop shadows 
						onHide:  function() { this.animate({opacity: 0.0},0); } // Reset the opacity after the menu is hidden
					});	
				}
				
				$("#oroppas_tip").click(function(event){
					event.stopPropagation();
				});
				
				$("#tip1").click(function(event){
					event.stopPropagation();
				});
				
});
		
		
function emailValidator(elem, helperMsg){
	var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
	if(elem.value.match(emailExp)){
		return true;
	} else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}


function validate(){	
	if (document.getElementById('email').value == ""){
				alert('You need to provide your email address');
				document.getElementById('email').focus();
				return false;
	} else {
				var address = document.getElementById('email');
				var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
		
				if(address.value.match(emailExp)){
					alert('this would now send');
					//document.getElementById('newsletter').submit();
				} else {
					alert('You need to provide your email address');
					document.getElementById('email').focus();
					return false;
		}
				
	}
}
		
function showDiv(id){
	document.getElementById(id).style.display = 'block';
}

function hideDiv(id){
	document.getElementById(id).style.display = 'none';
}
			