//---------------------------- dialog library
// --- all code copyright by Phil Barnard and iWave P/L; support@onpix.com.au ---
		
var dObj;
var features = "left=200,top=100,width=360,height=196,scrollbars=0,resizable=0";

// generate an absolute address to our files for when we are called from inside another directory
var root = "http://" + window.location.host + "/";

// generate the absolute address of the folder containing the calling file
// var parent = window.location.href.replace(/(^.*\/).*$/,"$1");

function d_alert(str,act){
	if(!dObj || dObj.closed) dObj = window.open(root + "d_alert.asp?"+str+"|"+act,"Status",features);
	dObj.focus();
}

function d_confirm(str,act1,act2){  // act1=OK, act2=Cancel
	if(!dObj || dObj.closed) dObj = window.open(root + "d_confirm.asp?"+str+"|"+act1+"|"+act2,"Status",features);
	dObj.focus();
}

function d_prompt(str,val,func){
	if(!dObj || dObj.closed) dObj = window.open(root + "d_prompt.asp?"+str+"|"+val+"|"+func,"Status",features);
	dObj.focus();
}

function d_password(str,val){
	if(!dObj || dObj.closed) dObj = window.open(root + "d_password.asp?"+str+"|"+val,"Status",features);
	dObj.focus();
}

// file: is an asp that will write into this dialog.
// the calling page must have an element with a target property with id "tgt"
// the include files d_header.inc and d_footer.inc must surround the asp code in "file"

function d_status(){
	var wObj = window.open("","Status",features);
	var wTarget = wObj.opener.document.getElementById("tgt").target;
	wObj.opener.document.getElementById("tgt").target = "Status";
	// wObj.document.onmousedown = new Function("window.location.reload();this.parentWindow.close()");  // new Function("dump(this)");
	wObj.focus();
	return wObj;
}