// JavaScript Document
function WaitGo(toUrl, wait) {
	if(!wait) {
		var wait = 500;
	} else {
		var wait = wait * 1000;	
	}
	
	if(toUrl == 'back') {
		window.setTimeout('history.back()',wait);	
	} else {
		window.setTimeout('window.location.href="'+toUrl+'"',wait);
	}
}

function CheckNeeded(element, minlength) {
	if(document.getElementById(element).value.length >= minlength) {
		document.getElementById('error_'+element).innerHTML = '&#8730;';	
	} else {
		document.getElementById('error_'+element).innerHTML = '!';	
	}
}

function CheckBefore(toURL, text) {
	Check = confirm(text);
	if (Check == true)
  	window.location.href=toURL;
}

// ====== BILDER HOVER ======	
hotel_image = null;
		
document.onmousemove = update_hotel_image;

function update_hotel_image(e) {
	x = (document.all) ? window.event.x + document.body.scrollLeft : e.pageX;
	y = (document.all) ? window.event.y + document.body.scrollTop  : e.pageY;

	

	if (hotel_image != null) {
		hotel_image.style.left = (x - 20) + "px";
		if (is_gecko) {
			hotel_image.style.top = (y + 20) + "px";
		}
	
	}
	
}

function show_hotel_image(id, url) {
	hotel_image = document.getElementById(id);
	hotel_image.style.display = "block";
	document.getElementById('pic_big').innerHTML = '<img src="'+url+'" />';
}

function hide_hotel_image() {
	hotel_image.style.display = "none";
}
