if(!window.aoe){
if(typeof String.prototype.trim !== 'function') {
    String.prototype.trim = function() {
        return this.replace(/^\s+|\s+$/g, '');
    }
}
window.aoe={};
aoe.util={};
aoe.util.Delay = function(dom,_doStep,_duration,_factor){
    var doStep=_doStep;
    var timeOutId=null;
    var duration=_duration;
    var factor=_factor;
    var domObj=dom;
    var count=0;
    var parts=duration/200;
    aoe.util.setIntance(domObj,this);
    this.abbord=function(){
       if(timeOutId){
              window.clearTimeout(timeOutId);
              timeOutId=null;
       }
    };
    this.step=function(){
       if(timeOutId){
           timeOutId=null;
           if(doStep(this)){
               count++;
               call();
           }else{
               this.abbord();
           }
       }
    };
    this.getStep=function(){return count;};
    this.getDomObj=function(){return domObj;};
    var call=function(){
       var t=0;
       if(count>0){
           var perc=count/parts;
           t=400-(400*perc);
           t=50;
       }
       timeOutId=window.setTimeout(function(){
           aoe.util.getInstance(domObj).step();
        },t);
    };
    call();
};
aoe.util.checkMail=function(mail){
  mail=decodeURIComponent(mail);
  return (/^[-a-z0-9~!$%^&*_=+}{\'?]+(\.[-a-z0-9~!$%^&*_=+}{\'?]+)*@([a-z0-9_][-a-z0-9_]*(\.[-a-z0-9_]+)*\.([a-z][a-z]+)|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(:[0-9]{1,5})?$/i).test(mail);
}
aoe.util.getID=function(id){
    return document.getElementById(id);
};
aoe.util.removeDomain=function(uri){
    uri=uri.replace(/http(s?):\/\//,"");
    uri=uri.replace(document.location.host,"");
    return uri;
};
aoe.util.getF=function(){
    return document.forms[0];
};
aoe.util.getFE=function(el){
    return aoe.util.getF().elements[el];
};
aoe.util.cE=function(name){
    return document.createElement(name);
};
aoe.util.getTN=function(tn,p,i){
    var els=null;
    p = p || document;
    if(!document.getElementsByTagName){
        els=p.all.tags(tn);
    }else {
        els=p.getElementsByTagName(tn);
    }
    if(!els){
        return new Array();
    }
    if((i && i>0) || i===0){
        return els[i];
    }
    return els;
};
aoe.util.getCN=function(el,i){
    if(!i)i=0;
    return document.getElementsByClassName(el)[i];
};
aoe.util.Instance=function(el,xobj){
    this.xelement=el;
    this.obj=xobj;
};
aoe.util.AoeInstance=function(el){
    this.xelement=el;
    el._aoe=this;
};
aoe.util.setIntance=function(el,obj){
    if(typeof el._aoe=='undefined'){
        new aoe.util.AoeInstance(el);
    }
    el._aoe.instance=new aoe.util.Instance(el, obj);
};
aoe.util.getInstance=function(el){
    return el._aoe.instance.obj;
};
aoe.util.getMousePos=function(ev){
    var pos={
        x:null,
        y:null
    };
    if(!ev){ev=window.event;}
    pos.x=ev.clientX;
    pos.y=ev.clientY;
    return pos;
};
aoe.util.getPos=function(el){
    var pos={
        x:null,
        y:null,
        w:null,
        h:null
    };
    if(el){
        pos.x=el.offsetLeft;
        pos.y=el.offsetTop;
        pos.w=el.offsetWidth;
        pos.h=el.offsetHeight;
    }
    return pos;
};
aoe.util.debug=function(msg){
    if(console && typeof(console.log)=="function")console.log(msg);
};
aoe.util.parseString=function(str){
    var params=new Object();
    var pparts=str.split("&");
    for(var jj=0;jj<pparts.length;jj++){
        var varval=pparts[jj].split("=");
        if(varval[0]&&varval[1]){
            params[varval[0]]=varval[1].replace(/%1/g,"&").replace(/%2/g,"=");
        }
    }
    return params;
};
aoe.util.toString=function(obj){
    var str="";
    for(var k in obj){
        obj[k]=''+obj[k];
        str+=k+"="+obj[k].replace(/&/g,"%1").replace(/=/g, "%2")+"&";
    }
    return str.substr(0,str.length-1);
}
aoe.util.decodeUtf8=function(txt){
    var str = "";
    var i = 0;
    var c = c1 = c2 = 0;
    var cc=txt.length;
    while ( i <  cc) {
        c = txt.charCodeAt(i);
        if (c < 128) {
            str += String.fromCharCode(c);
            i++;
        }else if((c > 191) && (c < 224)) {
            c2 = txt.charCodeAt(i+1);
            str += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
            i += 2;
        }else {
            c2 = txt.charCodeAt(i+1);
            c3 = txt.charCodeAt(i+2);
            str += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
            i += 3;
        }
    }
    return str;
};
aoe.util.encodeUtf8=function(str){
    str = str.replace(/\r\n/g,"\n");
    var txt = "";
    var cc=str.length;
    for (var n = 0; n < cc; n++) {
        var c = str.charCodeAt(n);
        if (c < 128) {
            txt += String.fromCharCode(c);
        }else if((c > 127) && (c < 2048)) {
            txt += String.fromCharCode((c >> 6) | 192);
            txt += String.fromCharCode((c & 63) | 128);
        }else {
            txt += String.fromCharCode((c >> 12) | 224);
            txt += String.fromCharCode(((c >> 6) & 63) | 128);
            txt += String.fromCharCode((c & 63) | 128);
        }
    }
    return txt;
};
aoe.util.Base64={};
aoe.util.Base64.encode=function(str){
    if(window.btoa){
        return btoa(str);
    }else {
        var keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
        var out = "";
        var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
        var i = 0;
        var c=str.length;
        while (i < c) {
            chr1 = str.charCodeAt(i++);
            chr2 = str.charCodeAt(i++);
            chr3 = str.charCodeAt(i++);
            enc1 = chr1 >> 2;
            enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
            enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
            enc4 = chr3 & 63;
            if (isNaN(chr2)) {
                enc3 = enc4 = 64;
            } else if (isNaN(chr3)) {
                enc4 = 64;
            }
            out = out +
            keyStr.charAt(enc1) + keyStr.charAt(enc2) +
            keyStr.charAt(enc3) + keyStr.charAt(enc4);
        }
        return out;
    }
};
aoe.util.Base64.decode=function(bin){
    if(window.atob){
        return atob(bin);
    }else {
        var keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
        var out = "";
        var chr1, chr2, chr3;
        var enc1, enc2, enc3, enc4;
        var i = 0;
        bin = bin.replace(/[^A-Za-z0-9\+\/\=]/g, "");
        var c=bin.length;
        while (i < c) {
            enc1 = keyStr.indexOf(bin.charAt(i++));
            enc2 = keyStr.indexOf(bin.charAt(i++));
            enc3 = keyStr.indexOf(bin.charAt(i++));
            enc4 = keyStr.indexOf(bin.charAt(i++));
            chr1 = (enc1 << 2) | (enc2 >> 4);
            chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
            chr3 = ((enc3 & 3) << 6) | enc4;
            out = out + String.fromCharCode(chr1);
            if (enc3 != 64) {
                out = out + String.fromCharCode(chr2);
            }
            if (enc4 != 64) {
                out = out + String.fromCharCode(chr3);
            }
        }
        return out;
    }
};
aoe.util.Facebook={};
aoe.util.Facebook.initialized=false;
aoe.util.Facebook.loading=false;
aoe.util.Facebook.error=false;
aoe.util.Facebook.onloadEvents=new Array();
aoe.util.Facebook.init=function(){
    if(!aoe.util.Facebook.isInitialized() && (true||aoe.core.browser.isIE(6,">"))){
        aoe.util.Facebook.loading=true;
        aoe.util.Facebook.initialized=true;
        aoe.core.browser.addJs('http://connect.facebook.net/de_DE/all.js'+((aoe.core.browser.isIE(7,">"))?'':'#xfbml=1'),null,function(){
            aoe.util.Facebook.loading=false;
            if(typeof FB != 'undefined' && FB){
                FB.init({
                    status:true,
                    xfbml: true
                });
                if(aoe.util.Facebook.onloadEvents.length>0){
                    for(var i=0;i<aoe.util.Facebook.onloadEvents.length;i++){
                        aoe.util.Facebook.onloadEvents[i]();
                    }
                    aoe.util.Facebook.onloadEvents=new Array();
                }
            }else {
                aoe.util.Facebook.error=true;
            }
        });
    }
};
aoe.util.Facebook.hasError=function(){
    return aoe.util.Facebook.error;
};
aoe.util.Facebook.isInitialized=function(){
    return aoe.util.Facebook.initialized;
};
aoe.util.Facebook.parse=function(parent){
    if(aoe.util.Facebook.isInitialized() && !aoe.util.Facebook.hasError()){
        FB.XFBML.parse(parent);
    }
};
aoe.util.Facebook.createLikeButton=function(el,params){
    if(aoe.util.Facebook.isInitialized() && !aoe.util.Facebook.hasError()){
        var l=document.createElement('fb:like');
        for(k in params){
            l.setAttribute(k,params[k]);
        }
        el.appendChild(l);
        if(aoe.util.Facebook.loading){
            aoe.util.Facebook.onloadEvents.push(function(){
                aoe.util.Facebook.parse(el);
            });
        }else{
            aoe.util.Facebook.parse(el);
        }
    }
};
aoe.util.Twitter={};
aoe.util.Twitter.initialized=false;
aoe.util.Twitter.loading=false;
aoe.util.Twitter.error=false;
aoe.util.Twitter.onloadEvents=new Array();
aoe.util.Twitter.init=function(){
    if(!aoe.util.Twitter.isInitialized()){
        aoe.util.Twitter.loading=true;
        aoe.util.Twitter.initialized=true;
        aoe.core.browser.addJs('http://platform.twitter.com/widgets.js',null,function(){
            aoe.util.Twitter.loading=false;
            if(typeof twttr != 'undefined' && twttr){alert(twttr.TweetBottun);
                if(aoe.util.Twitter.onloadEvents.length>0){
                    for(var i=0;i<aoe.util.Twitter.onloadEvents.length;i++){
                        aoe.util.Twitter.onloadEvents[i]();
                    }
                    aoe.util.Twitter.onloadEvents=new Array();
                }
            }else {
                aoe.util.Twitter.error=true;
            }
        });
    }else if(!aoe.util.Twitter.isInitialized()){
        aoe.util.Twitter.initialized=true;
        aoe.util.Twitter.error=true;
    }
};
aoe.util.Twitter.hasError=function(){
    return aoe.util.Twitter.error;
};
aoe.util.Twitter.isInitialized=function(){
    return aoe.util.Twitter.initialized;
};
aoe.util.Twitter.parse=function(parent){
    if(aoe.util.Twitter.isInitialized() && !aoe.util.Twitter.hasError()){
        var els;
        if(parent && parent.getElementsByClassName){
            els=parent.getElementsByClassName("twitter-share-button");
        }else if(parent){
            els=new Array();
            var all=parent.getElementsByTagName("a");
            for(var j=0;j<all.length;j++){
                if(all[j] && all[j].href && all[j].className && all[j].className.match("twitter-share-button")){
                    els.push(all[j]);
                }
            }
        }else {
            if(document.getElementsByClassName){
                els=document.getElementsByClassName("twitter-share-button");
            }else{
                els=new Array();
                var all=document.getElementsByTagName("a");
                for(var j=0;j<all.length;j++){
                    if(all[j] && all[j].href && all[j].className && all[j].className.match("twitter-share-button")){
                        els.push(all[j]);
                    }
                }
            }
        }
        if(els.length>0){
            for(var i=0;i<els.length;i++){
                var tw=new twttr.TweetButton(els[i]);
                tw.render();
            }
        }
    }
};
aoe.util.Twitter.createTweetButton=function(el,params){
    if(aoe.util.Twitter.isInitialized() && !aoe.util.Twitter.hasError()){
        var l=document.createElement('a');
        l.href="http://twitter.com/share";
        l.className="twitter-share-button";
        for(k in params){
            l.setAttribute(params[k][0],params[k][1]);
        }
        el.appendChild(l);
        if(aoe.util.Twitter.loading){
            aoe.util.Twitter.onloadEvents.push(function(){
                aoe.util.Twitter.parse(el);
            });
        }else{
            aoe.util.Twitter.parse(el);
        }
    }
};
aoe.util.GooglePlus={};
aoe.util.GooglePlus.initialized=false;
aoe.util.GooglePlus.loading=false;
aoe.util.GooglePlus.error=false;
aoe.util.GooglePlus.onloadEvents=new Array();
aoe.util.GooglePlus.init=function(){
    if(!aoe.util.GooglePlus.isInitialized()){
        aoe.util.GooglePlus.loading=true;
        aoe.util.GooglePlus.initialized=true;
        aoe.core.browser.addJs('http://apis.google.com/js/plusone.js',null,function(){
            aoe.util.GooglePlus.loading=false;alert("as");
            if(typeof gapi != 'undefined' && gapi){
                if(aoe.util.GooglePlus.onloadEvents.length>0){
                    for(var i=0;i<aoe.util.GooglePlus.onloadEvents.length;i++){
                        aoe.util.GooglePlus.onloadEvents[i]();
                    }
                    aoe.util.GooglePlus.onloadEvents=new Array();
                }
            }else {
                aoe.util.GooglePlus.error=true;
            }
        },"{\"parsetags\": \"explicit\",\"lang\": \"de\"}");
    }else if(!aoe.util.GooglePlus.isInitialized()){
        aoe.util.GooglePlus.initialized=true;
        aoe.util.GooglePlus.error=true;
    }
};
aoe.util.GooglePlus.hasError=function(){
    return aoe.util.GooglePlus.error;
};
aoe.util.GooglePlus.isInitialized=function(){
    return aoe.util.GooglePlus.initialized;
};
aoe.util.GooglePlus.parse=function(parent){
    if(aoe.util.GooglePlus.isInitialized() && !aoe.util.GooglePlus.hasError()){
        //gapi.plusone.go(parent);
    }
};
aoe.util.GooglePlus.createPlusOneButton=function(el,params){
    alert(el);
    if(aoe.util.GooglePlus.isInitialized() && !aoe.util.GooglePlus.hasError()){
        var l=document.createElement('g:plusone');
        l.className="g-plusone";
        for(k in params){
            l.setAttribute(params[k][0],params[k][1]);
        }
        el.appendChild(l);
        if(aoe.util.GooglePlus.loading){
            aoe.util.GooglePlus.onloadEvents.push(function(){
                aoe.util.GooglePlus.parse(el);
            });
        }else{
            aoe.util.GooglePlus.parse(el);
        }
    }
};
aoe.util.createDialog=function(content,title,onclick,options){
    if(options==null){
        options={};
    }
    var d=aoe.util.cE("div");
    var id=Math.floor(Math.random() * (9999 - 1000 + 1)) + 1000+"_"+((new Date()).getTime());
    d.id=id;
    d.style.zIndex=64555;
    d.style.position="absolute";
    d.style.top="0";
    d.style.left="0";
    d.style.width="100%";
    d.style.height="100%";
    d.style.textAlign="center";
    d.style.verticalAlign="midle";
    d.style.backgroundImage="url(\"/icon/transp_highlight_grey.png\")";
    d.style.backgroundRepeat="repeat";

    var d2=aoe.util.cE("div");
    d2.style.width="400px";
    d2.style.height="300px";
    d2.style.backgroundColor="grey";
    d2.style.margin="auto";
    d2.style.textAlign="left";
    d2.style.verticalAlign="top";
    d2.style.border="2px solid red";
    var t=aoe.util.cE("div");
    t.innerHTML="<b style=\"color:red\">"+title+"</b>";
    d2.appendChild(t);
    d2.appendChild(content);
    var btns=aoe.util.cE("div");
    btns.innerHTML="<input type=\"submit\" onclick=\""+onclick+";var d=aoe.util.getID('"+id+"');d.parentNode.removeChild(d);return false;\" name=\"aoe:desktop:dialog:ok\" value=\"OK\" /><input type=\"submit\" onclick=\"var d=aoe.util.getID('"+id+"');d.parentNode.removeChild(d);\" name=\"aoe:desktop:dialog:cancel\" value=\"Abbrechen\" />";
    d2.appendChild(btns);
    d.appendChild(d2);
    aoe.util.getID("aoe_root").appendChild(d);
}
aoe.core={};
aoe.core.browser={
    INTERNET_EXPLORER:1,
    FIREFOX:2,
    SAFARI:3,
    CHROME:4,
    OPERA:5,
    UNKNOWN:0,
    type:0,
    varsion:0,
    initialiazed:false,
    refreshParams:new Object(),
    refreshFunctions:new Array(new Object(),new Object(),new Object()),
    uriRefresht:false,
    locationHashListener:null
};
aoe.core.browser.init=function(){
    if(!aoe.core.browser.initialiazed){
        aoe.core.browser.initialiazed=true;
        //        if((function x(){})[-5]=='x'){
        //            aoe.core.browser.type=aoe.core.browser.FIREFOX;
        //            aoe.core.browser.version=3;
        //        }else if((function x(){})[-6]=='x'){
        //            aoe.core.browser.type=aoe.core.browser.FIREFOX;
        //            aoe.core.browser.version=2;
        //        }else if(/a/[-1]=='a'){
        //            aoe.core.browser.type=aoe.core.browser.FIREFOX;
        //        }else if('\v'=='v'){
        //            aoe.core.browser.type=aoe.core.browser.INTERNET_EXPLORER;
        //        }else if(/a/.__proto__=='//'){
        //            aoe.core.browser.type=aoe.core.browser.SAFARI;
        //        }else if(/source/.test((/a/.toString+''))){
        //            aoe.core.browser.type=aoe.core.browser.CHROME;
        //        }else if(/^function \(/.test([].sort)){
        //            aoe.core.browser.type=aoe.core.browser.OPERA;
        //        }
        //        alert(aoe.core.browser.type);
        var browsers=[
            {
                check: function(){
                    if(/MSI/.test(navigator.userAgent)){
                        this.version=parseFloat(navigator.userAgent.match(/MSIE (\d+(?:\.\d+)+(?:b\d*)?)/)[1]);
                        return true;
                    }
                    return false;
                },
                type:aoe.core.browser.INTERNET_EXPLORER,
                version:0
            }
        ];
        var i=0;
        while(browsers[i] && !browsers[i].check()){
            i++;
        }
        if(i<browsers.length){
            aoe.core.browser.type=browsers[i].type;
            aoe.core.browser.version=browsers[i].version;
        }
        var listener= function(){
            var dname=window.location.hostname;
            var prot=window.location.protocol;
            var port=window.location.port;
            var path=window.location.pathname;
            var query=window.location.search;
            var hash=window.location.hash;
            var timer=null;
            this.changed=false;
            this.change=function(h){
                hash=h;
                this.changed=true;
            }
            this.cancel=false;
            var tick=function(){
              if(hash!=window.location.hash && !aoe.core.browser.locationHashListener.changed && !aoe.core.browser.locationHashListener.cancel
              && dname==window.location.hostname
              && prot==window.location.protocol
              && port==window.location.port
              && path==window.location.pathname
              && query==window.location.search){
                if(hash.indexOf("#!")>-1||hash.indexOf("#~_q")>-1){
                    aoe.core.browser.doRefreshUri();
                }
              }
              hash=window.location.hash;
              if(!aoe.core.browser.locationHashListener.cancel){
                timer=window.setTimeout(tick, 100);
              }
            };
            timer=window.setTimeout(tick, 500);
        };
        aoe.core.browser.locationHashListener=new listener();
    }
};
aoe.core.browser.REFRESH_PRIORITY_HIGH=1;
aoe.core.browser.REFRESH_PRIORITY_NORMAL=2;
aoe.core.browser.REFRESH_PRIORITY_LOW=3;
aoe.core.browser.registerRefreshFunction=function(id,func,prio){
    if(!prio||prio<1||prio>2){
        prio=aoe.core.browser.REFRESH_PRIORITY_NORMAL;
    }
    aoe.core.browser.refreshFunctions[prio][id]=func;
};
aoe.core.browser.setRefreshParam=function(id,params,loose){
    if(!aoe.core.browser.refreshParams[id]||loose){
        aoe.core.browser.refreshParams[id]=params;
    }else {
        for(var k in params){
            aoe.core.browser.refreshParams[id][k]=params[k];
        }
    }
    aoe.core.browser.updateRefreshUri();
};
aoe.core.browser.updateRefreshUri=function(){
    var q="";
    for(var i=1;i<4;i++){
        for(var refid in aoe.core.browser.refreshFunctions[i]){
            if(aoe.core.browser.refreshParams[refid]){
                q+=refid+"~"+aoe.util.toString(aoe.core.browser.refreshParams[refid])+"|";
            }
        }
    }
    if(q!=""){
        q+="lang="+aoe.util.getFE('aoe:lang').value;
        q=aoe.util.Base64.encode(q);
        var ql=q.length;
        var pl=Math.ceil(ql/4);
        var q1=q.substr(0,pl);
        var q2=q.substr(pl,pl);
        var q3=q.substr(2*pl,pl);
        var q4=q.substr(3*pl,pl);
        q=aoe.util.Base64.encode(q1)+"_"+aoe.util.Base64.encode(q2)+"_"+aoe.util.Base64.encode(q3)+"_"+aoe.util.Base64.encode(q4);
        q=(q.replace(/\//g,"/z")).replace(/=/g,"/x").replace(/\+/g,"/a");
        q="~q_"+q;
        var arr=document.location.href.split("#");
        aoe.core.browser.locationHashListener.change("#"+q);
        document.location.href=arr[0]+"#"+q;
    }
};
aoe.core.browser.setAnchorUri=function(uri){
    var arr=document.location.href.split("#");
    var q="";
    if(arr[1]){
        if(arr[1].indexOf("~q_")>-1){
            q="~q_"+arr[1].substr(arr[1].indexOf("~q_")+3);
        }
    }
    if(!uri){
        uri="";
    }
    if(uri.indexOf("/")==0){
        uri=uri.substring(1);
    }
    aoe.core.browser.locationHashListener.change("#!"+uri+q);
    document.location.href=arr[0]+"#!"+uri+q;

};
aoe.core.browser.doRefreshUri=function(){
    var params;
    var arr=document.location.href.split("#");
    var uri=null;
    var refresh=true;
    if(arr[1] && arr[1].indexOf("~~")==0){
        arr[1]=arr[1].substr(2);
        document.location.href=arr[0]+"#"+arr[1];
        refresh=false;
    }
    if(arr[1]&&arr[1].indexOf("!")===0){
        var posq=arr[1].indexOf("~q_");
        if(posq>-1){
            uri=arr[1].substr(1,posq);
            arr[1]=arr[1].substr(posq);
        }else {
            uri=arr[1].substr(1);
            arr[1]=false;
        }
    }
    var done=new Object();
    if(arr[1] && arr[1].indexOf("~q_")===0){
        var q=arr[1].substr(3);
        if(q!=""){
            q=(q.replace(/\/a/g,"+").replace(/\/x/g,String.fromCharCode(61))).replace(/\/z/g,"/");
            var qarr=q.split("_");
            q="";
            for(var ii=0;ii<4;ii++)q+=aoe.util.Base64.decode(qarr[ii]);
            q=aoe.util.Base64.decode(q);
            params=new Object();
            var funcs=q.split("|");
            for(var j=0;j<funcs.length;j++){
                arr=funcs[j].split("~");
                if(arr[0]&&arr[1]){
                    params[arr[0]]=aoe.util.parseString(arr[1]);
                }
            }
            for(var i=1;i<4;i++){
                for(var refid in aoe.core.browser.refreshFunctions[i]){
                    if(params[refid]){
                        done[refid]=1;
                        aoe.core.browser.refreshFunctions[i][refid](uri,params[refid],refresh);
                    }
                }
            }
        }
    }
    if(uri){
        for(var i=1;i<4;i++){
            for(var refid in aoe.core.browser.refreshFunctions[i]){
                if(!done[refid]){
                    aoe.core.browser.refreshFunctions[i][refid](uri,(params && params[refid])?params[refid]:null,refresh);
                }
            }
        }
    }
};
aoe.core.browser.isIE=function(version,op){
    if(aoe.core.browser.type==aoe.core.browser.INTERNET_EXPLORER){
        if(!version){
            return true;
        }
        if(!op){
            op='=';
        }
        if(op=="="){
            return aoe.core.browser.version==version;
        }else if(op=="<"){
            return aoe.core.browser.version<version;
        }else if(op=="<="){
            return aoe.core.browser.version<=version;
        }else if(op==">"){
            return aoe.core.browser.version>version;
        }else if(op==">="){
            return aoe.core.browser.version>=version;
        }else if(op=="><"||op=="!="){
            return aoe.core.browser.version!=version;
        }
    }
    return false;
};
aoe.core.browser.isFF=function(){
    return aoe.core.browser.type==aoe.core.browser.FIREFOX;
};
aoe.core.browser.isUnknown=function(){
    return aoe.core.browser.type==aoe.core.browser.UNKNOWN;
};
aoe.core.browser.addJs=function(src,script,onload,addscript){
    if((src && src.length>0) || (script && script.length > 0)){
        var exists=false;
        var scripts=document.getElementsByTagName('head')[0].getElementsByTagName("script");
        if(src && src!=null){
            for(var i=0;i<scripts.length;i++){
                if((src && scripts[i].src==src)){
                    exists=true;
                }
            }
        }
        if(!exists){
            var s=document.createElement('script');
            if(onload){
                if(s.addEventListener){
                    s.addEventListener('load',onload,false);
                }else {
                    s.onreadystatechange=function(){
                        if(this.readyState == "loaded" ||this.readyState=='complete'){
                            onload();
                        }
                    };
                }
            }
            if(navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1){
                s.language="JavaScript";
                if(src){
                    s.src=src;
                }
                else{
                    s.text=script;
                }
            }else {
                s.type="text/javascript";
                if(src)s.src=src;
                else{
                    var st=document.createTextNode(script);
                    s.appendChild(st);
                }
            }
            s.async=true;
            if(addscript){
                if(navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1){
                 s.text=addscript;
                }else {
                    var stx=document.createTextNode(addscript);
                    s.appendChild(stx);
                }
            }
            document.getElementsByTagName('head')[0].appendChild(s);
        }
    }
};
aoe.core.browser.setRssLink=function(location,title){
    var l=null;
    var els=document.getElementsByTagName('head')[0].getElementsByTagName('link');
    for(var i=0;i<els.length;i++){
        if(els[i].type==""){
            l=els[i];
            break;
        }
    }
    if(l===null){
        l=aoe.util.cE('link')
        l.rel="alternate";
        l.type="application/rss+xml";
    }
    l.href=location;
    l.title=title;
    document.getElementsByTagName('head')[0].appendChild(l);
};
aoe.core.browser.deleteRssLink=function(){
    var l=null;
    var els=document.getElementsByTagName('head')[0].getElementsByTagName('link');
    for(var i=0;i<els.length;i++){
        if(els[i].type=="application/rss+xml"){
            l=els[i];
            break;
        }
    }
    if(l!==null){
        document.getElementsByTagName('head')[0].removeChild(l);
    }
};
aoe.core.browser.getFeed=function(uri){
    window.open(uri,uri);
    return;
    var ifr=aoe.util.cE('iframe');
    ifr.src=uri;
    ifr.onload=function(){
        //ifr.documentElement.getElementById("subscribeButton").click();
        console.dir(this);
    };
    aoe.util.getID("aoe_root").appendChild(ifr);
};
aoe.core.browser.setCookie=function(name, val, exp, path, domain, https){
    document.cookie = escape(name) + "=" +escape( val ) +
    ( ( exp ) ? ";expires=" + exp.toGMTString() : "" ) +
    ( ( path ) ? ";path=" + path : "" ) +
    ( ( domain ) ? ";domain=" + domain : "" ) +
    ( ( https ) ? ";secure" : "" );
};
aoe.core.browser.getCookie=function(name){
    var pos;
    name=escape(name);
    if(-1 < (pos = document.cookie.indexOf(name+"=")) ){
        pos+=name.length+1;
        var pos2;
        if(-1 == (pos2=document.cookie.indexOf(";",pos))){
            pos2=document.cookie.length;
        }
        return unescape(document.cookie.substring(pos,pos2));
    }
    return null;
};
aoe.desktop={};
aoe.Aphrodite=function(){
    var firstload=true;
    var loading_state='stopped';
    var onLoadFunctions=new Array();
    var loadFunctionIndex=0;
    this.registerOnLoad=function(func,wait){
        onLoadFunctions.push({
            "call":func,
            "wait":wait
        });
    };
    this.continueLoading=function(){
        loading_state='continue';
        this.load();
    };
    this.load=function(){
        if(loading_state=='stopped'||loading_state=='continue'){
            loading_state='loading';
            var l=true;
            if(firstload){
                if(!aoe.ad && aoe.core.browser.getCookie("aoe:sid")!==null){
                    var p=document.location.href;
                    p=p.replace(/http(s|):\/\//,"");
                    if(p.indexOf("#")>-1){
                        p=p.substr(0,p.indexOf("#"));
                    }
                    p=p.substr(p.indexOf("/"));
                    if(p && p!="" && p!="/"){
                        if(p.indexOf("/")==0){
                            p=p.substr(1);
                        }
                        l=false;
                        aoe.core.browser.setCookie("aoe_req", p,false,'/');
                        aoe.core.browser.setCookie("js_refresh", 1,false,'/');
                        document.location.href="/#~~!"+p;
                        return;
                    }
                }
                aoe.core.browser.init();
            }
            if(l){
                var len=onLoadFunctions.length;
                for(loadFunctionIndex;loadFunctionIndex<len;loadFunctionIndex++){
                    var func=onLoadFunctions[loadFunctionIndex];
                    if(func.wait){
                        loadFunctionIndex++;
                        loading_state="waiting";
                        func.call();
                        return;
                    }
                    func.call();
                }
                if(firstload){
                    firstload=false;
                    aoe.core.browser.doRefreshUri();
                }
            }
            loading_state="stopped";
            if(loadFunctionIndex<onLoadFunctions.length){
                Aphrodite.load();
            }
            return;
        }
        return;
    };
    this.checkOnLoad=function(){
        if(loadFunctionIndex<onLoadFunctions.length){
            Aphrodite.load();
        }
    };

    var path_master="";
    this.setPathMaster=function(path){
        path_master=path;
    };
    this.getPathMaster=function(){
        return path_master;
    };
    if(document.addEventListener){
        document.addEventListener('DOMContentLoaded',function(){
            Aphrodite.load();
        },false);
    }else {
            document.attachEvent('onreadystatechange',function(){
                if(document.readyState=='complete'){
                    Aphrodite.load();
                }
            });
    }

};
var Aphrodite=new aoe.Aphrodite();
}
