function FwkConfirmDelete(msg)
{
	if (confirm(msg))
		event.returnValue=true;
	else
		event.returnValue=false;
}

function FwkShowMessage(msg)
{
	alert(msg);
	event.returnValue=true;
}

function FwkClear(ctrlName)
{
	var ctrls;
	ctrls = document.getElementsByName(ctrlName);
	if (ctrls != null && ctrls.length != 0)
		ctrls.item(0).value = "";

	ctrls = document.getElementsByName(ctrlName + "Value");
	if (ctrls != null && ctrls.length != 0)
		ctrls.item(0).value = "";
}

function FwkBrowse(ctrlName, windowName, features)
{
	var ctrls;
	var url = "";
	var initVal = "";
	var initDisplay = "";
	var ret;
	ctrls = document.getElementsByName(ctrlName + "URL");
	if (ctrls != null && ctrls.length != 0)
		url = ctrls.item(0).value;

	ctrls = document.getElementsByName(ctrlName + "Value");
	if (ctrls != null && ctrls.length != 0)
		initVal = ctrls.item(0).value;

	ctrls = document.getElementsByName(ctrlName);
	if (ctrls != null && ctrls.length != 0)
		initDisplay = ctrls.item(0).value;
		
	if (url.indexOf("?") == -1)
		url += "?";
	else
		url += "&";

	url += "ctrl=" + ctrlName 
			+ "&initVal=" + escape(initVal)
			+ "&initDisplay=" + escape(initDisplay);


	ret = window.open(url, windowName, features);
	if (ret != null)
		ret.focus();
}

function ImageViewerOpen(href, width, height, toolbar, location, scrollbars, resizable)
{
	var pozx = window.screen.width/2 - width/2;
	var pozy = window.screen.height/2 - height/2;
	window.open(href, 'ImageViewer','top='+pozy+',left=' +pozx+',width='
										+width +',height='+height+',toolbar='
										+toolbar+',location='+location+',scrollbars='
										+scrollbars+',resizable='+resizable);
	if (event != null)
	  event.returnValue=false;
}
