/***********************************************************/
/* WDF Javascript Library v.1                              */
/* (c) 2007 Pavel Smejkal, Web Design Factory s.r.o.       */
/***********************************************************/
if(typeof WDF=="undefined"){
var WDF={};
}
WDF.info=function(){
console.info("Framework (c) 2007 - Pavel Smejkal, Lukas Hroch, Web Design Factory s.r.o.");
};


/**/

var EventCaller={index:0,args:{},caller:{},call:function(_1,_2,_3){
this.index++;
var _4=Utils.Array.clone(_1.parameters);
var _5="";
var _6;
if(typeof (_4[0])=="object"){
var _6=_4.shift();
var _7=_4.shift();
this.caller[this.index]=_6;
_5="EventCaller.caller[i]."+_7;
}else{
var _8=_4.shift();
this.caller[this.index]=_8;
_5="EventCaller.caller[i]";
}
_4.unshift(_3);
_4.unshift(_2);
this.args[this.index]=_4;
params="";
for(i=0;i<_4.length;i++){
if(i!=0){
params+=",";
}
params+="EventCaller.args[i]["+i+"]";
}
var _9="var i = "+this.index+"; "+_5+"("+params+");delete EventCaller.args[i];delete EventCaller.caller[i];";
eval(_9);
}};
EventDelegate=function(_a){
this.parameters=_a;
};
EventDelegate.prototype.call=function(_b,_c){
EventCaller.call(this,_b,_c);
};
var EventManager={index:0,nodes:{},handlers:{},connect:function(){
var _d=new Array();
for(var i=0;i<arguments.length;i++){
_d.push(arguments[i]);
}
var _f=_d.shift();
var _10=_d.shift();
var _11=new EventDelegate(_d);
if(!_f[_10+"event_index"]){
this.index++;
var _12=this.index;
_f[_10+"event_index"]=_12;
_f[_10]=function(e){
if(!e){
e=window.event;
}
EventManager.fireEvent(_10,this[_10+"event_index"],e);
};
this.nodes[_12]=_f;
}else{
var _12=_f[_10+"event_index"];
}
if(!this.handlers[_12]){
this.handlers[_12]={};
}
if(!this.handlers[_12][_10]){
this.handlers[_12][_10]=[];
}
this.handlers[_12][_10].push(_11);
},hasConnect:function(_14,_15){
return _14[_15+"event_index"]!=undefined;
},fireEvent:function(_16,_17,_18){
var _19=this.nodes[_17];
var _1a=this.handlers[_17][_16];
for(var i=0;i<_1a.length;i++){
_1a[i].call(_18,_19);
}
}};


/**/

var Utils={Array:{clone:function(_1){
return Array.apply(null,_1);
},remove:function(_2,_3,_4,_5){
while(Utils.Array.contains(_2,_3,_5)){
_2.splice(Utils.Array.indexOf(_2,_3,0,_5),1);
if(!_4){
break;
}
}
return _2;
},contains:function(_6,_7,_8){
return Utils.Array.indexOf(_6,_7,0,_8)!==-1;
},indexOf:function(_9,_a,_b,_c){
_b=_b||0;
for(var i=_b;i<_9.length;i++){
var _e=_9[i];
if(_e==_a){
return i;
}
}
return -1;
},count:function(_f,_10,_11){
var pos,_13=0,_14=0;
while((pos=Utils.Array.indexOf(_f,_10,_13,_11))!==-1){
_13=pos+1;
_14++;
}
return _14;
}},call:function(cb){
if(cb){
cb();
}
},String:{isRelativePath:function(_16){
_16=!_16?"":_16;
return (_16.indexOf("/")!=0&&_16.indexOf("http://")!=0);
},isImagePath:function(_17){
var re=new RegExp(".(jpg|jpeg|gif|png)$");
return _17.toLowerCase().match(re);
}},Json:{eval:function(_19){
try{
return eval("("+_19+")");
}
catch(e){
return false;
}
}}};
function $(id){
if(typeof (id)=="string"){
return document.getElementById(id);
}else{
return id;
}
}
var ENV={Browser:{getWidth:function(){
if(self.innerHeight){
x=self.innerWidth;
}else{
if(document.documentElement&&document.documentElement.clientHeight){
x=document.documentElement.clientWidth;
}else{
if(document.body){
x=document.body.clientWidth;
}
}
}
return x;
},getHeight:function(){
if(self.innerHeight){
y=self.innerHeight;
}else{
if(document.documentElement&&document.documentElement.clientHeight){
y=document.documentElement.clientHeight;
}else{
if(document.body){
y=document.body.clientHeight;
}
}
}
return y;
},getLocation:function(){
if(!this.location){
this.location=window.location.href.indexOf("#")!=-1?window.location.href.substring(0,window.location.href.indexOf("#")):window.location.href;
}
return this.location+"";
},location:null}};
var Layout={ItemList:{collections:{},init:function(elm){
elm=$(elm);
var _1c=DOM.getElementsByClassName(elm,"div","item");
for(var i=0;i<_1c.length;i++){
var _1e=_1c[i];
_1e.onmouseover=function(e){
e=!e?window.event:e;
DOM.addClass(this,"over");
e.cancelBubble=true;
if(e.stopPropagation){
e.stopPropagation();
}
};
_1e.onmouseout=function(e){
e=!e?window.event:e;
DOM.remClass(this,"over");
e.cancelBubble=true;
if(e.stopPropagation){
e.stopPropagation();
}
};
_1e.onclick=function(e){
e=!e?window.event:e;
DOM.swapClass(this,"selected");
if(DOM.hasClass(this,"selected")){
Layout.ItemList.getIdElement(this).checked=true;
}else{
Layout.ItemList.getIdElement(this).checked=false;
}
e.cancelBubble=true;
if(e.stopPropagation){
e.stopPropagation();
}
};
}
},getIdElement:function(elm){
var _23=elm.getElementsByTagName("input");
for(var i=0;i<_23.length;i++){
if(_23[i].type=="checkbox"){
return _23[i];
}
}
}}};
var dua=navigator.userAgent;
var dav=navigator.appVersion;
var t=true;
var f=false;
ENV.capable=t;
ENV.support={};
ENV.support.builtin=t;
ENV.opera=dua.indexOf("Opera")>=0;
ENV.khtml=(dav.indexOf("Konqueror")>=0)||(dav.indexOf("Safari")>=0);
ENV.safari=dav.indexOf("Safari")>=0;
var geckoPos=dua.indexOf("Gecko");
ENV.mozilla=ENV.moz=(geckoPos>=0)&&(!ENV.khtml);
if(ENV.mozilla){
ENV.geckoVersion=dua.substring(geckoPos+6,geckoPos+14);
}
ENV.ie=(document.all)&&(!ENV.opera);
ENV.ie50=ENV.ie&&dav.indexOf("MSIE 5.0")>=0;
ENV.ie55=ENV.ie&&dav.indexOf("MSIE 5.5")>=0;
ENV.ie60=ENV.ie&&dav.indexOf("MSIE 6.0")>=0;
ENV.ie70=ENV.ie&&dav.indexOf("MSIE 7.0")>=0;
ENV.console=typeof console!="undefined";
function isAlien(a){
return isObject(a)&&typeof a.constructor!="function";
}
function isArray(a){
return isObject(a)&&a.constructor==Array;
}
function isBoolean(a){
return typeof a=="boolean";
}
function isFunction(a){
return typeof a=="function";
}
function isNull(a){
return typeof a=="object"&&!a;
}
function isNumber(a){
return typeof a=="number"&&isFinite(a);
}
function isObject(a){
return (a&&typeof a=="object")||isFunction(a);
}
function isRegexp(a){
return a&&a.constructor==RegExp;
}
function isString(a){
return typeof a=="string";
}
function isUndefined(a){
return typeof a=="undefined";
}
Number.prototype.NaN0=function(){
return isNaN(this)?0:this;
};


/**/

var DOM={getElementsByClassName:function(_1,_2,_3){
var _4=(_2=="*"&&_1.all)?_1.all:_1.getElementsByTagName(_2);
var _5=new Array();
_3=_3.replace(/\-/g,"\\-");
var _6=new RegExp("(^|\\s)"+_3+"(\\s|$)");
var _7;
for(var i=0;i<_4.length;i++){
_7=_4[i];
if(_6.test(_7.className)){
_5.push(_7);
}
}
return (_5);
},getElementsByClassName:function(_9,_a,_b){
var _c=(_a=="*"&&_9.all)?_9.all:_9.getElementsByTagName(_a);
var _d=new Array();
_b=_b.replace(/\-/g,"\\-");
var _e=new RegExp("(^|\\s)"+_b+"(\\s|$)");
var _f;
for(var i=0;i<_c.length;i++){
_f=_c[i];
if(_e.test(_f.className)){
_d.push(_f);
}
}
return (_d);
},removeNode:function(_11){
var _12=_11.parentNode;
if(_12){
_12.removeChild(_11);
}
return _11;
},replaceNode:function(_13,_14){
return _13.parentNode.replaceChild(_14,_13);
},destroyNode:function(_15){
},prependChild:function(_16,_17){
if(_17.firstChild){
_17.insertBefore(_16,_17.firstChild);
}else{
_17.appendChild(_16);
}
return true;
},insertBefore:function(_18,ref,_1a){
if((_1a!=true)&&(_18===ref||_18.nextSibling===ref)){
return false;
}
var _1b=ref.parentNode;
_1b.insertBefore(_18,ref);
return true;
},insertAfter:function(_1c,ref,_1e){
var pn=ref.parentNode;
if(ref==pn.lastChild){
if((_1e!=true)&&(_1c===ref)){
return false;
}
pn.appendChild(_1c);
}else{
return this.insertBefore(_1c,ref.nextSibling,_1e);
}
return true;
},insertAtPosition:function(_20,ref,_22){
if((!_20)||(!ref)||(!_22)){
return false;
}
switch(_22.toLowerCase()){
case "before":
return this.insertBefore(_20,ref);
case "after":
return this.insertAfter(_20,ref);
case "first":
if(ref.firstChild){
return dojo.dom.insertBefore(_20,ref.firstChild);
}else{
ref.appendChild(_20);
return true;
}
break;
default:
ref.appendChild(_20);
return true;
}
},insertAtIndex:function(_23,_24,_25){
var _26=_24.childNodes;
if(!_26.length||_26.length==_25){
_24.appendChild(_23);
return true;
}
if(_25==0){
return this.prependChild(_23,_24);
}
return this.insertAfter(_23,_26[_25-1]);
},getParentByClass:function(e,_28){
if(!e.parentNode){
return false;
}
if(e.parentNode.className){
ptn=new RegExp("\\b"+_28+"\\b");
if(e.parentNode.className.match(ptn)){
return e.parentNode;
}
}
return this.getParentByClass(e.parentNode,_28);
},getParentByTag:function(e,_2a){
if(!e.parentNode){
return false;
}
if(e.parentNode.tagName){
ptn=new RegExp("\\b"+_2a+"\\b");
if(e.parentNode.tagName.match(ptn)){
return e.parentNode;
}
}
return this.getParentByClass(e.parentNode,_2a);
},getAbsolutePosition:function(e){
var x=0;
var y=0;
var _2e=this.getAncestors(e);
_2e.push(e);
for(var i=0;i<_2e.length;i++){
x+=_2e[i].offsetLeft;
y+=_2e[i].offsetTop;
}
return {"x":x,"y":y};
},getAncestors:function(e){
var _31=[];
this.getAncestors_Worker(e,_31);
return _31;
},getAncestors_Worker:function(e,_33){
var _34=e.parentNode;
if(_34&&_34.tagName!="BODY"){
_33.push(_34);
this.getAncestors_Worker(_34,_33);
}
},hasClass:function(_35,_36){
return Utils.Array.count($(_35).className.split(" "),_36);
},remClass:function(_37,_38,all){
_37=$(_37);
_37.className+="";
_37.className=Utils.Array.remove(_37.className.split(" "),_38,all).join(" ");
},addClass:function(_3a,_3b,_3c){
_3a=$(_3a);
_3a.className+="";
if(!_3c&&Utils.Array.contains(_3a.className.split(" "),_3b)){
return;
}
_3a.className+=(_3a.className.length?" ":"")+_3b;
},swapClass:function(e,c){
if(this.hasClass(e,c)){
this.remClass(e,c);
}else{
this.addClass(e,c);
}
return !!this.hasClass(e,c);
},setOpacity:function(obj,_40){
if(ENV.ie){
if(!obj.style.width||obj.style.width=="0px"){
obj.style.width=obj.offsetWidth+"px";
}
obj.style.filter="alpha(opacity:"+_40+");";
}
obj.style.KHTMLOpacity=_40/100;
obj.style.MozOpacity=_40/100;
obj.style.opacity=_40/100;
}};


/**/

var XMLHTTP_PROGIDS=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"];
var HTTP={getXmlhttpObject:function(){
var _1=null;
var _2=null;
try{
_1=new XMLHttpRequest();
}
catch(e){
}
if(!_1){
for(var i=0;i<3;++i){
var _4=XMLHTTP_PROGIDS[i];
try{
_1=new ActiveXObject(_4);
}
catch(e){
_2=e;
}
if(_1){
XMLHTTP_PROGIDS=[_4];
break;
}
}
}
if(!_1){
console.debug("XMLHTTP not available",_2);
}
return _1;
},getContent:function(_5,_6,_7,_8,_9){
var _a="GET";
var _b=null;
var re=new RegExp("([^?]+)[?]*(.*)");
var _d="";
var _e=re.exec(_6);
if(_e){
_a="POST";
_6=_e[1];
_b="&"+_e[2];
}
var _f=this.getXmlhttpObject();
if(_7){
_f.onreadystatechange=function(){
if(4==_f.readyState){
if((!_f["status"])||((200<=_f.status)&&(300>_f.status))){
if(_5=="text"){
_7(_f.responseText);
}else{
_7(_f.responseXML);
}
}else{
if(_9){
_9();
}
}
}
};
}
_f.open(_a,_6,_7?true:false);
try{
if(_a=="POST"){
_f.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
}
try{
_f.send(_b);
}
catch(e){
}
if(_7){
return null;
}
if((_f["status"])&&((200>_f.status)||(300<=_f.status))){
throw Error("Unable to load "+_6+" status:"+_f.status);
}
}
catch(e){
if((_8)&&(!_7)){
if(_9){
_9();
}
return null;
}else{
throw e;
}
}
if(_5=="text"){
return _f.responseText;
}else{
return _f.responseXML;
}
},getText:function(uri,_11,_12,_13){
return this.getContent("text",uri,_11,_12,_13);
},getXML:function(){
return this.getContent("xml",uri,async_cb,fail_ok,error_cb);
}};


/**/

var Ajax={};
Ajax.Effect={};
Ajax.Effect.Loop={start:function(_1,_2,to,_4,_5){
var _6=setInterval(function(){
if(_2>to){
clearInterval(_6);
Utils.call(_5);
}else{
_1(_2);
_2++;
}
},_4);
}};
Ajax.Trigger={triggers:{},check:function(id,_8){
if(!this.triggers[id]){
this.triggers[id]={};
}
if(!this.triggers[id][_8]){
this.triggers[id][_8]=[];
}
},register:function(id,_a){
this.check(id,_a.on);
this.triggers[id][_a.on].push(_a);
},dispatch:function(id,_c,cb){
this.check(id,_c);
var _e=this.triggers[id][_c];
var _f=new WDF.Effect.Applyer();
for(var i=0;i<_e.length;i++){
var _11=_e[i];
if(_11.effect!=""&&_11.effect!=undefined){
eval("var effect = "+_11.effect);
_f.add(effect);
}else{
if(_11.action!=""){
eval(_11.action);
}
}
}
_f.execute($(id),cb,10);
},broadcastActivity:function(_12,id,_14){
$(id).style.display=_14?"block":"none";
}};
Ajax.appendAjaxBlock=function(src,ids){
ids=!isArray(ids)?[ids]:ids;
var _17=src.indexOf("?")==-1?"?":"&";
for(var key in ids){
var _19=ids[key];
if(!isFunction(_19)){
src+=_17+"__ajaxBlock[]="+_19;
_17="&";
}
}
if(src.indexOf("/")!=0&&src.indexOf("http://")!=0){
src="/"+src;
}
return src;
};
Ajax.addEffectThread=function(_1a,id,_1c){
_1a.add(new WDF.Threading.Thread(function(_1d){
Ajax.Trigger.dispatch(id,_1c,function(){
_1d.finished();
});
}));
};
Ajax.updateBlock=function(ids,src,_20,_21){
if(!this.repository){
this.repository={};
}
ids=!isArray(ids)?[ids]:ids;
src=!src?Ajax.appendAjaxBlock(ENV.Browser.getLocation(),ids):src;
var _22=new WDF.Threading.Pool();
for(var i=0;i<ids.length;i++){
this.addEffectThread(_22,ids[i],"begin");
}
_22.onFinished=function(){
var _24=function(_25){
if(!Ajax.repository[src]){
Ajax.repository[src]=_25;
}
Ajax.fillBlocks(ids,_25);
for(var i=0;i<ids.length;i++){
Ajax.Trigger.dispatch(ids[i],"end",null);
}
Utils.call(_20);
};
if(_21&&Ajax.repository[src]){
_24(Ajax.repository[src]);
}else{
HTTP.getText(src,_24);
}
};
_22.start();
return false;
};
Ajax.fillBlocks=function(ids,_28){
var _29=document.createElement("div");
_29.innerHTML=_28;
for(var key in ids){
var _2b=ids[key];
for(var i=0;i<_29.childNodes.length;i++){
var _2d=_29.childNodes.item(i);
if(_2d.id==_2b){
var _2e=$(_2b);
_2e.innerHTML=_2d.innerHTML;
var _2f=_2e.getElementsByTagName("SCRIPT");
for(var y=0;y<_2f.length;y++){
var _31=_2f[y].text?_2f[y].text:_2f[y].textContent;
eval(_31);
}
}
}
}
_29=null;
};
Ajax.click=function(_32,id,_34){
this.updateBlock(id,Ajax.appendAjaxBlock(_32.href+"",id),null,_34);
return false;
};
Ajax.remove=function(_35,_36){
if(!isArray(_36)){
_36=[_36];
}
var _37=DOM.getParentByClass(_35,"item");
setTimeout(function(){
var _38=HTTP.getText(Ajax.appendAjaxBlock(_35.href+"",["_"]));
},0);
if(_36.length){
var _39=new WDF.Effect.Applyer();
for(var i=0;i<_36.length;i++){
_39.add(_36[i]);
}
_39.execute(_37,function(){
if(_37){
DOM.removeNode(_37);
}
},10);
}else{
if(_37){
DOM.removeNode(_37);
}
}
return false;
};
Ajax.submit=function(_3b,ids,_3d){
var src=Ajax.appendAjaxBlock(_3b.form.action+"",ids);
var _3f=_3b.form.getElementsByTagName("input");
for(var i=0;i<_3f.length;i++){
if(_3f[i].type!="submit"||_3f[i].name==_3b.name){
var _41=true;
if((_3f[i].type=="checkbox"||_3f[i].type=="radio")&&!_3f[i].checked){
_41=false;
}
if(_41){
src+="&"+_3f[i].name+"="+(_3f[i].name==_3b.name?_3f[i].value:_3f[i].value);
}
}
}
this.updateBlock(ids,src,function(){
if(_3b.form){
_3b.form.reset();
}
Utils.call(_3d);
});
return false;
};
Ajax.Position={Middle:"middle"};
Ajax.Position.setPosition=function(elm,x,y){
var top=document.documentElement.scrollTop;
var _46=ENV.Browser.getHeight();
var _47=ENV.Browser.getWidth();
if(x==Ajax.Position.Middle){
var _48=ENV.Browser.getWidth();
elm.style.left=((_47/2)-(elm.offsetWidth/2))+"px";
}
if(y==Ajax.Position.Middle){
var _49=ENV.Browser.getHeight();
elm.style.top=(top+_46/2-(elm.offsetHeight/2))+"px";
}
};
Ajax.Layout={};
Ajax.Layout.Overlay={overlay:null,create:function(_4a){
var _4b=this.overlay;
if(!_4b){
_4b=this.overlay=document.createElement("div");
}
_4b.id="overlay";
_4b.style.height=document.documentElement.scrollHeight+"px";
_4b.style.width=document.documentElement.scrollWidth+"px";
_4b.style.display="block";
DOM.setOpacity(_4b,0);
document.body.appendChild(_4b);
Ajax.Effect.Loop.start(function(_4c){
DOM.setOpacity(_4b,_4c*5);
},5,16,15,_4a);
},remove:function(){
if(this.overlay){
this.overlay.style.display="none";
DOM.setOpacity(this.overlay,0);
}
DOM.removeNode($("overlay"));
},onWindowResized:function(e){
var _4e=$("overlay");
if(_4e){
_4e.style.height=document.documentElement.scrollHeight+"px";
}
}};
Ajax.LightBox={closeImage:"/images/close.gif",closeTitle:"Close",init:function(){
},onLoad:function(){
if(!document.getElementsByTagName){
return;
}
var _4f=document.getElementsByTagName("a");
for(var i=0;i<_4f.length;i++){
var _51=_4f[i];
var _52=String(_51.getAttribute("rel"));
if(_51.getAttribute("href")&&(_52.toLowerCase().match("lightbox"))){
_51.onclick=function(){
Ajax.LightBox.start(this);
return false;
};
}
}
},start:function(a){
var _54=function(){
var src=a.href;
var _56=document.createElement("div");
_56.style.position="absolute";
_56.style.left="-1000px";
_56.style.top="-1000px";
_56.style.zIndex=10000;
var _57=$("page");
_56.id="lightbox";
var _58=document.createElement("div");
_58.className="in";
if(Utils.String.isImagePath(src)){
_58.innerHTML="<img id=\"lightbox-content\" src=\""+src+"\" alt=\""+a.title+"\" onclick=\"return Ajax.LightBox.close(this)\" onload=\"Ajax.LightBox.show()\" />";
}
var _59=document.createElement("div");
_59.className="descr";
var _5a=document.createElement("p");
_5a.className="title";
var _5b=document.createElement("p");
_5b.className="action";
_5a.innerHTML=a.title;
_5b.innerHTML="<a href=\"#\" onclick=\"return Ajax.LightBox.close(this)\"><img src=\""+Ajax.LightBox.closeImage+"\" alt=\""+Ajax.LightBox.closeTitle+"\" /></a>";
_59.appendChild(_5a);
_59.appendChild(_5b);
_56.appendChild(_58);
_56.appendChild(_59);
document.body.appendChild(_56);
};
Ajax.Layout.Overlay.create(_54);
},show:function(){
var top=document.documentElement.scrollTop;
var _5d=ENV.Browser.getHeight();
var _5e=ENV.Browser.getWidth();
var _5f=$("lightbox");
_5f.style.width=$("lightbox-content").offsetWidth+"px";
_5f.style.top=(top+_5d/2-(_5f.offsetHeight/2))+"px";
_5f.style.left=((_5e/2)-(_5f.offsetWidth/2))+"px";
},close:function(){
DOM.removeNode($("lightbox"));
Ajax.Layout.Overlay.remove();
return false;
}};
//EventManager.connect(window,"onresize",Ajax.Layout.Overlay,"onWindowResized");
//EventManager.connect(window,"onscroll",Ajax.Layout.Overlay,"onWindowResized");
//EventManager.connect(window,"onload",Ajax.LightBox,"onLoad");


/**/

Ajax.Dialog={target:null,steps:10,dialogs:{},next_id:0};
Ajax.Dialog.getDialogID=function(_1){
var _2=DOM.getParentByClass(_1,"ajax-dialog");
return _2.id;
};
Ajax.Dialog.updateBlock=function(_3,id){
Ajax.updateBlock(id,Ajax.appendAjaxBlock(this.dialogs[this.getDialogID(_3)].url,id));
};
Ajax.Dialog.click=function(_5,id,_7){
var _7=_5.search+"";
if(_7.indexOf("?")==0){
_7="&"+_7.substring(1);
}
_7=Utils.String.isRelativePath(_7)?this.dialogs[this.getDialogID(_5)].url+_7:_7;
Ajax.updateBlock(id,Ajax.appendAjaxBlock(_7,id));
return false;
};
Ajax.Dialog.submit=function(_8,id,cb){
Ajax.submit(_8,id,cb);
return false;
};
Ajax.Dialog.open=function(_b,_c,_d){
var _e=document.createElement("div");
_e.className="ajax-dialog";
_e.innerHTML=HTTP.getText(_c);
_e.id=_d.id?_d.id:"ajax-dialog-"+(this.next_id++);
_d.url=_c;
this.dialogs[_e.id]=_d;
this.applyOptions(_e,_d);
document.body.appendChild(_e);
if(ENV.ie){
this.evalJavascripts(_e);
}
Ajax.Position.setPosition(_e,_d.x,_d.y);
_e.style.display="none";
if(this.dialogs[_e.id].overlay){
Ajax.Layout.Overlay.create();
}
Ajax.Dialog.init(_e);
Ajax.Dialog.onDialogCreated(_e,_d);
};
Ajax.Dialog.evalJavascripts=function(_f){
var _10=_f.getElementsByTagName("script");
for(var i=0;i<_10.length;i++){
var _12=_10[i];
eval(_12.text);
}
};
Ajax.Dialog.applyOptions=function(_13,_14,_15){
if(!_14){
return false;
}
if(_15){
for(var k in _14){
this.dialogs[_13.id][k]=_14[k];
}
}
if(!_14.width||_14["min-width"]<_14.width){
_14.width=_14["min-width"];
}
if(!_14.height||_14["min-height"]<_14.height){
_14.height=_14["min-height"];
}
if(_14.width){
_13.style.width=_14.width+"px";
}
if(_14.height){
_13.style.height=_14.height+"px";
}
};
Ajax.Dialog.close=function(_17){
var _18=this.getDialogID(_17);
this.executeEventScripts(_18,"onclose");
if(this.dialogs[_18].overlay){
try{
Ajax.Layout.Overlay.remove();
}
catch(e){
}
}
delete this.dialogs[_18];
DOM.removeNode($(_18));
return false;
};
Ajax.Dialog.dispatchEvent=function(_19,_1a){
var _1b=this.getDialogID(_19);
this.executeEventScripts(_1b,_1a);
return false;
};
Ajax.Dialog.executeEventScripts=function(_1c,_1d){
var _1e=this.dialogs[_1c];
if(_1e[_1d]){
for(var i=0;i<_1e[_1d].length;i++){
_1e[_1d][i]();
}
}
};
Ajax.Dialog.onDialogCreated=function(_20,_21){
DOM.setOpacity(_20,0);
_20.style.display="block";
_20.style.left=parseInt(_20.style.left)+"px";
var opt=DOM.getElementsByClassName(_20,"input","dialog-options")[0];
if(opt){
this.applyOptions(_20,Utils.Json.eval(opt.value),true);
}
Ajax.Effect.Loop.start(function(_23){
DOM.setOpacity(_20,_23*5);
},5,20,15);
};
Ajax.Dialog.init=function(id){
var _25=$(id);
if(!_25){
return;
}
Ajax.DND.makeDraggable(DOM.getElementsByClassName(_25,"div","header")[0]);
Ajax.DND.makeDraggable(DOM.getElementsByClassName(_25,"div","resizer")[0],function(_26){
_26.original_width=_25.offsetWidth;
_26.original_height=_25.offsetHeight;
},function(_27,_28,_29){
Ajax.Dialog.onResizing(_25,_27,_28,_29);
});
};
Ajax.Dialog.getOptions=function(id){
return this.dialogs[id];
};
Ajax.Dialog.onResizing=function(_2b,_2c,_2d,_2e){
var _2f=this.getOptions(_2b.id);
var _30=parseInt(_2b.style.width);
var _31=(_2c.original_width-_2e.x+(_2d.x-dragPosition.x));
var _32=(_2c.original_height-_2e.y+(_2d.y-dragPosition.y));
if(!_2f["min-width"]||_31>=_2f["min-width"]){
_2b.style.width=_31+"px";
}
if(!_2f["min-height"]||_32>=_2f["min-height"]){
_2b.style.height=_32+"px";
}
};


/**/

WDF.DND={};
Ajax.DND={prevMouseTarget:null,event:null,mouseUp:function(e){
if(dragObject){
e=e||window.event;
var _2=Ajax.DND.mouseCoords(e);
if(dragObject.onmouseup_callback){
dragObject.onmouseup_callback(e,_2);
}
}
dragObject=null;
},mouseCoords:function(ev){
if(ev.pageX||ev.pageY){
return {"x":ev.pageX,"y":ev.pageY};
}
var _4=0;
var _5=0;
_4+=ev.clientX;
try{
_4+=document.body.scrollLeft;
}
catch(e){
}
try{
_4-=document.body.clientLeft;
}
catch(e){
}
try{
_5+=ev.clientY;
}
catch(e){
}
try{
_5+=document.body.scrollTop;
}
catch(e){
}
try{
_5-=document.body.clientTop;
}
catch(e){
}
return {"x":_4,"y":_5};
},mouseMove:function(ev){
ev=ev||window.event;
Ajax.DND.event=ev;
var _7=this.mouseCoords(ev);
if(dragObject){
if(dragObject.onmousemove_callback){
var r=dragObject.onmousemove_callback(dragObject,_7,mouseOffset);
return r;
}else{
dragObject.parentNode.style.position="absolute";
dragObject.parentNode.style.top=(_7.y-mouseOffset.y)+"px";
dragObject.parentNode.style.left=(_7.x-mouseOffset.x)+"px";
return false;
}
}
return true;
},makeDraggable:function(_9,_a,_b,_c){
if(!_9){
return;
}
_9.onmousemove_callback=_b;
_9.onmouseup_callback=_c;
_9.onmousedown=function(ev){
dragObject=this;
dragPosition=Ajax.DND.getPosition(this);
mouseOffset=Ajax.DND.getMouseOffset(this,ev);
if(_a){
_a(this,dragPosition,mouseOffset);
}
return false;
};
},getMouseOffset:function(_e,ev){
ev=ev||window.event;
var _10=this.getPosition(_e);
var _11=this.mouseCoords(ev);
return {x:_11.x-_10.x,y:_11.y-_10.y};
},getPosition:function(e){
var _13=0;
var top=0;
while(e.offsetParent){
_13+=e.offsetLeft+(e.currentStyle?(parseInt(e.currentStyle.borderLeftWidth)).NaN0():0);
top+=e.offsetTop+(e.currentStyle?(parseInt(e.currentStyle.borderTopWidth)).NaN0():0);
e=e.offsetParent;
}
_13+=e.offsetLeft+(e.currentStyle?(parseInt(e.currentStyle.borderLeftWidth)).NaN0():0);
top+=e.offsetTop+(e.currentStyle?(parseInt(e.currentStyle.borderTopWidth)).NaN0():0);
return {x:_13,y:top};
}};
document.onmousemove=function(e){
return Ajax.DND.mouseMove(e);
};
document.onmouseup=function(e){
Ajax.DND.mouseUp(e);
};
var dragObject=null;
var mouseOffset=null;
var dragPosition=null;


/**/

var dragHelper;
WDF.DND.DropArea=function(_1){
this.element=_1;
};
WDF.DND.DropArea.prototype.onDrop=function(_2){
};
WDF.DND.Container=function(_3){
this.copyhandleonly=_3;
this.lMouseState=false;
this.curTarget=null;
this.rootParent=null;
this.rootSibling=null;
this.areas=[];
this.DragDrops=[];
this.dropSuccess=false;
dragHelper=$("proxy-holder");
if(!dragHelper){
dragHelper=document.createElement("div");
dragHelper.style.position="absolute";
dragHelper.style.display="none";
document.body.appendChild(dragHelper);
}
};
WDF.DND.Container.prototype.add=function(_4){
this.areas.push(_4);
};
WDF.DND.Container.prototype.create=function(){
for(var i=0;i<this.areas.length;i++){
var _6=this.areas[i];
this.DragDrops.push(_6.element);
_6.element.areaID=i;
var _7=DOM.getElementsByClassName(_6.element,"*","dragable");
for(var j=0;j<_7.length;j++){
if(_7[j].nodeName=="#text"){
continue;
}
this.makeDragable(_7[j]);
}
}
};
WDF.DND.Container.prototype.makeDragable=function(_9){
var _a=DOM.getElementsByClassName(_9,"*","handle")[0];
if(!_a){
_a=_9;
}
var _b=this;
Ajax.DND.makeDraggable(_a,function(_c,_d,_e){
_b.OnItemMouseDown(_9,_d,_e);
},function(_f,_10,_11){
return _b.OnItemMouseMove(_9,_10,_11);
},function(e,_13){
_b.OnItemMouseUp(e,_13);
});
};
WDF.DND.Container.prototype.OnItemMouseDown=function(_14,_15,_16){
this.iMouseDown=true;
this.dragObject=_14;
};
WDF.DND.Container.prototype.OnItemMouseMove=function(_17,_18,_19){
if(this.iMouseDown&&!this.lMouseState){
this.curTarget=_17;
this.rootParent=this.curTarget.parentNode;
this.rootSibling=this.curTarget.nextSibling;
for(var i=0;i<dragHelper.childNodes.length;i++){
dragHelper.removeChild(dragHelper.childNodes[i]);
}
var _1b;
if(this.copyhandleonly){
_1b=DOM.getElementsByClassName(this.curTarget,"*","handle")[0].cloneNode(true);
}else{
_1b=this.curTarget.cloneNode(true);
}
dragHelper.appendChild(_1b);
dragHelper.style.display="block";
_1b.style.width=this.curTarget.offsetWidth+"px";
_1b.style.height=this.curTarget.offsetHeight+"px";
DOM.setOpacity(_1b,50);
dragHelper.firstChild.removeAttribute("DragObj");
var _1c=this.DragDrops;
with(this.curTarget){
setAttribute("startWidth",parseInt(offsetWidth));
setAttribute("startHeight",parseInt(offsetHeight));
style.display="none";
}
for(var i=0;i<_1c.length;i++){
with(_1c[i]){
var pos=Ajax.DND.getPosition(_1c[i]);
setAttribute("startWidth",parseInt(offsetWidth));
setAttribute("startHeight",parseInt(offsetHeight));
setAttribute("startLeft",pos.x);
setAttribute("startTop",pos.y);
}
for(var j=0;j<_1c[i].childNodes.length;j++){
with(_1c[i].childNodes[j]){
if((nodeName=="#text")||(_1c[i].childNodes[j]==this.curTarget)){
continue;
}
var pos=Ajax.DND.getPosition(_1c[i].childNodes[j]);
setAttribute("startWidth",parseInt(offsetWidth));
setAttribute("startHeight",parseInt(offsetHeight));
setAttribute("startLeft",pos.x);
setAttribute("startTop",pos.y);
}
}
}
}
if(this.curTarget){
dragHelper.style.top=(_18.y-_19.y)+"px";
dragHelper.style.left=(_18.x-_19.x)+"px";
var _1c=this.DragDrops;
var _1f=null;
var _20=_18.x-_19.x+(parseInt(this.curTarget.getAttribute("startWidth"))/2);
var _21=_18.y-_19.y+(parseInt(this.curTarget.getAttribute("startHeight"))/2);
for(var i=0;i<_1c.length;i++){
with(_1c[i]){
if((parseInt(getAttribute("startLeft"))<_20)&&(parseInt(getAttribute("startTop"))<_21)&&((parseInt(getAttribute("startLeft"))+parseInt(getAttribute("startWidth")))>_20)&&((parseInt(getAttribute("startTop"))+parseInt(getAttribute("startHeight")))>_21)){
_1f=_1c[i];
break;
}
}
}
if(_1f){
if(_1f!=this.curTarget.parentNode){
}
DOM.addClass(_1f,"over");
var _22=null;
for(var i=_1f.childNodes.length-1;i>=0;i--){
with(_1f.childNodes[i]){
if(nodeName=="#text"){
continue;
}
if(this.curTarget!=_1f.childNodes[i]&&((parseInt(getAttribute("startLeft"))+parseInt(getAttribute("startWidth")))>_20)&&((parseInt(getAttribute("startTop"))+parseInt(getAttribute("startHeight")))>_21)){
_22=_1f.childNodes[i];
}
}
}
if(_22){
if(_22!=this.curTarget.nextSibling){
_1f.insertBefore(this.curTarget,_22);
this.dropSuccess=true;
}
}else{
if((this.curTarget.nextSibling)||(this.curTarget.parentNode!=_1f)){
_1f.appendChild(this.curTarget);
this.dropSuccess=true;
}
}
setTimeout(function(){
var _23=Ajax.DND.getPosition(_1f);
with(_1f){
setAttribute("startWidth",parseInt(offsetWidth));
setAttribute("startHeight",parseInt(offsetHeight));
setAttribute("startLeft",_23.x);
setAttribute("startTop",_23.y);
}
},5);
if(this.curTarget.style.display!=""){
this.curTarget.style.display="";
this.curTarget.style.visibility="hidden";
}
if(this.lastActiveCont&&this.lastActiveCont!=_1f){
DOM.remClass(this.lastActiveCont,"over");
}
this.lastActiveCont=_1f;
}else{
if(this.curTarget.style.display!="none"){
this.curTarget.style.display="none";
this.dropSuccess=false;
if(this.lastActiveCont){
DOM.remClass(this.lastActiveCont,"over");
}
}
}
}
this.lMouseState=this.iMouseDown;
this.lastTarget=_17;
this.lMouseState=this.iMouseDown;
return false;
};
WDF.DND.Container.prototype.OnItemMouseUp=function(e,_25){
if(this.curTarget){
dragHelper.style.display="none";
this.curTarget.style.display="";
this.curTarget.style.visibility="visible";
if(this.dropSuccess){
this.areas[this.curTarget.parentNode.areaID].onDrop(this.curTarget);
}
DOM.remClass(this.curTarget.parentNode,"over");
}
this.curTarget=null;
this.dragObject=null;
this.iMouseDown=false;
this.lMouseState=false;
};
function writeHistory(_26,_27){
var _28=$("history");
if(_28){
_28.appendChild(document.createTextNode(_26+": "+_27));
_28.appendChild(document.createElement("BR"));
_28.scrollTop+=50;
}
}


/**/

WDF.Effect={};
WDF.Effect.Applyer=function(){
this.effects=[];
};
WDF.Effect.Applyer.prototype.add=function(_1){
this.effects.push(_1);
};
WDF.Effect.Applyer.prototype.execute=function(_2,_3,_4,_5){
if(!_5){
_5=10;
}
if(!_4){
_4=100;
}
for(var i=0;i<this.effects.length;i++){
this.effects[i].init(_2,_4);
}
var _7=this;
Ajax.Effect.Loop.start(function(_8){
_7.onStep(_2,_8);
},1,_4,_5,_3);
};
WDF.Effect.Applyer.prototype.onStep=function(_9,_a){
for(var i=0;i<this.effects.length;i++){
this.effects[i].apply(_9,_a);
}
};
WDF.Effect.FadeOut=function(){
};
WDF.Effect.FadeOut.prototype.init=function(_c,_d){
this.steps=_d;
};
WDF.Effect.FadeOut.prototype.apply=function(_e,_f){
DOM.setOpacity(_e,100-(100/(this.steps/_f)));
};
WDF.Effect.FadeIn=function(){
};
WDF.Effect.FadeIn.prototype.init=function(elm,_11){
this.steps=_11;
};
WDF.Effect.FadeIn.prototype.apply=function(elm,_13){
DOM.setOpacity(elm,(100/(this.steps/_13)));
};
WDF.Effect.FadeOut=function(){
};
WDF.Effect.FadeOut.prototype.init=function(elm,_15){
this.steps=_15;
};
WDF.Effect.FadeOut.prototype.apply=function(elm,_17){
DOM.setOpacity(elm,100-(100/(this.steps/_17)));
};
WDF.Effect.Resize=function(_18,_19){
this.height=_19;
this.width=_18;
};
WDF.Effect.Resize.prototype.init=function(elm,_1b){
this.step_width=(this.width-elm.offsetWidth)/_1b;
this.step_height=(this.height-elm.offsetHeight)/_1b;
this.steps=_1b;
};
WDF.Effect.Resize.prototype.apply=function(elm,_1d){
elm.style.width=elm.offsetWidth+parseInt(this.step_width)+"px";
elm.style.height=elm.offsetHeight+parseInt(this.step_height)+"px";
};


/**/

if(typeof WDF=="undefined"){
var WDF={n:true};
}
WDF.Threading={n:true};
WDF.Threading.PoolIndex=0;
WDF.Threading.Pools=[];
WDF.Threading.onWait=function(id){
var _2=WDF.Threading.Pools[id];
if(!_2.wait_threads){
clearInterval(_2.interval);
_2.onFinished();
}else{
}
};
WDF.Threading.Thread=function(cb){
this.callback=cb;
};
WDF.Threading.Thread.prototype.execute=function(){
var _4=this.callback;
var _5=this;
setTimeout(function(){
_4(_5);
},0);
};
WDF.Threading.Thread.prototype.finished=function(){
};
WDF.Threading.Pool=function(){
this.threads=[];
this.id=WDF.Threading.PoolIndex++;
this.wait_threads=0;
this.interval=0;
this.onFinished=function(){
};
WDF.Threading.Pools[this.id]=this;
};
WDF.Threading.Pool.prototype.start=function(_6){
this.callback=_6;
for(var i=0;i<this.threads.length;i++){
this.threads[i].execute();
}
var _8=this;
this.interval=setInterval("WDF.Threading.onWait("+this.id+");",10);
};
WDF.Threading.Pool.prototype.onFinishedThread=function(_9){
this.wait_threads--;
};
WDF.Threading.Pool.prototype.add=function(_a){
this.wait_threads++;
_a.parent=this;
_a.finished=function(_b){
this.parent.onFinishedThread(this);
};
this.threads.push(_a);
};


/**/
