/**************************** econtioDebug.js *******************************
**** Version 1.02.0002
**** last changed 22.07.2008
****
**** (c) 2007/2008 Bernd Rudolf, econtio GmbH, www.econtio.de
****
**** 22.07.2008 keyHandler eingebaut
**** 29.07.2008 FF kompatibel gemacht
*****************************************************************************/
var nJSErrorCounter=0;function econtioDebug(a){this.debugElement=$fx(a);this.comboBox=this.debugElement.getElementById("debugCombo");this.subElements=new Object();this.subElementCounter=0;this.subElements.support=$fx(this.debugElement.getElementById("support"));this.newSubElement=function(e,d){e=$fx(e).cloneNode(true);e.id=$fx(e).id+this.subElementCounter++;this.debugElement.appendChild(e);var c=document.createElement("option");c.value=e.id;var b=document.createTextNode(d);c.appendChild(b);this.comboBox.insertBefore(c,this.comboBox.firstChild);this.comboBox.value=0;this.subElements[e.id]=e;return e;};this.switchSubElement=function(b){b=(typeof(b)=="string")?b:this.comboBox.value;for(sE in this.subElements){this.subElements[sE].setDisplay(false);}this.subElements[b].setDisplay(true);};if(this.comboBox){this.comboBox.onchange=this.switchSubElement.bind(this);}this.adjustDisplay=function(b,d){typeof(b)!="undefined"?this.debugElement.setDisplay(b):this.debugElement.toggleDisplay();if(d){var e=0;var c=0;var f=document.getElementById(d?d:"player");if(!f){f=$(main);e=600;c=35;}if(f){this.debugElement.size(Math.min(f.offsetWidth,400),Math.min(f.offsetHeight,240));var h=Coordinates.northwestOffset(f,true);this.debugElement.style.top=(h.y+c)+"px";this.debugElement.style.left=(h.x+e)+"px";}else{this.debugElement.size(400,240);this.debugElement.style.top=50+"px";this.debugElement.style.left=100+"px";}if(mecoVariables){var g="";for(el in mecoVariables){g+=el+"... "+mecoVariables[el]+"<br/>";}debuglog(g);}}else{this.debugElement.move(0,0);}};mainDebugElement=this.newSubElement("debugJS","JS Log");}debdetails=function(c,d){var b=1;var a;while(a=$fx($(c).getElementById("debugSub"+b))){a.setDisplay(false);if(b==d){a.setDisplay(true);}b++;}};function nextSupportStep(){if(mecoVariables.SUPPORT_SESSION&&mecoVariables.SUPPORT_SESSION.length>1){waitForSession();}else{scriptList.support=new mecoScript("support",["meco:loadWindow('POPUP', '"+mecoVariables.SUPPORT_URL+"getSession.asp')"]);meco.execScript("support",false,waitForSession);}}var waitForSessionCounter=0;function waitForSession(){if((mecoVariables.SUPPORT_SESSION&&mecoVariables.SUPPORT_SESSION.length>1)||waitForSessionCounter>10){submitSupportForm();scriptList.support2=new mecoScript("support2",["meco:loadWindow('POPUP', '"+mecoVariables.SUPPORT_URL+"completeRequest.asp?user="+mecoVariables.SUPPORT_SESSION+"')","meco:saveVariables(0, 'user_variables.xsl')","meco:showPopup(1)"]);meco.execScript("support2",false,null);}else{meco.execScript("getSession",false,waitForSession);}waitForSessionCounter++;}function submitSupportForm(){if(mainDebug){var a=mainDebug.debugElement.getElementById("supportForm");a.action=mecoVariables.SUPPORT_URL+"storeRequest.asp?project="+mecoVariables.PROJECT_NAME+"&user="+mecoVariables.SUPPORT_SESSION+"&ticket="+mecoVariables.SUPPORT_TICKET;$("allLogs").value=mainDebug.debugElement.innerHTML;a.submit();$("allLogs").value="";mainDebug.debugElement.setDisplay(false);}}function debugHandler(c,b,a){myError="### JS-Error: "+c+"<br/>"+b+" ("+a+")";debuglog(myError);return true;}function debuglog(c,b){if(typeof(mainDebugElement)!="undefined"){var a=mainDebugElement.getElementById("jsLog");}else{var a=$("jsLog");}if(!!a){a.innerHTML=c+"<br/>"+a.innerHTML;if(b){$fx(a).setDisplay(true);}return true;}else{alert(c);return false;}}function debugprint(c,b,d){var a=c;if(typeof(c)=="string"){c=$(c);}if(typeof(b)=="string"){b=c.getElementById(b);}if(b){b.innerHTML=d;}else{if(!!c){c.innerHTML+=d+"<br/>";}else{debuglog(d);}}}function debugKey(a){var c;if(typeof(window.event)=="object"){c=window.event.keyCode;}else{c=a.keyCode;}var b=false;if(c==122){if(!!meco){meco.toggleFullscreen();b=true;}}if(c==117){if(mainDebug){mainDebug.adjustDisplay();}b=true;}if(typeof(customer.specialKey)=="function"){b=customer.specialKey(c);}if(b){a=null;return false;}}
