function customAlert(txt, title)
{
	var isIe = (document.all)?true:false;
	var availH = 0;
	if(isIe){
		availH = window.screen.availHeight  - window.screenTop - 26;
	}else{
		availH = window.screen.availHeight  - 168;
	}
	if(document.body.scrollHeight > availH){
		availH = document.body.scrollHeight;
	}

	if(!title) title = 'System Message';
	
	if(!txt)txt='';
    var shield = document.createElement("DIV");
    shield.id = "shield";
    var styleStr = "top:0px;left:0px;position:absolute;background:#666;width:100%;height:"+availH+"px;";
    styleStr += (isIe)?"filter:alpha(opacity=60);":"opacity:0.60;";
    shield.style.cssText = styleStr;
    document.body.appendChild(shield);

    var alertFram = document.createElement("DIV");
    alertFram.id = "alertFram";
    var alertLeft = (document.body.offsetWidth - 420)/2;
    alertFram.style.cssText = "background:#ccc;left:"+alertLeft+"px;top:35%;position:absolute;width:420px;height:120px;";
    var btnStyle = 'border:#e39b78 1px solid; padding:0px; background:#ffd549; cursor:pointer; color:#FFFFFF; font-weight:bold; height:20px; width:60px';
    var strHtml = "<table border='0' cellpadding='3' cellspacing='1' bgcolor='#F7941C' width='100%' height='100%'>";
    strHtml += "<tr bgcolor='#FFC438'><td align='left' style='font-weight:bold;'>"+title+"</td></tr>";
    strHtml += "<tr bgcolor='#FFFFFF'><td align='center' height='95%' style='font-size:16px;'>"+txt+"</td></tr>";
    strHtml += "<tr bgcolor='#FEDA89'><td align='center'><input type='button' style='"+btnStyle+"' value='Close' onclick='doOk();'/></td></tr>";
    strHtml += "</table>";
    alertFram.innerHTML = strHtml;
    document.body.appendChild(alertFram);
    
    this.doOk = function(){
		document.getElementById('shield').parentNode.removeChild(document.getElementById('shield'));
		document.getElementById('alertFram').parentNode.removeChild(document.getElementById('alertFram'));
    }
}

function customConfirm(txt, title, func)
{
	var isIe = (document.all)?true:false;
	var availH = 0;
	var availW = document.body.scrollWidth;
	if(isIe){
		availH = window.screen.availHeight  - window.screenTop - 26;
	}else{
		availH = window.screen.availHeight  - 168;
	}
	if(document.body.scrollHeight > availH){
		availH = document.body.scrollHeight;
	}

	if(!title) title = 'System Message';
	
	if(!txt)txt='';
    var shield = document.createElement("DIV");
    shield.id = "shield";
    var styleStr = "top:0px;left:0px;position:absolute;background:#666;width:"+availW+"px;height:"+availH+"px;";
    styleStr += (isIe)?"filter:alpha(opacity=60);":"opacity:0.60;";
    shield.style.cssText = styleStr;
    shield.innerHTML = "<iframe id='ifm' style='"+styleStr+"margin:0px;border:0px;z-index:9998;'></iframe>";
    document.body.appendChild(shield);

    var alertFram = document.createElement("DIV");
    alertFram.id = "alertFram";
    var alertLeft = (document.body.offsetWidth - 420)/2;
    alertFram.style.cssText = "background:#ccc;left:"+alertLeft+"px;top:35%;position:absolute;width:420px;height:120px;z-index:9999;";
    var btnStyle = 'border:#e39b78 1px solid; padding:0px; background:#ffd549; cursor:pointer; color:#FFFFFF; font-weight:bold; height:20px; width:60px';
    var strHtml = "<table border='0' cellpadding='5' cellspacing='1' bgcolor='#F7941C' width='100%' height='100%'>";
    strHtml += "<tr bgcolor='#FFC438'><td align='left' style='font-weight:bold; font-size:16px;'>"+title+"</td></tr>";
    strHtml += "<tr bgcolor='#FFFFFF'><td align='left' height='95%' style='font-size:16px; line-height:24px;'>"+txt+"</td></tr>";
    strHtml += "<tr bgcolor='#FEDA89'><td align='center'><input type='button' style='"+btnStyle+"' value='OK' onclick='"+func+"'/>&nbsp;&nbsp;<input type='button' style='"+btnStyle+"' value='Cancel' onclick='doCancel();'/></td></tr>";
    strHtml += "</table>";
    alertFram.innerHTML = strHtml;
    document.body.appendChild(alertFram);

    this.doCancel = function(){
		document.getElementById('shield').parentNode.removeChild(document.getElementById('shield'));
		document.getElementById('alertFram').parentNode.removeChild(document.getElementById('alertFram'));
    }
}