var Cmsbox={version:2,copyright:"(c) Copyright 2007 cmsbox GmbH. All Rights Reserved.",setup:function(){
},crop:function(_1){
_1=$(_1);
var _2=_1.down("img");
var _3=Position.cumulativeOffset(_1);
if(_2){
_1.observe("mousemove",function(_4){
var x=(Event.pointerX(_4)-_3[0])/_1.offsetWidth;
var y=(Event.pointerY(_4)-_3[1])/_1.offsetHeight;
_2.style.left=-1*(_2.offsetWidth-_1.offsetWidth)*x+"px";
_2.style.top=-1*(_2.offsetHeight-_1.offsetHeight)*y+"px";
}.bindAsEventListener(this));
}
},lightbox:function(_7,_8){
_7=$(_7);
_8=$(_8);
var _9=Position.pageBounds(),_a=Position.windowBounds();
_8.style.height=(_9[1]>_a[1]?_9[1]:_a[1])+"px";
_7.style.marginTop=Position.windowOffset()[1]+"px";
$$("#desk input","#desk select","#desk textarea").each(function(_b){
if(Prototype.Browser.IE){
_b.style.visibility="hidden";
}
_b.disabled="true";
});
_7.style.display=_8.style.display="block";
},lightboxCloseHandler:function(_c,_d){
document.onkeyup=function(_e){
if(_e.keyCode==Event.KEY_ESC){
window.location=_c;
}
}.bindAsEventListener(this);
$(_d).onclick=function(){
window.location=_c;
};
},decode:function(_f){
var i=0;
var _11="";
var _12,_13,_14;
var _15,_16,_17,_18;
var _19="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
_f=_f.replace(/[^A-Za-z0-9\+\/\=]/g,"");
do{
_15=_19.indexOf(_f.charAt(i++));
_16=_19.indexOf(_f.charAt(i++));
_17=_19.indexOf(_f.charAt(i++));
_18=_19.indexOf(_f.charAt(i++));
_12=(_15<<2)|(_16>>4);
_13=((_16&15)<<4)|(_17>>2);
_14=((_17&3)<<6)|_18;
_11+=String.fromCharCode(_12);
if(_17!=64){
_11+=String.fromCharCode(_13);
}
if(_18!=64){
_11+=String.fromCharCode(_14);
}
}while(i<_f.length);
return _11;
},navigation:function(_1a){
_1a=$(_1a);
if(_1a){
_1a.observe("mouseover",function(_1b){
_1a.childElements().select(function(_1c){
return _1c.hasClassName("navi");
}).each(function(_1d){
_1d.addClassName("hover");
_1d.setStyle({display:"block"});
});
}.bindAsEventListener(this));
_1a.observe("mouseout",function(_1e){
_1a.childElements().select(function(_1f){
return _1f.hasClassName("navi");
}).each(function(_20){
marked=_20.childElements().detect(function(_21){
return _21.hasClassName("mark");
});
if(!marked){
_20.removeClassName("hover");
_20.setStyle({display:"none"});
}
});
}.bindAsEventListener(this));
return true;
}
return false;
},menu:function(_22){
if(Prototype.Browser.IE){
_22=$(_22);
if(_22){
_22.observe("mouseover",function(_23){
_22.childElements().select(function(_24){
return _24.tagName=="dd"|_24.tagName=="DD";
}).each(function(_25){
_25.addClassName("hover");
_25.setStyle({display:"block"});
});
}.bindAsEventListener(this));
_22.observe("mouseout",function(_26){
_22.childElements().select(function(_27){
return _27.tagName=="dd"|_27.tagName=="DD";
}).each(function(_28){
_28.removeClassName("hover");
_28.setStyle({display:"none"});
});
}.bindAsEventListener(this));
return true;
}
return false;
}
return true;
},decode_utf8:function(_29){
var _2a="";
var i=0;
var c=c1=c2=0;
while(i<_29.length){
c=_29.charCodeAt(i);
if(c<128){
_2a+=String.fromCharCode(c);
i++;
}else{
if((c>191)&&(c<224)){
c2=_29.charCodeAt(i+1);
_2a+=String.fromCharCode(((c&31)<<6)|(c2&63));
i+=2;
}else{
c2=_29.charCodeAt(i+1);
c3=_29.charCodeAt(i+2);
_2a+=String.fromCharCode(((c&15)<<12)|((c2&63)<<6)|(c3&63));
i+=3;
}
}
}
return _2a;
},encode_utf8:function(_2d){
_2d=_2d.replace(/\r\n/g,"\n");
var _2e="";
for(var n=0;n<_2d.length;n++){
var c=_2d.charCodeAt(n);
if(c<128){
_2e+=String.fromCharCode(c);
}else{
if((c>127)&&(c<2048)){
_2e+=String.fromCharCode((c>>6)|192);
_2e+=String.fromCharCode((c&63)|128);
}else{
_2e+=String.fromCharCode((c>>12)|224);
_2e+=String.fromCharCode(((c>>6)&63)|128);
_2e+=String.fromCharCode((c&63)|128);
}
}
}
return _2e;
}};
Position.windowBounds=function(){
var x=window.innerWidth||self.innerWidth||document.documentElement.clientWidth||document.body.clientWidth||0;
var y=window.innerHeight||self.innerHeigth||document.documentElement.clientHeight||document.body.clientHeight||0;
return [x,y];
};
Position.windowOffset=function(){
var x=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;
var y=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;
return [x,y];
};
Position.pageBounds=function(){
var x=document.body.scrollWidth||0;
var y=(window.innerHeight&&window.scrollMaxY?window.innerHeight+window.scrollMaxY:document.body.scrollHeight)||0;
return [x,y];
};
Object.extend(Element.Methods,{getPosition:function(_37){
var pos={x:0,y:0};
var obj=_37;
do{
pos.x+=obj.offsetLeft;
pos.y+=obj.offsetTop;
}while(obj=obj.offsetParent);
return Object.toJSON(pos);
}});
Object.extend(Event,{isRightClick:function(_3a){
return (((_3a.which)&&(_3a.which==3))||((_3a.button)&&(_3a.button==2)));
},isMiddleClick:function(_3b){
return (((_3b.which)&&(_3b.which==4))||((_3b.button)&&(_3b.button==1)));
}});
Element.Methods.setStyle=function(_3c,_3d,_3e){
_3c=$(_3c);
var _3f=_3c.style;
for(var _40 in _3d){
if(_40=="opacity"){
_3c.setOpacity(_3d[_40]);
}else{
_3f[(_40=="float"||_40=="cssFloat")?(_3f.styleFloat===undefined?"cssFloat":"styleFloat"):(_3e?_40:_40.camelize())]=_3d[_40];
}
}
return _3c;
};


