function smWindow(URL, width, height) {
	var winWidth = (width) ? width : 680;
	var winHeight = (height) ? height : 450;
	var allowModeless = false;
	if (window.showModelessDialog && allowModeless) {
		// IE5+
		var arguments = new Object();
		arguments.winName = "smWindow";
		var Features = "dialogHeight:"+winHeight+"px; dialogWidth:"+winWidth+"px; resizable:yes; status:no; help:no;";
		window.showModelessDialog(URL, arguments, Features);
	}
	else {
		var Name = "smWindow";
		var Features = "height="+winHeight+",width="+winWidth;
		//Features += ",directories=1,location=1,menubar=1,resizable=1,scrollbars=1,status=1,titlebar=1,toolbar=1,personal=1"; 
		Features += ",directories=0,location=0,menubar=0,resizable=1,scrollbars=1,status=1,titlebar=0,toolbar=1,personal=0"; 
		if (self.window.name != "smWindow") {
			self.window.name = "mainWindow";
		}
		var remote = open(URL, Name, Features);
	}
}



function dialogWin(winURL, width, height, dtype) {
	var winWidth = (width) ? width : 500;
	var winHeight = (height) ? height : 300;
	var dialogType = (dtype) ? dtype : "modeless";
	
	if ((dialogType=="modal" && window.showModalDialog) || (dialogType=="modeless" && window.showModelessDialog)) {	//IE
		var winArguments = window;
		var winFeatures = "dialogHeight:" +winHeight+ "px; dialogWidth:" +winWidth+ "px; resizable:yes; status:no; help:no;";
		if (dialogType=="modal") {
			window.showModalDialog(winURL, winArguments, winFeatures);
		} else {
			window.showModelessDialog(winURL, winArguments, winFeatures);
		}
	}
	else {
		var winName = "dialogWindow";
		var winFeatures = "outerHeight="+winHeight+",outerWidth="+winWidth+",resizable=1";
		if (dtype=="modal") {
			winFeatures += ",modal=1";
		} else if (dtype=="modeless") {
			winFeatures += ",dependent=1";
		}
		open(winURL, winName, winFeatures);
	}
}
