function $(id){
	return document.getElementById(id);
}
function showContact(city){
	if($('contact_'+city)){
		var cities = new Array('utrecht', 'arnhem', 'nijmegen' ,'breda', 'delft', 'leiden', 'amsterdam', 'groningen', 'apeldoorn', 'zwolle', 'enschede', 'den_haag', 'leeuwarden');
		for(c in cities){
			if($('contact_'+cities[c])){
				$('contact_'+cities[c]).style.display = 'none';
			}
		}
		$('contact_'+city).style.display = 'block';
	}
}
function showItem(item){
	if($(item)){
		$(item).style.display = $(item).style.display == 'block'?'none':'block';
	}
}
function getAnchor(anchor){
	hash = window.location.hash.substr(1);

	if(anchor){
		//var anchors = new Array();
		//hash = hash.split('&');
		//for(hashpart in hash){
		//	console.log(hashpart)
		//	varvalue = hashpart.split('=');
		//	anchors[varvalue[0]] = varvalue[1];
		//}
		//console.log(anchors)
		//hash = anchors[anchor];
	}
	return hash;
}

function confirmDelete(a,message){
	if(confirm(message)){
		var f = document.createElement('form'); 
		f.style.display = 'none'; 
		document.body.appendChild(f); 
		f.method = 'POST'; 
		f.action = a.href;
		f.submit();
	};
	return false;
}
function confirmNotification(a,message){
	if(confirm(message)){
		var f = document.createElement('form'); 
		f.style.display = 'none'; 
		document.body.appendChild(f); 
		f.method = 'POST'; 
		f.action = a.href;
		f.submit();
	};
	return false;
}
function addFileField(){
	var f = document.createElement('input'); 
	var br = document.createElement('br'); 
	f.type = 'file'; 
	f.name = 'files[]';
	f.setAttribute('onchange', 'addFileField()');
	$('file_fields').appendChild(f);
	$('file_fields').appendChild(br);
	//$('file_fields').innerHTML += '<input type="file" name="files[]" onchange="addFileField();" /><br/>';
}
