	function unHider(thediv)
	{
		if(document.forms[0].PaidParking.value == 'else' || document.forms[0].PaidParking.value == 'anders') {
			if(document.getElementById(thediv).style.display == 'none') {

				document.getElementById(thediv).style.display = 'block';

			} else {

				document.getElementById(thediv).style.display = 'none';

			}
		} else {

			document.getElementById(thediv).style.display = 'none';

		}
	}

	function getLanguage(thediv)
	{
		if(document.getElementById(thediv).style.display == 'none') {

			document.getElementById(thediv).style.display = 'block';

		} else {

			document.getElementById(thediv).style.display = 'none';

		}
	}

	function isNumberKey(evt)
	{
		var charCode = (evt.which) ? evt.which : event.keyCode

		if (charCode > 31 && (charCode < 48 || charCode > 57))
		{
			return false;
		}

		return true;
	}

	function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
	{
		var arVersion = navigator.appVersion.split("MSIE")
		var version = parseFloat(arVersion[1])

		if ((version >= 5.5) && (document.body.filters))
		{
			for(var i=0; i<document.images.length; i++)
			{
				var img = document.images[i]
				var imgName = img.src.toUpperCase()

				if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
				{
					var imgID = (img.id) ? "id='" + img.id + "' " : ""
					var imgClass = (img.className) ? "class='" + img.className + "' " : ""
					var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
					var imgStyle = "display:inline-block;" + img.style.cssText

					if (img.align == "left")
					{
						imgStyle = "float:left;" + imgStyle
					}

					if (img.align == "right")
					{
						imgStyle = "float:right;" + imgStyle
					}

					if (img.parentElement.href)
					{
						imgStyle = "cursor:hand;" + imgStyle
					}

					var strNewHTML = "<span " + imgID + imgClass + imgTitle
						+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
						+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
						+ "(src=" + img.src + ", sizingMethod=scale);\"></span>"
					img.outerHTML = strNewHTML
					i = i-1
				}
			}
		}
	}
	if (window.attachEvent)
	{
		window.attachEvent("onload", correctPNG);
	}

	function ChangeInputs()
	{
		var tag = document.getElementsByTagName('input');
		var i = 0;

		for(i = 0; i < tag.length; i++)
		{
			if(tag[i].getAttribute('type') == "text")
			{
				tag[i].className = 'text';
			}
			else if(tag[i].getAttribute('type') == "password")
			{
				tag[i].className = 'password';
			}
			else
			{
				tag[i].className = 'button';
			}
		}
	}
	if (window.attachEvent)
	{
		window.attachEvent("onload", ChangeInputs);
	}

	function NewCity(thediv, show)
	{
		var div = document.getElementById(thediv);

		if(div != null)
		{
			div.className = (show) ? "show" : "hide";
		}
	}

	function ImageMouseOver(img_name, img_src, id)
	{
		document.images[img_name].src = img_src;

		if(document.getElementById(id).className == "inactivecountry")
		{
			document.getElementById(id).className = "activecountry";
		}
		else
		{
			document.getElementById(id).className = "inactivecountry";
		}
	}

	function ImageMouseOut(img_name, img_src, id)
	{
		document.images[img_name].src = img_src;

		document.getElementById(id).className = "inactivecountry";
	}

	function PreloadImages()
	{
		var preloadImagesArray = document.getElementsByTagName("img");
		PreloadedImage = new Image();

		for(i = 0; i < preloadImagesArray.length; i++)
		{
			PreloadedImage.src = preloadImagesArray.length[i];
		}
	}
	if (window.attachEvent)
	{
		window.attachEvent("onload", PreloadImages);
	}
	
	function favorite() {
		var url = "http://www.hoteldesk.eu";
		var title = "Find your hotel at hoteldesk";
		
		if (document.all && navigator.appVersion.indexOf("MSIE") != -1) {
			
			window.external.AddFavorite(url, title);
		
		} else if (window.sidebar) {
		
			window.sidebar.addPanel(title, url, "")
		
		} else {
			
			window.alert("Go to Bookmarks->Bookmark This Page (or ctrl + D) to add "+ title +" to your favorites.");
		
		}
	}
	
	function checkAll(field)
	{		
		window.alert(field.length);
		
		for(var i = 0; i <= field.length; i++) {
		
			var element = document.forms[0].elements[i];
			
			if(element.type == 'checkbox') {
				element.checked = true;
			}
		}

	}
	
	function unCheckAll(field)
	{
		for (i = 0; i < field.length; i++) {
			
			field[i].checked = false ;
			
		}
	}

function checkallchecks(){
 
  for(var i=0;i<document.forms[0].elements.length; i++){
    var currentElement = document.forms[0].elements[i];
    if(currentElement.type=="checkbox"){
      currentElement.checked=true;
    }
  }
}	

function SetCookie(key, value)
{
	var datum = new Date();
	datum.setMonth(datum.getMonth() + 1);

	document.cookie = key+"="+value+";expires="+datum+";path=/";
}

function ShowMenu(num, menu, max)
{
	for(i = 1; i <= num; i++)
	{
		var menu2 = menu + i;
		document.getElementById(menu2).style.display = 'block';
	}

	var num2 = num;
	num2++;

	while(num2 <= max)
	{
		var menu3 = menu + num2;
		document.getElementById(menu3).style.display = 'none';
		num2=num2+1;
	}
}

function create_http_object()
{
	var ActiveXTypes = [
		"Microsoft.XMLHTTP",
		"MSXML2.XMLHTTP.5.0",
		"MSXML2.XMLHTTP.4.0",
		"MSXML2.XMLHTTP.3.0",
		"MSXML2.XMLHTTP"
	];

	for( var i = 0; i < ActiveXTypes.length; i++ )
	{
		try
		{
			return new ActiveXObject( ActiveXTypes[i] );
		}
		catch( e )
		{ }
	}

	try
	{
		return new XMLHttpRequest();
	}
	catch( e )
	{ }

	return false;
}

function make_request(url, callback_function, http_method, post_values, return_xml)
{
	http = create_http_object();

	if(!http)
	{
		alert('Je browser ondersteunt deze feature niet.');
		return false;
	}

	http.onreadystatechange = function()
	{
		if(http.readyState == 4)
		{
			if(http.status == 200)
			{
				if(callback_function)
				{
					if(return_xml)
					{
						eval(callback_function + '(http.responseXML)');
					}
					else
					{
						eval(callback_function + '(http.responseText)');
					}
				}
			}
			else
			{
				alert('Error! (' + http.status + ')');
			}
		}
	}

	if(!post_values)
	{
		post_values = null;
	}
	if(!http_method)
	{
		http_method = "GET";
	}

	http.open(http_method, url, true);

	if(http_method == "POST")
	{
		http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	}

	http.send(post_values);
}

function checkCity()
{

	post_string = 'city=' + document.forms[0].cities.value;

	make_request('/pages/addcity.php', 'handle_response', 'POST', post_string);

}

function handle_response(result)
{
	document.getElementById('result_div').innerHTML = result;
}

function startLoading() {
  Element.show('mainAreaLoading');
  Element.hide('mainAreaInternal');
}
function finishLoading() {
  Element.show('mainAreaInternal');
  setTimeout("Effect.toggle('mainAreaLoading');", 1000);
}

function loadContent(id) {
  startLoading();
  new Ajax.Updater('mainAreaInternal', '/pages/getcity.php', {method: 'post', postBody:'act='+ id +''});
  finishLoading();
}

/************************************************************************************************************
(C) www.dhtmlgoodies.com, October 2005

This is a script from www.dhtmlgoodies.com. You will find this and a lot of other scripts at our website.	

Terms of use:
You are free to use this script as long as the copyright message is kept intact. However, you may not
redistribute, sell or repost it without our permission.

Thank you!

www.dhtmlgoodies.com
Alf Magne Kalleland

************************************************************************************************************/		
var progressbar_steps = 50;	// Total number of progress bar steps.

/* Don't change any of these variables */
var dhtmlgoodies_progressPane = false;
var dhtmlgoodies_progressBar_bg = false;
var dhtmlgoodies_progressBar_outer = false;
var dhtmlgoodies_progressBar_txt = false;
var progressbarWidth;
var currentStep = 0;
var progressbar = 'false';
function moveProgressBar(steps){
if(document.getElementById('dhtmlgoodies_progressPane') != null)
{
	if(!dhtmlgoodies_progressBar_bg){
		dhtmlgoodies_progressPane = document.getElementById('dhtmlgoodies_progressPane');
		dhtmlgoodies_progressBar_bg = document.getElementById('dhtmlgoodies_progressBar_bg');
		dhtmlgoodies_progressBar_outer = document.getElementById('dhtmlgoodies_progressBar_outer');
		dhtmlgoodies_progressBar_txt = document.getElementById('dhtmlgoodies_progressBar_txt');
		progressbarWidth = dhtmlgoodies_progressBar_bg.clientWidth;
	}
	if(!steps){
		dhtmlgoodies_progressBar_outer.style.width = progressbarWidth + 'px';
		dhtmlgoodies_progressBar_txt.innerHTML = '100%';
		setTimeout('document.getElementById("dhtmlgoodies_progressPane").style.display="none"',50);
	}else{
		currentStep+=steps;
		if(currentStep>progressbar_steps)currentStep = progressbar_steps;
		var width = Math.ceil(progressbarWidth * (currentStep / progressbar_steps));
		dhtmlgoodies_progressBar_outer.style.width = width + 'px';
		var percent = Math.ceil((currentStep / progressbar_steps)*100);
		dhtmlgoodies_progressBar_txt.innerHTML = percent + '%';
		if(currentStep==progressbar_steps){
			setTimeout('document.getElementById("dhtmlgoodies_progressPane").style.display="none"',50);
		}
	}
	}	
}

function demoProgressBar()
{
	if(currentStep<progressbar_steps){
		moveProgressBar(1);
		setTimeout('demoProgressBar()',100);
	}
}

if (window.attachEvent)
{
	window.attachEvent("onload", demoProgressBar);
}
