
	function callAlert(header,text,links,wdth)
	{
		var pos;
		if (window.innerHeight)
		{
			pos = window.pageYOffset
		}
		else if (document.documentElement && document.documentElement.scrollTop)
		{
			pos = document.documentElement.scrollTop
		}
		else if (document.body)
		{
			pos = document.body.scrollTop
		}
		el = document.getElementById('alertpopup');
		//document.getElementById('alerttitle').getElementsByTagName('span')[0].firstChild.nodeValue = title;
		document.getElementById('popupHeader').innerHTML = header;
		document.getElementById('popupText').innerHTML = text;
		document.getElementById('popupLinks').innerHTML = links;
		el.style.width = wdth + "px";
		el.style.display = 'block';
		setMaskSize();
		document.getElementById('cover').style.display = 'block';
		el.style.top = (((f_clientHeight() - el.offsetHeight) / 2)+pos) + 'px';
		el.style.left = (f_clientWidth() - el.offsetWidth) / 2 + 'px';
		el.style.zIndex = "1001";
		if(document.frames){
			document.getElementById("fr").style.top = el.style.top;
			document.getElementById("fr").style.left = el.style.left;
			document.getElementById("fr").style.width = el.style.width;
			document.getElementById("fr").style.height = "100px";
			document.getElementById("fr").style.zIndex = "1000";
			document.getElementById("fr").style.display = "block";	document.getElementById("fr").style.filter='progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)';
			disableDD(true);
		}
	}
	function closeIt()
	{
		document.getElementById('alertpopup').style.display = 'none';
		document.getElementById('cover').style.display = 'none';
		if(document.frames){
			document.getElementById("fr").style.display = "none";
			disableDD(false);
		}
	}
	function f_clientWidth()
	{
		return f_filterResults
		(
		window.innerWidth ? window.innerWidth : 0,
		document.documentElement ? document.documentElement.clientWidth : 0,
		document.body ? document.body.clientWidth : 0
		);
	}
	function f_clientHeight()
	{
		return f_filterResults
		(
		window.innerHeight ? window.innerHeight : 0,
		document.documentElement ? document.documentElement.clientHeight : 0,
		document.body ? document.body.clientHeight : 0
		);
	}
	function f_filterResults(n_win, n_docel, n_body)
	{
		var n_result = n_win ? n_win : 0;
		if (n_docel && (!n_result || (n_result > n_docel)))
		n_result = n_docel;
		return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
	}
	function disableDD(bool){
		for (f = 0; f < document.forms.length; f++)
		{
		    var elements = document.forms[f].elements;
		    // looping through all elements on certain form
		    for (e = 0; e < elements.length; e++)
		    {
		        if ((elements[e].type == "select-one"))
		        {
		            elements[e].disabled = bool;
		            if (bool){
		                elements[e].style.backgroundColor = "#cccccc";
		            }else{
		                elements[e].style.backgroundColor = "#ffffff";
		            }
		        }
		    }
		}
	}
	function setMaskSize() {
	var theBody = document.getElementsByTagName("BODY")[0];
	
	var popHeight = "";	
	var popWidth = "";
	
	var fullHeight = f_clientHeight();
	var fullWidth = f_clientWidth();
	
	// Determine what's bigger, scrollHeight or fullHeight / width
	if (fullHeight > theBody.scrollHeight) {
		popHeight = fullHeight;
	} else {
		popHeight = theBody.scrollHeight;
	}
	
	if (fullWidth > theBody.scrollWidth) {
		popWidth = fullWidth;
	} else {
		popWidth = theBody.scrollWidth;
	}
	
	document.getElementById('cover').style.height = popHeight + "px";
	document.getElementById('cover').style.width = popWidth + "px";
}