//**************************************************************************** // Copyright : Christoph Buenger Software (http://www.cbuenger.com), 2004-2005 // Created : 2004/06/25 Christoph Buenger //**************************************************************************** function getRetVal(retVal) { if(runningInMCE()) return retVal; else return !retVal; } function showDialog(sText, sCaption) { var sTxt = sText; if(isdefined(sCaption)) sTxt = sCaption + "\r\n\r\n" + sTxt; try { if(runningInMCE()) { if(showDialog.arguments.length == 1) window.external.MediaCenter.Dialog(sText, "", 1, -1, true); else window.external.MediaCenter.Dialog(sText, sCaption, 1, -1, true); } else alert(sTxt); } catch(e) { alert(sTxt); } } function AskUserDialog(sText) { try { if(runningInMCE()) { return (window.external.MediaCenter.Dialog(sText, "", 12, -1, true) == 2); } else return window.confirm(sText); } catch(e) { return window.confirm(sText); } } function UrlEncode(strTextIn) { var plaintext = strTextIn + ''; return encodeURI(plaintext); /* // The Javascript escape and unescape functions do not correspond // with what browsers actually do... var SAFECHARS = "0123456789" + // Numeric "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + // Alphabetci "abcdefghijklmnopqrstuvwxyz" + "-_.!~*'()"; // RFC2396 Mark characters var HEX = "0123456789ABCDEF"; var encoded = ""; for (var i = 0; i < plaintext.length; i++ ) { var ch = plaintext.charAt(i); if (ch == " ") { encoded += "+"; // x-www-urlencoded, rather than %20 } else if (SAFECHARS.indexOf(ch) != -1) { encoded += ch; } else { var charCode = ch.charCodeAt(0); if (charCode > 255) { encoded += "+"; } else { encoded += "%"; encoded += HEX.charAt((charCode >> 4) & 0xF); encoded += HEX.charAt(charCode & 0xF); } } } // for return encoded; */ } function UrlDecode(strTextIn) { // Replace + with ' ' // Replace %xx with equivalent character var encoded = strTextIn + ''; return decodeURI(encoded); /* var plaintext = ""; var i = 0; while (i < (encoded.length-2)) { var ch = encoded.charAt(i); if (ch == "+") { plaintext += " "; i++; } else if (ch == "%" && encoded.charAt(i+1) != "%") { plaintext += unescape( encoded.substr(i,3) ); i += 3; } else { plaintext += ch; i++; } } // while if (i < encoded.length) { plaintext += encoded.substr(i,encoded.length-i); } return unescape(plaintext); */ } function preloadImages() { var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=preloadImages.arguments; for(i=0; i val2 ? val1 : val2); } function runningInMCE() { try { return (window.external && isdefined(window.external.MediaCenter)); } catch(e) { } return false; } function isdefined(v) { try { if(v+'' == 'undefined') return false; } catch(e) { return false; } return true; } function getNoCacheUrlParam() { var x = (Math.random() + ''); return x.substr(2, 6); } function LockScreen() { var progr = document.getElementById("fraProgress"); progr.style.visibility = 'visible'; } var debugWnd2 = null; function InspectObject(obj) { var str = ""; for (var prop in obj) str += "obj." + prop + " = " + obj[prop] + "\n" if(runningInMCE()) //showDialog(str); window.navigate("info.php?msg=" + UrlEncode(str)); else { var paras = "width=760,height=500,menubar=no,scrollbars=yes"; if((debugWnd2 == null) || (debugWnd2.closed)) debugWnd2 = window.open("", "debugWnd2", paras); str = str.replace(//g,">"); debugWnd2.document.body.innerHTML = "
" + str + "
"; } } function trim(strIn) { return strIn.replace(/^\s*|\s*$/g, ""); } function getStyle(el, styleProp) { if (window.getComputedStyle) var y = window.getComputedStyle(el, null).getPropertyValue(styleProp); else if (el.currentStyle) var y = eval('document.getElementById("' + el.id + '").currentStyle.' + styleProp); return y; } function PageQueryObject(q) { if(q.length > 1) this.q = q.substring(1, q.length); else this.q = null; this.keyValuePairs = new Array(); if(this.q) { for(var i=0; i < this.q.split("&").length; i++) this.keyValuePairs[i] = this.q.split("&")[i]; } this.getKeyValuePairs = function() { return this.keyValuePairs; } this.getValue = function(s) { for(var j=0; j < this.keyValuePairs.length; j++) { if(this.keyValuePairs[j].split("=")[0] == s) return this.keyValuePairs[j].split("=")[1]; } return ""; } this.getParameters = function() { var a = new Array(this.getLength()); for(var j=0; j < this.keyValuePairs.length; j++) a[j] = this.keyValuePairs[j].split("=")[0]; return a; } this.getLength = function() { return this.keyValuePairs.length; } } var _pageQueryObject = null; function UrlGetParameter(key) { if(_pageQueryObject == null) _pageQueryObject = new PageQueryObject(window.location.search); return UrlDecode(_pageQueryObject.getValue(key)); }