// contact form	
	$(document).ready(function(){
							   
		$('.contactBox').hide();
		var state = 1;
		
		$('.foldOut').click(function(){
			if (state == 1)
			{
				$('.contactBox').show('blind');
				state = 2;
			}
			else if (state == 2)
			{
				$('.contactBox').hide('blind');
				state = 1;
			}
		});	
			
		$('.close').click(function(){							   
			$('.contactBox').hide('blind');						
			state = 1;
		});

	});
	
// Groennegade		
$(document).ready(function(){
							   
		$('.building').hide();
				
		$('.imageArea').hover(function(){
			
				$('.building').show('scale'); 
				
				}, function(){
				$('.building').hide('scale');
				
				
				
		});	
			
		
	});

/* form validation */
function emailvalidation(entered, alertbox) {
	// check email
	with (entered) {
		apos=value.indexOf("@");
		dotpos=value.lastIndexOf(".");
		lastpos=value.length-1;
		if (apos<1 || dotpos-apos<2 || lastpos-dotpos>3 || lastpos-dotpos<2) {
			if (alertbox) {
				alert(alertbox);
			} 
			return false;
		}
		else {
				return true;
		}		
	}
}

function formvalidation(thisform) {
	// check firmanavn
	
	if (thisform.navn.value.length == 0) {
		alert('Indtast venligst dit navn.');
		thisform.navn.focus()
		return false;
	}
	

	// check email med funktion
	with (thisform) {
		if (emailvalidation(email,"Indtast venligst gyldig emailadresse")==false) {
			email.focus(); 
			return false;
		}
		else {
			return true
		}
	}

}





	
	

