var WCN;if(WCN&&(typeof WCN!='object'||WCN.NAME)){throw new Error("Namespace 'WCN' existiert bereits");}WCN={};WCN.NAME="Webchat-Network Webchat Lib";WCN.VERSION="1.0";WCN.Init=function(){if(document.getElementById=="undefined"||document.innerHTML=="undefined"||document.createElement=="undefined"){throw new Error("Browser erfuellt nicht die Mindestanforderungen. Abbruch!");}try{WCN.Y='http://www.webchat-network.de/webchat/';WCN.U=null;WCN.v=null;WCN.Z=false;WCN.M=false;WCN.L=0;WCN.d=new WCN.t();WCN.B=0;WCN.F=0;WCN.l=0;WCN.O=0;WCN.H=0;WCN.K=WCN.r();WCN.o=WCN.A();var styleSheet=null;styleSheet=document.createElement('link');styleSheet.setAttribute('rel','stylesheet');styleSheet.setAttribute('type','text/css');styleSheet.setAttribute('href',WCN.Y+'chat.css');WCN.o.appendChild(styleSheet);document.write('<div id="wcn_webchat">&nbsp;<\/div>');WCN.v=document.getElementById('wcn_webchat');if(WCN.m()){WCN.f(1);}else{WCN.f(0);}}catch(e){throw new Error("Webchat-Network Webchat-Applet Initialisierung fehlgeschlagen! Abbruch.");}};WCN.r=function(){try{if(navigator.platform&&navigator.platform.match(/Win/)){WCN.M=true;}else if(navigator.platform&&navigator.platform.match(/Mac/)){WCN.Z=true;}if(navigator.appName.match(/Microsoft Internet Explorer/)){return 1;}else if(navigator.appName.match(/Netscape|Opera/)){if(navigator.vendor&&navigator.vendor.match(/Apple/)){return 3;}return 2;}return 4;}catch(e){throw new Error("Browser konnte nicht erkannt werden!");}};WCN.A=function(){try{var head=document.getElementsByTagName('head').item(0);if(!head){throw new Error("Ungueltiges HTML-Dokument. Bitte head-Element setzen.");}return head;}catch(e){throw new Error("Fehler bei der Ermittlung des HEAD-Elements! Abbruch.");}};WCN.t=function(){this.c=new Array();this.c["PARAM_CHANNEL_ISMISSING"]=false;this.c["PARAM_CHANNEL_HASWRONGVALUE"]=false;this.c["PARAM_NICK_ISMISSING"]=false;this.c["PARAM_NICK_HASWRONGVALUE"]=false;this.c["PARAM_AUTOCONNECT_ISMISSING"]=false;this.c["PARAM_AUTOCONNECT_HASWRONGVALUE"]=false;this.c["PARAM_APPLET_WIDTH_ISMISSING"]=false;this.c["PARAM_APPLET_WIDTH_HASWRONGVALUE"]=false;this.c["PARAM_APPLET_HEIGHT_ISMISSING"]=false;this.c["PARAM_APPLET_HEIGHT_HASWRONGVALUE"]=false;this.V=function(P){try{var J='';var i=0;for(n in this.c){this.c[n]=((P&Math.pow(2,i))!=0)?true:false;i++;}for(n in this.c){if(this.c[n]){J+=n+'\n';}}return J;}catch(e){throw new Error("Fehler bei der Auswertung der Fehler! Abbruch.");}};this.I=function(){try{var G=0;var i=0;for(n in this.c){if(this.c[n]){G+=Math.pow(2,i);}i++;}return G}catch(e){throw new Error("Fehler bei der Brechnung des Fehlerwertes! Abbruch.");}}};WCN.m=function(){try{var w=new RegExp('(^#)([^,\\s]{1,32})$');var D=new RegExp('(^[a-zA-Z^\_[])([a-zA-Z0-9^\\-_\[\\]?]{0,24})$');if(typeof(wcn_channel)=='undefined'){WCN.d.c["PARAM_CHANNEL_ISMISSING"]=true;}else if(!w.test(wcn_channel)){WCN.d.c["PARAM_CHANNEL_HASWRONGVALUE"]=true;}if(typeof(wcn_nick)=='undefined'){WCN.d.c["PARAM_NICK_ISMISSING"]=true;}else if(!D.test(wcn_nick)){WCN.d.c["PARAM_NICK_HASWRONGVALUE"]=true;}if(typeof(wcn_autoconnect)=='undefined'){WCN.d.c["PARAM_AUTOCONNECT_ISMISSING"]=true;}else if(typeof(wcn_autoconnect)!='boolean'){WCN.d.c["PARAM_AUTOCONNECT_HASWRONGVALUE"]=true;}if(typeof(wcn_applet_width)=='undefined'){WCN.d.c["PARAM_APPLET_WIDTH_ISMISSING"]=true;}else if(typeof(wcn_applet_width)!='number'){WCN.d.c["PARAM_APPLET_WIDTH_HASWRONGVALUE"]=true;}else if(wcn_applet_width<600){WCN.d.c["PARAM_APPLET_WIDTH_HASWRONGVALUE"]=true;}if(typeof(wcn_applet_height)=='undefined'){WCN.d.c["PARAM_APPLET_HEIGHT_ISMISSING"]=true;}else if(typeof(wcn_applet_height)!='number'){WCN.d.c["PARAM_APPLET_HEIGHT_HASWRONGVALUE"]=true;}else if(wcn_applet_height<400){WCN.d.c["PARAM_APPLET_HEIGHT_HASWRONGVALUE"]=true;}WCN.B=WCN.d.I();if(WCN.B>0){return false;}else{return true;}}catch(e){throw new Error("Konnte nicht auf Fehler ueberpruefen! Abbruch.");}};WCN.f=function(R){try{var j='?bid='+WCN.K;j+='&tid='+R;switch(R){case 0:j+='&fehlercode='+WCN.B;break;case 1:break;case 2:j+='&nick='+escape(wcn_nick);j+='&channel='+escape(wcn_channel);j+='&autoconnect='+wcn_autoconnect;j+='&width='+wcn_applet_width;j+='&height='+wcn_applet_height;break;case 3:var k=null;k=document.createElement('script');k.setAttribute('type','text/javascript');k.setAttribute('src',WCN.Y+'cgichat.js');WCN.o.appendChild(k);break;}WCN.g=document.createElement('script');WCN.g.setAttribute('type','text/javascript');WCN.g.setAttribute('src',WCN.Y+'gettemplate.php'+j);WCN.o.appendChild(WCN.g);}catch(e){throw new Error("Fehler beim Laden von Template #"+R+"! Abbruch.");}};WCN.Q=function(){try{if(WCN.L>=1.5||(WCN.Z&&WCN.L)||(WCN.K==3&&WCN.L!=0&&WCN.M)){window.clearInterval(WCN.C);WCN.f(2);return;}if(WCN.l>9){window.clearInterval(WCN.C);WCN.f(3);return;}WCN.l++;}catch(e){throw new Error("Fehler bei Ueberpruefung des gesetzten JAVA-Versions-Wertes! Abbruch.");}};WCN.T=function(data){try{WCN.v.innerHTML=data;WCN.o.removeChild(WCN.g);}catch(e){throw new Error("Konnte Template nicht ausgeben! Abbruch.");}};WCN_SetJAVAVersion=function(version){try{WCN.L=parseFloat(version);return;}catch(e){throw new Error("Konnte JAVA-Version nicht uebergeben! Abbruch.");}};WCN.Init();