function dia_openImageBrowserWindow(inputId,maxWidth,maxHeight)
{
	var inputObj = dia_getElementById(inputId)
	var	inputName = inputObj.name;
	var formName = inputObj.form.name;
	var urlStr  = dia_getWebsiteHomeURL();
		urlStr += 'imageBrowser.php';
		urlStr += '?formname=' + formName;
		urlStr += '&elementnames=' + inputName;
		urlStr += '&maxwidth=' + maxWidth;
		urlStr += '&maxheight=' + maxHeight;							
					
	imageBroswerWin = window.open(urlStr,'DiamondCMSImageBrowser','width=560,height=400,menubar=no,resizeable=no,scrollbars=no');
}

function dia_ImageBrowserInsertURL(url)
{
	if (window.opener && js != "") {
		eval("window.opener." + js + "(url);");
		top.close();
		return;
	}									

	if (window.opener && formname != "") {
		var elements = elementnames.split(',');
		for (var i=0; i<elements.length; i++) {
			try {
				window.opener.document.forms[formname].elements[elements[i]].value = url;
				dia_fireEvent(window.opener.document.forms[formname].elements[elements[i]],'change');
			} catch(e) {}
		}
		top.close();
	}
	top.close();
};

function dia_ImageBrowserNewImage(currdir,maxwidth,maxheight)
{
	var urlStr  = dia_getWebsiteHomeURL();
		urlStr += '/imageUploader.php?currdir='+currdir+'&maxwidth='+maxwidth+'&maxheight='+maxheight;
	
	imageUploadWin = window.open(urlStr,'DiamondCMSUploadImage','width=300,height=150,menubar=no,resizeable=no,scrollbars=no');
}

function dia_ImageBrowserNewFolder()
{
	var urlStr  = dia_getWebsiteHomeURL();
		urlStr += '/imageFolder.php';
	
	imageUploadWin = window.open(urlStr,'DiamondCMSUploadImage','width=200,height=200,menubar=no,resizeable=no,scrollbars=no');
}