var externalScript=new Array(); self_url="https://chartserver.worldsoft-cms.info/dataview.js.php"; div_name=""; if (!window.graph_urls){ window.graph_urls=new Array(); } window.graph_urls[div_name]=self_url; function replaceParamFromURL(url, param2replace, replacement_value,refresh){ // replaces value of a parameter from the URL tokens=url.split('?'); var pathname=tokens[0]; var query=tokens[1]; var seenParam=false; var parameters=new Array(); var params =new Array(); var seenLayout=false; var seenRefresh = false; //query = query.substr(1, query.length - 1); query = query.replace(/%26/,'&'); params= query.split('&'); for (i = 0; i < params.length; i++){ parameters[i]=params[i].split('='); } params=new Array(); for (i = 0; i < parameters.length; i++){ if(parameters[i][0] == "refresh"){ seenRefresh = true; if(refresh == 0){ continue; } } if (parameters[i][0]==param2replace) { parameters[i][1]=replacement_value; seenParam=true; } if (parameters[i][0] && parameters[i][1] && parameters[i][0] != ""){ params[i]=parameters[i][0]+"="+parameters[i][1]; } } if (!seenParam){ params[i+1]=param2replace+"="+replacement_value; } query=params.join('&'); if(seenRefresh == false && refresh == 1){ query += "&refresh=1"; } return pathname + "?" + query; } function onClickSubmit(div_id){ lyr=getLayerNameByDivId(div_id); newURL=window.graph_urls[lyr]; newURL=newURL.replace('dataview.js.php', "dataview_canvas.js.php"); newURL=newURL.replace('dataview.functions.js.php', "dataview_canvas.js.php"); //alert("Loading: "+newURL); loadScript(newURL); } function replaceScriptNameFromURL(url, newScriptName){ tokens=url.split('?'); var pathname=tokens[0]; var query=tokens[1]; var seenParam=false; } function loadScript(src, r){ var head = document.getElementsByTagName("head")[0]; externalScript[src]= document.createElement('script'); externalScript[src].id = 'importedScriptId'; externalScript[src].type = 'text/javascript'; externalScript[src].src = src; head.appendChild(externalScript[src]); } function getLayerNameByDivId(div_id){ return "graphPlaceHolder" + "_" + div_id; } function popOut(div_id, width, height) { lyr=getLayerNameByDivId(div_id); thisURL=window.graph_urls[lyr]; // find a way to reliably replace the script with the new name thisURL=thisURL.replace('dataview.js.php', "popout.php"); thisURL=thisURL.replace('dataview.functions.js.php', "popout.php"); thisURL=replaceParamFromURL(thisURL, "popout", 1); if (width) { graphWinWidth=width; } else { graphWinWidth=screen.width; } if (height) { graphWinHeight=height; } else { graphWinHeight=screen.height; } graphWidth=graphWinWidth; graphHeight=graphWinHeight-35; thisURL=replaceParamFromURL(thisURL, "width", graphWidth); thisURL=replaceParamFromURL(thisURL, "height", graphHeight); graphWinOptions="resizable=1,width="+graphWinWidth+",height="+graphWinHeight; graphWin=window.open(thisURL, div_id, graphWinOptions); } function changeGraph(div_id, company_id, engine, type, field, value, delay_loading,refresh,count_items,data_url) { //lyr="graphPlaceHolder" + "_" + engine + "_" + type + "_" + div_id; lyr="graphPlaceHolder" + "_" + div_id; var parameters = ""; for(var i=0; i> 2; enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); enc4 = chr3 & 63; if (isNaN(chr2)) { enc3 = enc4 = 64; } else if (isNaN(chr3)) { enc4 = 64; } output = output + this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) + this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4); } return output; }, // public method for decoding decode : function (input) { var output = ""; var chr1, chr2, chr3; var enc1, enc2, enc3, enc4; var i = 0; input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); while (i < input.length) { enc1 = this._keyStr.indexOf(input.charAt(i++)); enc2 = this._keyStr.indexOf(input.charAt(i++)); enc3 = this._keyStr.indexOf(input.charAt(i++)); enc4 = this._keyStr.indexOf(input.charAt(i++)); chr1 = (enc1 << 2) | (enc2 >> 4); chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); chr3 = ((enc3 & 3) << 6) | enc4; output = output + String.fromCharCode(chr1); if (enc3 != 64) { output = output + String.fromCharCode(chr2); } if (enc4 != 64) { output = output + String.fromCharCode(chr3); } } output = Base64._utf8_decode(output); return output; }, // private method for UTF-8 encoding _utf8_encode : function (string) { string = string.replace(/\r\n/g,"\n"); var utftext = ""; for (var n = 0; n < string.length; n++) { var c = string.charCodeAt(n); if (c < 128) { utftext += String.fromCharCode(c); } else if((c > 127) && (c < 2048)) { utftext += String.fromCharCode((c >> 6) | 192); utftext += String.fromCharCode((c & 63) | 128); } else { utftext += String.fromCharCode((c >> 12) | 224); utftext += String.fromCharCode(((c >> 6) & 63) | 128); utftext += String.fromCharCode((c & 63) | 128); } } return utftext; }, // private method for UTF-8 decoding _utf8_decode : function (utftext) { var string = ""; var i = 0; var c = c1 = c2 = 0; while ( i < utftext.length ) { c = utftext.charCodeAt(i); if (c < 128) { string += String.fromCharCode(c); i++; } else if((c > 191) && (c < 224)) { c2 = utftext.charCodeAt(i+1); string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); i += 2; } else { c2 = utftext.charCodeAt(i+1); c3 = utftext.charCodeAt(i+2); string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); i += 3; } } return string; } } //End Base64 document.write(Base64.decode('PGh0bWw+PGhlYWQ+Cjxib2R5Pgo8Zm9ybSBvbnN1Ym1pdD0icmV0dXJuIGZhbHNlOyI+CgogICAgCk5vIGRhdGEgZm91bmQgZm9yIHRoaXMgc3RhdHM='));