var BrowserName=navigator.appName,BrowserVersion=navigator.appVersion,BVersion=parseFloat(BrowserVersion),asb_shouts,xml,randomnr,value=0,startDay=1,number=0,backDay=0,chartCollection=[],hf_params,defaultwidth;datum=new Date;
window.onload=function(){for(i=0;i<document.getElementsByName("trp").length;i++){var a=document.getElementsByName("trp")[i].id;document.getElementById("trpbut-"+a).onclick=MuxDetail}for(i=0;i<document.getElementsByName("crt").length;i++){a=document.getElementsByName("crt")[i].id;a="crtbut-"+a;document.getElementById(a).onclick=ChartSelect}for(i=0;i<document.getElementsByName("crt_all").length;i++){a="crtbut_all";document.getElementById(a).onclick=SelectAllCharts}for(i=0;i<document.getElementsByName("chart_create").length;i++){a=
document.getElementsByName("chart_create")[i].id;var b="cccbut-"+a;hf_params=a;document.getElementById(b).onclick=ChartCreate}for(i=0;i<document.getElementsByName("param_name_alilgn").length;i++){a=document.getElementsByName("param_name_alilgn")[i].id;b=a.substring(3,5);a="p-"+a;if(b=="is")document.getElementById(a).onclick=UnselectParameter;if(b=="un")document.getElementById(a).onclick=SelectParameter}for(i=0;i<document.getElementsByName("monthid").length;i++){a=document.getElementsByName("monthid")[i].id;
document.getElementById(a).onclick=thisDay}for(i=0;i<document.getElementsByName("month-forward").length;i++)document.getElementsByName("month-forward")[0].onclick=calendarForward;value=document.getElementsByName("back_month")[0].id;for(i=0;i<document.getElementsByName("month-back").length;i++)document.getElementsByName("month-back")[0].onclick=calendarBack;a=document.getElementsByName("a-trpcr")[0].id;a=a.substring(2);a=document.getElementById("trpcr-"+a).style.width;trpwidth=a.substring(0,a.length-
2);LoadCalendar()};function changeValue(a,b){if(b.value==a)b.value="";else if(b.value=="")b.value=a}function MuxDetail(){location="/cgi-bin/lsat.cgi?"+this.id.substr(7)}function MuxHistory(){var a=0;for(i=0;i<document.getElementsByName("chart_create").length;i++)a=document.getElementsByName("chart_create")[i].id;location="/cgi-bin/lsat.cgi?"+a+"-"+value+"-"+backDay}
function LoadCalendar(){var a=new Ajax;a.url="/cgi-bin/calendar.cgi?"+value+"+"+hf_params;a.onSuccess=function(b,d){if(aoeHasError(b)){a.onError(aoeGetError(b));return null}d&&evaluateCal(d)};a.onError=aoeShowError;a.doRequest()}
function thisDay(){for(i=0;i<document.getElementsByName("monthid").length;i++){var a=document.getElementsByName("monthid")[i].id;document.getElementById(a).style.color="#000";document.getElementById(a).style.backgroundColor="#FFF"}a=this.id;backDay=a.substr(12);startDay=a.substr(4);MuxHistory();document.getElementById(a).style.color="#FFF";document.getElementById(a).style.backgroundColor="#000"}
function UnselectParameter(){document.getElementById(this.id.substr(15)+"-a").removeAttribute("style");document.getElementById(this.id.substr(15)+"-b").removeAttribute("style");document.getElementById(this.id.substr(15)+"-b").style.display="none";document.getElementById(this.id.substr(15)+"-a").style.display="none";var a=this.id.substr(2,2);document.getElementById(this.id).innerHTML='<img src="/images/icons/checkbox.gif" border="0">';for(i=0;i<document.getElementsByName("a-trpcr").length;i++){var b=
document.getElementsByName("a-trpcr")[i].id;b=b.substring(2);trpwidth=parseInt(trpwidth)-parseInt(a)-4;document.getElementById("trpcr-"+b).style.width=trpwidth+"px"}document.getElementById(this.id).onclick=SelectParameter}
function SelectParameter(){document.getElementById(this.id.substr(15)+"-b").removeAttribute("style");document.getElementById(this.id.substr(15)+"-a").removeAttribute("style");document.getElementById(this.id.substr(15)+"-b").style.styleFloat="left";document.getElementById(this.id.substr(15)+"-b").style.cssFloat="left";document.getElementById(this.id.substr(15)+"-a").style.styleFloat="left";document.getElementById(this.id.substr(15)+"-a").style.cssFloat="left";var a=this.id.substr(2,2);document.getElementById(this.id).innerHTML=
'<img src="/images/icons/checked.gif" border="0" height="13" width="13">';for(i=0;i<document.getElementsByName("a-trpcr").length;i++){var b=document.getElementsByName("a-trpcr")[i].id;b=b.substring(2);trpwidth=parseInt(trpwidth)+parseInt(a)+4;document.getElementById("trpcr-"+b).style.width=trpwidth+"px";document.getElementById("col_header-"+b).style.width=trpwidth+"px"}document.getElementById(this.id).onclick=UnselectParameter}
function ChartCreate(){var a=this.id,b=document.chartForm,d=b.range.value,f=b.type.value,e=0,j=11,k=0;if(b.trace[0].checked==true)e+=1;if(b.trace[1].checked==true)e+=2;if(b.trace[2].checked==true)e+=4;if(b.nwin.checked==true)k=1;b="";if(chartCollection.length==0)window.alert("Sie haben keinen Service gew\u00e4hlt. Bitte selektieren sie im Chart Feld mindestens einen Service!");else{if(chartCollection.length>10)window.alert("Sie haben "+chartCollection.length+" Service gew\u00e4hlt. Wenn sie mehr als 10 Service ausw\u00e4hlen, k\u00f6nnte die Grafik unleserlich wirken!");
else chartCollection.length>5&d>10&f==2&&window.alert("Sie haben entweder viele Service oder einen langen Zeitraum gew\u00e4hlt. Eventuell wird das Balkendiagramm unleserlich!");for(c=0;c<chartCollection.length;c++)b=b+chartCollection[c]+",";var g=this.id.substr(7);for(i=0;i<document.getElementsByName("chart_date").length;i++)j=document.getElementsByName("chart_date")[i].id;var h=document.getElementById("showroom");if(d==0)if(k==1){h.innerHTML="";f="/cgi-bin/monchart.cgi?"+g+"+"+d+"+"+f+"+"+e+"+"+
b+"+"+j;e=625;d=1020;d="width="+d+",height="+e+",scrollbars=no";d=window.open(f,"LinowSat",d);d.focus()}else h.innerHTML='<img src="/cgi-bin/monchart.cgi?'+g+"+"+d+"+"+f+"+"+e+"+"+b+"+"+j+'">';else if(k==1){h.innerHTML="";f="/cgi-bin/onlinechart.cgi?"+g+"+"+d+"+"+f+"+"+e+"+"+b+"+"+j;e=460;d=d*110;if(d>=1200)d=1200;if(d<=420)d=440;d="width="+d+",height="+e+",scrollbars=no";d=window.open(f,"LinowSat",d);d.focus()}else h.innerHTML='<img src="/cgi-bin/onlinechart.cgi?'+g+"+"+d+"+"+f+"+"+e+"+"+b+"+"+j+
'">';document.getElementById(a).innerHTML="&nbsp;&nbsp;&nbsp;&nbsp;Update&nbsp;&nbsp;&nbsp;&nbsp;"}}
function ChartSelect(){var a=this.id,b=a.substr(7);chartCollection.push(b);document.getElementById(a).onclick=noChart;document.getElementById(a).innerHTML='<img src="/images/icons/checked.gif" border="0" height="13" width="13">';document.getElementById(a).style.color="black";if(chartCollection.length>1){document.getElementById("radiofield").innerHTML='<input type="radio" value="min" name="trace">Min-Value<br><input type="radio" value="avg" name="trace" checked>Avg-Value<br><input type="radio" value="max" name="trace">Max-Value<br>';document.getElementById("radiofield").style.width=
"80px";document.getElementById("radiofield").style.marginLeft="15px"}}
function noChart(){var a=this.id,b=a.substr(7),d=[];for(c=0;c<chartCollection.length;c++)chartCollection[c]!=b&&d.push(chartCollection[c]);chartCollection=d;document.getElementById(a).onclick=ChartSelect;document.getElementById(a).innerHTML='<img src="/images/icons/checkbox.gif" border="0">';if(chartCollection.length<2)document.getElementById("radiofield").innerHTML='<input type="checkbox" value="min" name="trace" checked>Min-Value<br><input type="checkbox" value="avg" name="trace" checked>Avg-Value<br><input type="checkbox" value="max" name="trace" checked>Max-Value<br>'}
function SelectAllCharts(){for(i=0;i<document.getElementsByName("crt").length;i++){var a=document.getElementsByName("crt")[i].id;chartCollection.push(a);a="crtbut-"+a;document.getElementById(a).onclick=noChart;var b=document.getElementById(a);b.innerHTML='<img src="/images/icons/checked.gif" border="0" height="13" width="13">';document.getElementById(a).style.color="black"}a="crtbut_all";b=document.getElementById(a);b.innerHTML='<img src="/images/icons/checked.gif" border="0" height="13" width="13">';
document.getElementById(a).style.color="black";document.getElementById(a).onclick=UnSelectAllCharts;if(chartCollection.length>1){document.getElementById("radiofield").innerHTML='<input type="radio" value="min" name="trace">Min-Value<br><input type="radio" value="avg" name="trace" checked>Avg-Value<br><input type="radio" value="max" name="trace">Max-Value<br>';document.getElementById("radiofield").style.width="80px";document.getElementById("radiofield").style.marginLeft="15px"}}
function UnSelectAllCharts(){for(i=0;i<document.getElementsByName("crt").length;i++){var a=document.getElementsByName("crt")[i].id,b="crtbut-"+a,d=[];for(c=0;c<chartCollection.length;c++)chartCollection[c]!=a&&d.push(chartCollection[c]);chartCollection=d;document.getElementById(b).onclick=ChartSelect;a=document.getElementById(b);a.innerHTML='<img src="/images/icons/checkbox.gif" border="0">'}b="crtbut_all";a=document.getElementById(b);a.innerHTML='<img src="/images/icons/checkbox.gif" border="0">';
document.getElementById(b).onclick=SelectAllCharts;if(chartCollection.length<2)document.getElementById("radiofield").innerHTML='<input type="checkbox" value="min" name="trace" checked>Min-Value<br><input type="checkbox" value="avg" name="trace" checked>Avg-Value<br><input type="checkbox" value="max" name="trace" checked>Max-Value<br>'}
function calendarBack(){startDay=1;value++;LoadCalendar();if(value>0){document.getElementById("mback").innerHTML='<a href="javascript:void(0)" name="month-forward" class="month_button">&#187;</a>';document.getElementsByName("month-forward")[0].onclick=calendarForward}}function calendarForward(){startDay=1;value--;LoadCalendar();if(value==0)document.getElementById("mback").innerHTML=""}
function dayAlign(){for(i=0;i<document.getElementsByName("monthid").length;i++){var a=document.getElementsByName("monthid")[i].id;document.getElementById(a).onclick=thisDay}}
function evaluateCal(a){var b=a.getElementsByTagName("MONTHYEAR")[0].firstChild.nodeValue,d=a.getElementsByTagName("YEAR")[0].firstChild.nodeValue,f=a.getElementsByTagName("MONTH")[0].firstChild.nodeValue;document.getElementById("monthyear").innerHTML=b;b="";var e=0,j=document.getElementById("cdays");for(i=0;i<a.getElementsByTagName("DAY").length;i++){daysNode=a.getElementsByTagName("DAY")[i];var k=daysNode.firstChild.nodeValue,g=a.getElementsByTagName("MON")[i].firstChild.nodeValue,h,l="cday",m=
"bla";if(g>1){m="monthid";if(g==3){l="cday-mon";e=1}h='<div class="'+l+'"><a href="javascript:void(0)" name="'+m+'" id="but-'+d+"-"+f+"-"+k+'" class="cal_button">'+k+"</a></div>"}if(g<2){if(g==1){l="cday-mon";e=1}h='<div class="'+l+'"><a href="javascript:void(0)" onmouseover="return overlib(\'Sorry, you have no access to this parameter. Please upgrade your account!\');" onmouseout="return nd();"><img src="/images/icons/16-security-lock.png" border="0" height="13" width="13"></a></div>'}b+=h}if(e==
1){a='<div class="cal_footer" style="margin-top:'+(84-16*parseInt(a.getElementsByTagName("DAY").length/7+0.99))+'px"><div class="cal_footer_sym"></div><div class="cal_footer_text">24h-Measurement</div></div>';b+=a}j.innerHTML=b;dayAlign()}function aoeShowError(a){alert(a)}function aoeHasError(a){if(!a)return false;return a.indexOf("ASBERROR:")==0?true:false}function aoeGetError(a){return a.replace(/ASBERROR:/,"")}String.prototype.trim=function(){return this.replace(/^\s+/,"").replace(/\s+$/,"")};
