﻿function openWindow(sUrl, sName, nWidth, nHeight) {
	window.open(sUrl, sName, 'directories=0,status=no,scrollbars=yes,resizable=yes,screenX=0,screenY=0,left=0,top=0,width=' + nWidth + ',height=' + nHeight)
}


function LoadAssetExplorer(inputName, defaultImage, imageRoot) {
	var txt = document.getElementById(inputName);
	var image;
	if (txt.value == "") {
		image = defaultImage;
	}
	else {
		image = txt.value;
	}

	var url;
	if (image.toString().substr(0, 4) == "http") {
		url = '/controls/lwreid/admin/assetexplorer.aspx?root=' + imageRoot + '&input=' + inputName;
	}
	else {
		url = '/controls/lwreid/admin/assetexplorer.aspx?root=' + imageRoot + '&image=' + escape(image) + '&input=' + inputName;
	}

	var hWnd = window.open(url, "AssetExplorer", "width=751,height=555,resizable=yes,scrollbars=yes");
	if (!hWnd.opener) hWnd.opener = self;
	if (hWnd.focus != null) hWnd.focus();

	return;
}

