

//if(document.getElementById) {
	//window.alert = function(txt) {
		//createCustomAlert(txt);
	//}
//}

function createCustomAlert(txt, ALERT_TITLE, ALERT_BUTTON_TEXT) {
	
	var d = window.document;

	if(d.getElementById("modalContainer")) return;
	var bodyObjects = d.getElementsByTagName("body");
	var bodyObj = bodyObjects[0];
	var mObj = d.createElement("div");
	bodyObj.appendChild(mObj);
	mObj.id = "modalContainer";
	
	mObj.style.backgroundColor="transparent";
	mObj.style.position="absolute";
	mObj.style.width="100%";
	mObj.style.height="100%";
	mObj.style.top="0px";
	mObj.style.left="0px";
	mObj.style.zIndex="10000";
	mObj.style.textAlign="center";
	mObj.style.height = d.documentElement.scrollHeight + "px";
	
	var alertObj = d.createElement("div");
	mObj.appendChild(alertObj);

	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.position="relative";
	alertObj.style.width="300px";
	alertObj.style.minHeight="120px";
	alertObj.style.margin="auto";
	alertObj.style.top="50%";
	alertObj.style.marginTop="-50px";
	alertObj.style.border="2px solid #000";
	alertObj.style.backgroundColor="#F2F5F6";
	alertObj.style.textAlign="center";
	alertObj.style.visibility="visible";
	
	var h1Obj = d.createElement("h1");
	alertObj.appendChild(h1Obj);
	var titleMsg = d.createTextNode(ALERT_TITLE);
	h1Obj.appendChild(titleMsg);
	h1Obj.style.margin="0";
	h1Obj.style.font="bold 0.9em verdana,arial";
	h1Obj.style.backgroundColor="#78919B";
	h1Obj.style.color="#FFF";
	h1Obj.style.borderBottom="1px solid #000";
	h1Obj.style.padding="2px 0 2px 5px";
	h1Obj.style.textAlign="center"
	
	var msg = d.createElement("p");
	msg.style.font="11pt verdana,arial";
	msg.style.textAlign="center";
	msg.style.marginTop="20px";
	msg.style.height="50px";
	msg.style.padding="5px";
	//msg.style.marginLeft="55px";
	
	alertObj.appendChild(msg);
	var textMsg = d.createTextNode(txt);
	msg.appendChild(textMsg);
	
	
	var btn = d.createElement("a");
	alertObj.appendChild(btn);
	btn.style.display="block";
	btn.style.position="relative";
	btn.style.margin="5px auto";
	btn.style.padding="3px";
	btn.style.border="2px solid #000";
	btn.style.width="70px";
	btn.style.font="0.7em verdana,arial";
	btn.style.textTransform="uppercase";
	btn.style.textAlign="center";
	btn.style.color="#FFF";
	btn.style.backgroundColor="#78919B";
	btn.style.textDecoration="none";
	
	var btnText = d.createTextNode(ALERT_BUTTON_TEXT);
	btn.appendChild(btnText);
	btn.id = "closeBtn";
	btn.href = "#";
	btn.onclick = function() { 
		removeCustomAlert();
		return false; 
	}


}

function removeCustomAlert() {
	document.getElementsByTagName("body")[0].removeChild(document.getElementById("modalContainer"));
}

