jQuery(function(){
		
		// Metode til at læse GET variabler i URL
		function getQueryVariable(variable) { 
		  var query = window.location.search.substring(1); 
		  var vars = query.split("&"); 
		  for (var i=0;i<vars.length;i++) { 
		    var pair = vars[i].split("="); 
		    if (pair[0] == variable) { 
		      return pair[1]; 
		    } 
		  } 
		  //alert('Query Variable ' + variable + ' not found'); 
		}
		
		$("#projects").mouseover(function(e){
			$("#menu_projects").css("visibility","visible");
		})
		
		$("#projects").mouseout(function(e){
			$("#menu_projects").css("visibility","hidden");
		})
		
		$("#menu_projects").mouseover(function(e){
			$("#menu_projects").css("visibility","visible");
		})
		
		$("#menu_projects").mouseout(function(e){
			$("#menu_projects").css("visibility","hidden");
		})
		
		var pageId = getQueryVariable("id");
		$("#" + pageId).css("color","#f89f2d");
				
})

function popUp(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=430,height=355,left = 415,top = 250');");
}

function validate_form(thisform){
			
	var error = "To send the commment, please fill out the blank fields:\n";		
			
	if (thisform.name.value == null || thisform.name.value == ""){
	    //alert("To send the commment, please fill out \"Your name\".");
		//return false;
		error += "\n- Name";
	}
	if (thisform.country.value == null || thisform.country.value == ""){
	    //alert("To send the commment, please fill out \"Your country\".");
		//return false;
		error += "\n- Country";
	}
	if (thisform.comment.value == null || thisform.comment.value == ""){
	    //alert("To send the commment, please fill out \"Your comment\".");
		//return false;
		error += "\n- Comment";
	}
	
	
	if(error == "To send the commment, please fill out the blank fields:\n"){
		return true;
	}	
	else{
		alert(error);
		return false;
	}
	
}