function basehref(){var base=document.getElementsByTagName("BASE");return base[0].href};function dialog(txt){if(txt===undefined)txt="sicher ?";return window.confirm(txt)};function redirect(url){window.location.href=basehref()+url};function predirect(url,close){window.opener.location.href=basehref()+url;if(close)window.close()};function openw(url){window.open(basehref()+url)};function popup(url,name,w,h,r,s){if(r===undefined)r="no";if(s===undefined)s="yes";var x=(screen.availWidth-w)/2;var y=(screen.availHeight-h)/2;pop=window.open(basehref()+url,name,"left="+x+",top="+y+",width="+w+",height="+h+",resizable="+r+",scrollbars="+s+",status=no,directories=no,toolbar=no,location=no,menubar=no");pop.moveTo(x,y);pop.resizeTo(w,h);pop.focus()};function zero(number){if(number<10)number="0"+number;return number};function round(nb,dec){if(dec===undefined)dec=2;dec=Math.pow(10,dec);return Math.round(nb*dec)/dec};String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")};String.prototype.ltrim=function(){return this.replace(/^\s+/,'')};String.prototype.rtrim=function(){return this.replace(/\s+$/,"")};function htmlEncode(str){return str.replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/"/g,"&quot;")};function htmlDecode(str){return str.replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&quot;/g,"\"").replace(/&amp;/g,"&")};Array.prototype.unique=function(){var a=[];for(var i=0;i<this.length;i++){for(var j=i+1;j<this.length;j++){if(this[i]===this[j]){j=++i}}a.push(this[i])}return a};function encodeRE(str){return str.replace(/([\\\.\+\*\?\[\^\]\$\(\)\{\}\=\!<>\|\:])/g,"\\$1")};(function($){$.extend({preload:function(){for(var i=0;i<arguments.length;i++){$('<img src="'+arguments[i]+'" alt="" />')}}});$.fn.extend({intVal:function(value){if(value===undefined)return parseInt($(this).val());else return $(this).val(parseInt(value))},floatVal:function(value){if(value===undefined)return parseFloat($(this).val());else return $(this).val(parseFloat(value))},check:function(){return this.each(function(){this.checked=true})},uncheck:function(){return this.each(function(){this.checked=false})},enabled:function(){return this.each(function(){this.disabled=false})},disabled:function(){return this.each(function(){this.disabled=true})},autofocus:function(){$(":text:visible:enabled",this).not("[readonly], .emptytext").eq(0).focus();return this}})})(jQuery);
