/************************************

	Custom Alert Demonstration
	version 1.0
	last revision: 02.02.2005
	steve@slayeroffice.com

	Should you improve upon this source please
	let me know so that I can update the version
	hosted at slayeroffice.

	Please leave this notice in tact!

************************************/

var ALERT_TITLE = "Budget Biluthyrning - Boka";
var ALERT_BUTTON_TEXT = "Stäng";

/*if(document.getElementById) {
	window.alert = function(txt) {
		createCustomAlert(txt);
	}
}*/

function createCustomAlert(arr) {
	d = document;

	if(d.getElementById("modalContainer")) return;

	mObj = d.getElementsByTagName("body")[0].appendChild(d.createElement("div"));
	mObj.id = "modalContainer";
	mObj.style.height = d.documentElement.scrollHeight + "px";
	
	alertObj = mObj.appendChild(d.createElement("div"));
	alertObj.id = "alertBox";
	if(d.all && !window.opera) alertObj.style.top = document.documentElement.scrollTop + "px";
	alertObj.style.left = (d.documentElement.scrollWidth - alertObj.offsetWidth)/2 + "px";
	alertObj.style.visiblity="visible";

	h1 = alertObj.appendChild(d.createElement("h1"));
	h1.appendChild(d.createTextNode(ALERT_TITLE));
	
	

	msg1 = alertObj.appendChild(d.createElement("h2"));
	msg1.appendChild(d.createTextNode(arr[0]));
	msg2 = alertObj.appendChild(d.createElement("p"));
	msg2.appendChild(d.createTextNode(arr[1]));
	msg3 = alertObj.appendChild(d.createElement("h2"));
	msg3.appendChild(d.createTextNode(arr[2]));
	msg4 = alertObj.appendChild(d.createElement("p"));
	msg4.appendChild(d.createTextNode(arr[3]));
	msg5 = alertObj.appendChild(d.createElement("h2"));
	msg5.appendChild(d.createTextNode(arr[4]));
	msg6 = alertObj.appendChild(d.createElement("p"));
	msg6.appendChild(d.createTextNode(arr[5]));
	msg7 = alertObj.appendChild(d.createElement("h2"));
	msg7.appendChild(d.createTextNode(arr[6]));
	msg8 = alertObj.appendChild(d.createElement("p"));
	msg8.appendChild(d.createTextNode(arr[7]));
	msg9 = alertObj.appendChild(d.createElement("h2"));
	msg9.appendChild(d.createTextNode(arr[8]));
	msg10 = alertObj.appendChild(d.createElement("p"));
	msg10.appendChild(d.createTextNode(arr[9]));
	msg11 = alertObj.appendChild(d.createElement("h2"));
	msg11.appendChild(d.createTextNode("För bokningar kontakta kontoret via telefon."));

	btn = alertObj.appendChild(d.createElement("a"));
	btn.id = "closeBtn";
	btn.appendChild(d.createTextNode(ALERT_BUTTON_TEXT));
	btn.href = "#";
	btn.focus();
	btn.onclick = function() { removeCustomAlert();return false; }

	alertObj.style.display = "block";
	
}

function removeCustomAlert() {
	document.getElementsByTagName("body")[0].removeChild(document.getElementById("modalContainer"));
}
