
// Script for launching the DM OnLine Applet Window and login
//  - located /webservices/dmonline.jsp

//  - /webservices/login/help/plugininstall.jsp
//  - /webservices/main.jsp
//  - /webservices/dmonline.jsp
//  - /products/docmagic.jsp

	var dmonlinelogin;

	function WebSheetOn(host, acct, user) {
		if (host == null || host == '') host = "www.docmagic.com";
        var strURL = 'https://'+host+'/webservices/ws/load.htm';
		if (arguments.length > 1) { // new method used by partner's to log into a customer's acct
			strURL += '?accountid='+acct+'&userid='+user;	
		} //else {
			//strURL = 'https://'+host+'/servlet/WebSheet';
		//}
		if (dmonlinelogin == null || dmonlinelogin.closed) {
			dmonlinelogin = window.open( strURL,"websheetsWin","width=800,height=600,toolbar=no,location=no,menubar=no,resizable=yes,scrollbars=no,status=no");
		}
		dmonlinelogin.focus();
	}
	
	function WebSheetOff(host) {
		if (host == null || host == '') host = "www.docmagic.com";
		var dmonnlineClosed = null;
		if (dmonnlineClosed == null || dmonnlineClosed.closed)
			dmonnlineClosed = window.open('http:\/\/'+host+'/webservices/ws/disabled.jsp','dmonnlineClosed','width=600,height=400,scrollbars=no,resizable=no');
		dmonnlineClosed.focus();
	}
