(function(){if(window.DL)return;var DL=function(selector,from){if(DL.type(selector,'element'))return selector;var result,selectors=selector.split(/ /);for(var i=0;i<\/script>");document.getElementById("__ie_onload").onreadystatechange=function(){if(this.readyState=="complete"){_domReady()}};/*@end@*/if(/WebKit/i.test(navigator.userAgent)){_timer=setInterval(function(){if(/loaded|complete/.test(document.readyState))_domReady()},10)}DL.Event.addHandler(window,'load',_domReady);_readyCallbacks=[]}_readyCallbacks.push(f)}})();DL.extend=function(target,source){for(var n in source)target[n]=source[n];return target};DL.extend(DL,{version:'$Revision: 1.36 $',Widget:{},Component:{},Application:{},type:function(variable,equal){var type=typeof variable;if(!DL.defined(variable))type='undefined';if(variable===null)type='null';if(type=='object'&&variable.nodeName){switch(variable.nodeType){case 1:type='element';break;case 3:type=(/\S/.test(variable.nodeValue))?'textnode':'whitespace';break;case 9:type='document';break;case 11:type='fragment';break;default:type=variable.nodeName.replace('#').toLowerCase();break}}else if(type=='object'||type=='function'){switch(variable.constructor){case Date:type='date';break;case Array:type='array';break;case RegExp:type='regexp';break;case Error:type='error';break}if(typeof variable.length=='number'){if(variable.item)type='collection';if(variable.callee)type='arguments';if(variable==window||variable.parent==window||variable.opener==window)type='window'}if(variable===Math)type='math';if(DL.Browser.isIE&&type=='object'){try{variable();type='function'}catch(e){}}}return(arguments.length>1)?DL.Array.contains(arguments,type,1):type},check:function(variable){return(!!variable||variable===0)},defined:function(){for(var i=0;i>4]+DL.Math.hexDigits[dec&15])},hex2dec:function(hex){return(parseInt(hex,16))}};DL.String={fill:function(string){if(arguments.length==2&&DL.type(arguments[1])=='object'){for(var n in arguments[1]){string=string.replace('%'+n+'%',arguments[1][n],'g')}}else if(arguments.length>1){for(var i=1;i=0){DL.Array.remove(array,index)}return array},include:function(array,value){if(!DL.Array.contains(array,value)){array.push(value);return true}return false},merge:function(){var result=[];for(var i=0,l1=arguments.length;i2)to=arguments;for(var i=0;i=against.top&&testing.bottom-tolerance<=against.bottom&&testing.left+tolerance>=against.left&&testing.right-tolerance<=against.right)},overlap:function(testing,against,tolerance){tolerance=tolerance||0;return(testing.top-tolerance<=against.bottom&&testing.bottom+tolerance>=against.top&&testing.left-tolerance<=against.right&&testing.right+tolerance>=against.left)},pointer:function(testing,against,tolerance){tolerance=tolerance||0;against=against||DL.Mouse;return(testing.top-tolerance<=against.y&&testing.bottom+tolerance>=against.y&&testing.left-tolerance<=against.x&&testing.right+tolerance>=against.x)},alignTo:function(element,dimension){var d=DL.Position.getSize(element);for(var i=2,position;(position=arguments[i]);i++){var tmp=position.split(','),value=tmp[0],outer=tmp[1]||0;if(value=='left'){element.style.left=outer?dimension.left-d.width+'px':dimension.left+'px'}else if(value=='top'){element.style.top=outer?dimension.top-d.height+'px':dimension.top+'px'}else if(value=='right'){element.style.left=outer?dimension.right+'px':dimension.right-d.width+'px'}else if(value=='bottom'){element.style.top=outer?dimension.bottom+'px':dimension.bottom-d.bottom+'px'}else if(value=='center'){DL.Element.setStyle(element,'left',dimension.left+((dimension.width-d.width)/2)+'px')}else if(value=='middle'){DL.Element.setStyle(element,'top',dimension.top+((dimension.height-d.height)/2)+'px')}}}};DL.XHR=new DL.Class({initialize:function(options){this.isActive=false;this.xRequest=null;this.response=null;this.headers={};this.options={url:'',mode:'',async:true,params:null,method:'get',headers:{},requestContentType:'application/x-www-form-urlencoded',responseContentType:false,data:null};this.setOptions(options)},send:function(options){var o=this.setOptions(options),url=(o.params)?DL.String.fill(o.url,o.params):o.url,data;if(this.isActive){if(console)console.warn('Request already running!');return}if(options&&o.data){if(typeof o.data=='object'&&o.mode=='json')data='data='+DL.JSON.toString(o.data);else if(DL.type(o.data,'object'))data=DL.Browser.createQuery(o.data);else data=o.data;if(o.method=='get'){url=url+(url.search(/\?/)==-1?'?':'&')+(data||o.data);o.data=null}else o.data=data}this.prepare();this.headers=DL.extend(this.headers,this.options.headers);if(DL.Browser.isIE){url+=(url.search(/\?/)==-1?'?':'&')+'timestamp='+(Math.round(new Date().getTime()/1000))}this.xRequest.open(o.method,url,o.async);for(var type in this.headers){try{this.xRequest.setRequestHeader(type,this.headers[type])}catch(e){this.onerror('Error while setting-up requestHeader',type,this.headers[type],e.message)}}this.xRequest.send(o.data||null);this.isActive=true;this.onrequest();return this},abort:function(){if(!this.isActive)return this;this.isActive=false;this.xRequest.abort();if(typeof this.xRequest.onprogress=='function')this.xRequest.onprogress=null;this.xRequest.onreadystatechange=null;this.onabort();return this},prepare:function(){var self=this;this.xRequest=DL.attempt(function(){return new XMLHttpRequest()},function(){return new ActiveXObject('Microsoft.XMLHTTP')},function(){return ActiveXObject('Msxml2.XMLHTTP')});this.xRequest.onreadystatechange=function(){self.proceed()};if(typeof this.xRequest.onprogress!='undefined'){this.xRequest.onprogress=function(e){var percent=Math.round((e.position/e.totalSize)*100);self.onproceed(percent,this.readyState)}}if((this.options.method=='post')){this.headers['Content-Type']=this.options.requestContentType}else{delete this.headers['ContentType'];delete this.headers['Connection']}return this},proceed:function(){try{if(this.xRequest.readyState==4){if(this.xRequest.status!=200)throw new Error('Wrong HTTP-Response Status Code, can\'t continue!');if(this.options.responseContentType&&this.xRequest.getResponseHeader('Content-Type')!=this.options.responseContentType){var msg='Wrong HTTP-Response Content-Type "%", await "%".'.replace('%',this.xRequest.getResponseHeader('Content-Type')).replace('%',this.options.responseContentType);if(console)console.error(msg);throw new Error(msg);}this.response={text:this.xRequest.responseText,xml:this.xRequest.responseXML};switch(this.options.mode){case'json':this.response.result=DL.JSON.toObject(this.response.text);break;default:this.response.result=this.response.text;break}this.oncomplete(this.response.result,this.response.text,this.response.xml)}}catch(e){var msg='Critical XHR Error!\n';if(typeof console!='undefined'){console.group('DL.XHR');console.error(msg);console.dir(e);console.group('DL.XHR')}this.onerror(msg)}finally{this.isActive=false}},oncomplete:DL.Class.empty,onrequest:DL.Class.empty,onproceed:DL.Class.empty,onsuccess:DL.Class.empty,onfailure:DL.Class.empty,onerror:DL.Class.empty,onabort:DL.Class.empty});DL.XHR.implement(new DL.Class.Options);DL.JSON={maximumLevel:255,currentLevel:0,toString:function(object){if(this.currentLevel==this.maximumLevel)return'*';this.currentLevel++;var result=[];if(object.constructor==Array||object.length){for(var i=0;idate){var start=new Date(year,0,1);start=new Date(Number(start)+86400000*(8-start.getDay()));if(start.getDate()>4){start.setTime(Number(start)-604800000)}cw=Math.ceil((date.getTime()-start)/604800000)}return cw},isValid:function(date,format){return!!DL.Date.stringToDate.apply(DL.Date,arguments)},stringToDate:function(value,format){if(DL.type(value,'number'))return new Date(value);format=format||'y-m-d';var regexpConvert={y:/\d{4}/,m:/\d{1,2}/,d:/\d{1,2}/,H:/\d{1,2}/,M:/\d{1,2}/,S:/\d{1,2}/},values={};var d=value.split(/\W/),f=format.split(/\W/);if(d.length!=f.length)return null;for(var i=0;i=1&&values.m<=12))||(values.d&&!(values.m&&values.d>=1&&values.d<=DL.Date.getLength(values.m-1,values.y||(new Date).getFullYear())))||(values.y&&!(values.y>=1))||(values.H&&!(values.H>=0&&values.H<24))||(values.M&&!(values.M>=0&&values.M<60))||(values.S&&!(values.S>=0&&values.S<60)))return null;return new Date(values.y||0,values.m-1||0,values.d||0,values.H||0,values.M||0,values.S||0)},stringToObject:function(string,format){format=format||'y-m-d';var result=DL.Array.couple(format.split(/\W/),string.split(/\W/));if(result.m)result.m-=1;return result},dateToString:function(date,format){if(!date)return null;format=format||'y-m-d';date=DL.Date.dateToObject(date,format);return format.replace(/(\w{1,2})/g,function(v){return date[v]})},dateToObject:function(date,format){format=format||'y-m-d';var result={};for(var n in DL.Date.getters){if(format.search(n)!=-1){var value=(date[DL.Date.getters[n]])?date[DL.Date.getters[n]]():this[DL.Date.getters[n]](date);if(n=='m'){value+=1}if(value<10){value='0'+value}result[n]=value}}return result},getMonthName:function(date){var month=DL.type(date,'date')?date.getMonth():date;return DL.Date.language.months[month]},getMonday:function(date){var monday=new Date(date.getTime()),op=+1;if(monday.getDay()>1)op=-1;while(monday.getDay()!=1){monday.setDate(monday.getDate()+op)}return monday},getDayName:function(date){var day=date.getDay();return DL.Date.language.days[day]},getValues:function(date){var result={},fn;for(var i=0,value;value=arguments[i];i++){if((fn=DL.Date.getters[value]))result[value]=date[fn]()}return result},setValues:function(date,object){var fn,keys=DL.Object.keys(object).sort();for(var i=0;ib.width)?document.body.scrollWidth:b.width;h=(document.body.scrollHeight>b.height)?document.body.scrollHeight:b.height}else{w=(window.innerWidth=0){kk=kk+this.saveAs.length+1;var ll=document.cookie.indexOf("};",kk);if(ll<0){ll=document.cookie.length}value=document.cookie.substring(kk,ll+1);value=unescape(value)}}if(!value){this.values={};return true}return((this.values=DL.JSON.toObject(value)))?true:false},set:function(index,value){if(!this.values)this.load();if(DL.check(this.values[index]=value)){this.save();return true}return false},get:function(index){if(!this.values)this.load();if(this.values&&this.values[index]!==undefined)return this.values[index];return(DL.defined(index))?null:this.values},remove:function(index){if(!this.values)this.load();if(this.values[index]!==undefined){delete this.values[index];return true}return false},clear:function(){this.values={};this.save()}};window.DL=DL})();