		function changeInputType(  //found on http://www.dynamicsitesolutions.com/javascript/dynamically-changing-input-type/
			oldElm, // a reference to the input element
			iType, // value of the type property: 'text' or 'password'
			iValue, // the default value, set to 'password' in the demo
			blankValue, // true if the value should be empty, false otherwise
			noFocus,  // set to true if the element should not be given focus
			color) { //color of the element
			if(!oldElm || !oldElm.parentNode || (iType.length<4) || 
			!document.getElementById || !document.createElement) return;
			var newElm = document.createElement('input');
			newElm.type = iType;
			if(oldElm.name) newElm.name = oldElm.name;
			if(oldElm.id) newElm.id = oldElm.id;
			if(oldElm.className) newElm.className = oldElm.className;
			if(oldElm.size) newElm.size = oldElm.size;
			if(oldElm.tabIndex) newElm.tabIndex = oldElm.tabIndex;
			if(oldElm.accessKey) newElm.accessKey = oldElm.accessKey;
			if(oldElm.title) newElm.title = oldElm.title;
			newElm.style.color = color;
			newElm.onfocus = function(){return function(){
			if(this.hasFocus) return;
			var newElm = changeInputType(this,'password',iValue,
			(this.value.toLowerCase()==iValue.toLowerCase())?true:false,false,"#000000");
			if(newElm) newElm.hasFocus=true;
			}}();
			newElm.onblur = function(){return function(){
			if(this.hasFocus)
			if(this.value=='' || (this.value.toLowerCase()==iValue.toLowerCase())) {
			changeInputType(this,'text',iValue,false,true,"#999999");
			}
			}}();
			// hasFocus is to prevent a loop where onfocus is triggered over and over again
			newElm.hasFocus=false;
			oldElm.parentNode.replaceChild(newElm,oldElm);
			if(!blankValue) newElm.value = iValue;
			if(!noFocus || typeof(noFocus)=='undefined') {
			window.tempElm = newElm;
			setTimeout("tempElm.hasFocus=true;tempElm.focus();",1);
			}
			return newElm;
		}


		


		function loadUsermenuStylerLoggedout(){
		
			var ua = navigator.userAgent.toLowerCase();
			if(!((ua.indexOf('konqueror')!=-1) && (document.all || 
			(ua.indexOf('khtml/3.4')!=-1))) && !(((ua.indexOf('safari')!=-1) && 
			!window.print) || (document.defaultCharset && !window.print))) {
			
			// Set the third value to the text you want to appear in the field.
		
			var pwbox = document.getElementById("siteLoginPasswordField");
			if(pwbox)
				if(pwbox.value == "")
					pwbox = changeInputType(pwbox,'text',pwbox.title,false,true,"#999999");
			}
			var userbox = document.getElementById("siteLoginUserField");
			if(userbox){
				if(userbox.value == ""){
					userbox.value = userbox.title;
					userbox.style.color = "#999999";
				}
				userbox.onfocus = function(){
					if(userbox.value==userbox.title){
						userbox.value="";
						userbox.style.color = "#000000";
					}
				}
				userbox.onblur = function(){
					if(userbox.value==""){
						userbox.value=userbox.title;
						userbox.style.color = "#999999";
					}
				}
			}
		}
	
	
	
			    
	

		function showGmap(pImg,cImg,uImg,sImg){
			var map;
			this.getMap = function(){
				return map;
			}
			
			this.load = function() {
				if (GBrowserIsCompatible()) {
					map = new GMap2(document.getElementById("gmap"));
					
					if(parseInt(document.getElementById("gmap").style.height)>=300){
						map.addControl(new GLargeMapControl());
					} else{
						map.addControl(new GSmallMapControl());
					} 
					loadLocal();
					map.setMapType(G_HYBRID_MAP);
					
				}
			
			
			
			}
			var mapButtons = Array();
			this.addMapButtonControl = function(bName,bReturn){
				mapButtons.push(Array(bName,bReturn));
			}
			this.mapButtonControl = function(){
			
			}
			this.mapButtonControl.prototype = new GControl();
			this.mapButtonControl.bText = "";
			this.mapButtonControl.returnCall = "";
			this.mapButtonControl.prototype.initialize = function(map) {
				var container = document.createElement("div");;
				for(var i=0;i<mapButtons.length;i++){
					var mapButtonDiv = document.createElement("div");
					this.setButtonStyle_(mapButtonDiv);
					container.appendChild(mapButtonDiv);
					mapButtonDiv.appendChild(document.createTextNode(mapButtons[i][0]));
					eval("GEvent.addDomListener(mapButtonDiv, \"click\", function() { "+mapButtons[i][1]+"});");
				}
			
				map.getContainer().appendChild(container);
				return container;
			}
			
			this.mapButtonControl.prototype.getDefaultPosition = function() {
				return new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(7, 7));
			}
			
			this.mapButtonControl.prototype.setButtonStyle_ = function(button) {
				button.style.textDecoration = "none";
				button.style.color = "#000000";
				button.style.backgroundColor = "white";
				button.style.font = "10px Arial";
				button.style.fontWeight = "bold";
				button.style.border = "1px ridge black";
				button.style.padding = "2px";
				button.style.marginBottom = "3px";
				button.style.marginLeft = "3px";
				button.style.textAlign = "center";
				button.style.width = "90px";
				button.style.cursor = "pointer";
				button.style.cssFloat = button.style.styleFloat =  "left";
			}
			
			
			var baseIcon = new GIcon();
			
			
			baseIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";
			baseIcon.iconSize = new GSize(20, 34);
			baseIcon.shadowSize = new GSize(37, 34);
			baseIcon.iconAnchor = new GPoint(9, 34);
			baseIcon.infoWindowAnchor = new GPoint(9, 2);
			baseIcon.infoShadowAnchor = new GPoint(18, 25);
			var project = new GIcon(baseIcon);
			project.image = pImg;
			var charity = new GIcon(baseIcon);
			charity.image = cImg;
			var person = new GIcon(baseIcon);
			person.image = uImg;
			var supporter = new GIcon(baseIcon);
			supporter.image = sImg;
			
			/*
				type = {
					pm: Project manager
					pc: Projects parent charity
					pp: Projects own projectpage
					cp: Charity project
					cm: Charity manager
					cc: Charity's own charitypage
					up: Users project
					uc: Users charity
					uu: Users own userpage
				}
			
			*/
			this.aM = function(lat,lng,icon,name,url,type){
				
				var mico = false,desc = false;
				var point = new GLatLng(lat,lng);
				switch(type){
					case "pm":
						mico = person;
						desc = "";
					break;
					case "pc":
						mico = charity;
						desc = "";
					break;
					case "pp":
						mico = project;
						desc = "";
					break;
					case "cm":
						mico = person;
						desc = "";
					break;
					case "cc":
						mico = charity;
						desc = "";
					break;
					case "cp":
						mico = project;
						desc = "";
					break;
					case "uu":
						mico = person;
						desc = "";
					break;
					case "uc":
						mico = charity;
						desc = "";
					break;
					case "up":
						mico = project;
						desc = "";
					break;
					case "ps":
						mico = supporter;
						desc = "";
					break;
					case "cs":
						mico = supporter;
						desc = "";
					break;
				
				}
				var imgsrc = "/nl/files/"+icon+"%3A80%3A80/";
				var html = "<div><div style=\"float: left\" class=\"markerPopupImage\"><img src=\""+imgsrc+"\" alt=\"abc\" /></div><div style=\"float: left\" class=\"markerPopupText\"><a href=\""+url+"\" class=\"markerPopupLink\">"+name+"</a><br /><span class=\"markerPopupDesc\">"+desc+"</span></div></div>";
				
				var marker = new GMarker(point, mico);
				GEvent.addListener(marker, "click", function() {
					marker.openInfoWindowHtml(html);
				});
				
				
				
				map.addOverlay(marker);
			}
			
			
			
	}
    
         g = 0;
    b = 0;

    function changeColor()
    {
      document.getElementById("color").style.color = "rgb(255,"+g+","+b+")";
      g = g + 1;
      b = b + 1;
      
      if(g==100)
      {
        clearInterval(timer);
      }
    }

	// Function used on homepage for mouse-over thumbnails, showing more content 
	function replaceContent(div_origin, div_target) 
	{
		var div_content = document.getElementById(div_origin).innerHTML;

		document.getElementById(div_target).innerHTML = div_content; 
	} 
