function phpWGOpenWindow(theURL,winName,features) { img = new Image(); img.src = theURL; if (img.complete) { var width=img.width+40, height=img.height+40; } else { var width=640, height=480; img.onload = function () { newWin.resizeTo( img.width+50, img.height+100); }; } newWin = window.open(theURL,winName,features+',left=2,top=1,width=' + width + ',height=' + height); } function popuphelp(url) { window.open( url, 'dc_popup', 'alwaysRaised=yes,dependent=yes,toolbar=no,height=420,width=500,menubar=no,resizable=yes,scrollbars=yes,status=no' ); } function pwgBind(object, method) { var args = Array.prototype.slice.call(arguments,2); return function() { return method.apply(object, args.concat(Array.prototype.slice.call(arguments,0)) ); } } function PwgWS(urlRoot) { this.urlRoot = urlRoot; this.options = { method: "GET", async: true, onFailure: null, onSuccess: null }; }; PwgWS.prototype = { callService : function(method, parameters, options) { if (options) { for (var prop in options) this.options[prop] = options[prop]; } try { this.xhr = new XMLHttpRequest();} catch(e) { try { this.xhr = new ActiveXObject('Msxml2.XMLHTTP'); } catch(e) { try { this.xhr = new ActiveXObject('Microsoft.XMLHTTP'); } catch (e){ this.error(0, "Cannot create request object"); return; } } } this.xhr.onreadystatechange = pwgBind(this, this.onStateChange); var url = this.urlRoot+"ws.php?format=json&method="+method; var body = ""; if (parameters) { for (var prop in parameters) { if ( typeof parameters[prop] == 'object' && parameters[prop]) { for (var i=0; i