//<script> //jog VID intellisense
/*
// msgbox constants for javascript, if you want to use them: 
var vbOKOnly=0, vbOKCancel=1, vbAbortRetryIgnore=2, vbYesNoCancel=3, vbYesNo=4, vbRetryCancel=5
var vbCritical=16, vbQuestion=32, vbExclamation=48, vbInformation=64
var vbDefaultButton1=0, vbDefaultButton2=256, vbDefaultButton3=512, vbDefaultButton4=768
*/

var strMsgboxPath = ''; 	// adjust this line to reflect the web app's relative path to the jsMsgbox files (e.g. '/inc/controls/jsMsgbox/')
var vbOK=1, vbCancel=2, vbAbort=3, vbRetry=4, vbIgnore=5, vbYes=6, vbNo=7;
function msgbox(prompt, buttons, title, helpfile, context){
	if(!window.showModalDialog){	return 'Error: This web browser does not support window.showModalDialog';	}

	// guess at height (based on # of line-breaks) 
	var h = 2;
	if(prompt.search(/\r\n/g)!=-1){h = prompt.match(/\r\n/g).length+1;}
	h = 110 + (h*12.5);	// base-110px + 12.5px/line

	// guess at width (based on longest line's char-count)
	var w = 30;
	if(prompt.search(/[^\r\n]*[\r\n]?/gm)!=-1){
		var lines = prompt.match(/[^\r\n]*[\r\n]?/gm);
		for(var l=0; l<lines.length; l++){
			if(lines[l].length>w){w=lines[l].length};
		}
	}
	w-=30;
	if(w<0){w=0};
	w = 220 + (w*7.5);	// base 210px + 7.5px/char
	
	var strFeatures = 'dialogHeight:' + h + 'px; dialogWidth:' + w + 'px; scroll:no; status:no; help:no; resizable:yes;';
//	return showModalDialog(strMsgboxPath + 'js_msgbox.html?' + new Date(), arguments, strFeatures);	// debug ver
	return showModalDialog(strMsgboxPath + 'js_msgbox.html', arguments, strFeatures);	// fast live ver
}
