// dgTools library by Daniel Cohen Gindi (danielgindi@gmail.com) 054-5655765
// version 2011-03-21
$isElement=function(a){return a&&a.nodeType==1};$isArray=function(a){return a!=null&&typeof a=="object"&&"splice" in a&&"join" in a};$isFunction=function(a){return typeof a=="function"};$isString=function(a){return typeof a=="string"};$isNumber=function(a){return typeof a=="number"};$Array=function(d){if(!d.length){return[]}var b=[];for(var c=0;c<d.length;c++){b.push(d[c])}return b};Array.prototype.iterate=function(c,d){for(var b=0,a=this.length;b<a;b++){if(d){c.call(d,this[b],b,this)}else{c(this[b],b)}}};Array.fromElement=function(d){var a=[];for(var c=0,b=d.length;c<b;c++){a[c]=d[c]}return a};Array.prototype.indexOf=function(c,d){var a=this.length;for(var b=(d<0)?Math.max(0,a+d):d||0;b<a;b++){if(this[b]===c){return b}}return -1};Array.prototype.contains=function(a,b){return this.indexOf(a,b)!=-1};Array.prototype.copy=function(d,c){d=d||0;if(d<0){d=this.length+d}c=c||(this.length-d);var a=[];for(var b=0;b<c;b++){a[b]=this[d++]}return a};Array.prototype.remove=function(c){var b=0,a=this.length;while(b<a){if(this[b]===c){this.splice(b,1);a--}else{b++}}return this};Array.prototype.findAll=function(b,c){b=b.bind(c);var a=[];this.iterate(function(d){if(b(d)){a.push(d)}});return a};Array.prototype.pluck=function(b){var a=[];this.iterate(function(c){a.push(c[b])});return a};Array.prototype.reject=function(b,c){b=b.bind(c);var a=[];this.iterate(function(d){if(!b(d)){a.push(d)}});return a};Array.prototype.max=function(){var a;this.iterate(function(b){if(a==null||b>=a){a=b}});return a};Array.prototype.min=function(){var a;this.iterate(function(b){if(a==null||b<a){a=b}});return a};Array.prototype.invoke=function(c){var a=$Array(arguments).slice(1);var b=[];this.iterate(function(d){b.push(d[c].apply(d,a))});return b};Array.prototype.concat=function(){var e=[];for(var b=0,c=this.length;b<c;b++){e.push(this[b])}for(var b=0,c=arguments.length;b<c;b++){if($isArray(arguments[b])){for(var a=0,d=arguments[b].length;a<d;a++){e.push(arguments[b][a])}}else{e.push(arguments[b])}}return e};Function.prototype.bind=function(c,a){var b=this;return function(){return b.apply(c,a||arguments)}};String.prototype.escapeForJs=function(){if(this===undefined||this===null){return""}else{return this.replace(/\\/g,"\\\\").replace(/\'/g,"\\'").replace(/\"/g,'\\"').replace(/\r/g,"\\r").replace(/\n/g,"\\n")}};String.prototype.validateEmail=function(){return !!this.match(/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z0-9]{1,}$/i)};String.prototype.trim=function(){return this.replace(/^\s*/,"").replace(/\s*$/,"")};String.prototype.camelize=function(){var d=this.split("-"),a=d.length;if(a==1){return d[0]}var c=this.charAt(0)=="-"?d[0].charAt(0).toUpperCase()+d[0].substring(1):d[0];for(var b=1;b<a;b++){c+=d[b].charAt(0).toUpperCase()+d[b].substring(1)}return c};String.prototype.toArray=function(){return this.split("")};Number.prototype.abs=function(){return Math.abs(this)};Number.prototype.round=function(){return Math.round(this)};Number.prototype.ceil=function(){return Math.ceil(this)};Number.prototype.floor=function(){return Math.floor(this)};Number.prototype.toPaddedString=function(e,d){var b=this.toString(d||10);var f="";var a=e-b.length;for(var c=0;c<a;c++){f+="0"}return f+b};if(window.ActiveXObject){if(navigator.appVersion.indexOf("MSIE 8.0")>=0){window.ie=window.ie8=8}else{if(navigator.appVersion.indexOf("MSIE 7.0")>=0){window.ie=window.ie7=7}else{if(navigator.appVersion.indexOf("MSIE 6.5")>=0){window.ie=window.ie6=6.5}else{if(navigator.appVersion.indexOf("MSIE 6.0")>=0){window.ie=window.ie6=6}else{if(navigator.appVersion.indexOf("MSIE 5.5")>=0){window.ie=window.ie5=5.5}else{if(navigator.appVersion.indexOf("MSIE 5.0")>=0){window.ie=window.ie5=5}else{if(navigator.appVersion.indexOf("MSIE 4.0")>=0){window.ie=window.ie4=4}else{if(document.all&&document.getElementById){window.ie=window.ie5=5}else{window.ie=window.ie4=4}}}}}}}}}window.Opera=!!window.opera;window.Gecko=navigator.userAgent.indexOf("Gecko")>-1&&navigator.userAgent.indexOf("KHTML")==-1;window.WebKit=navigator.userAgent.indexOf("AppleWebKit/")>-1;window.MobileSafari=!!navigator.userAgent.match(/Apple.*Mobile.*Safari/);window.getClientHeight=function(){return((document.documentElement&&document.documentElement.clientHeight)?document.documentElement.clientHeight:((document.body&&document.body.clientHeight)?document.body.clientHeight:window.innerHeight))};window.getClientWidth=function(){return((document.documentElement&&document.documentElement.clientWidth)?document.documentElement.clientWidth:((document.body&&document.body.clientWidth)?document.body.clientWidth:window.innerWidth))};window.getClientScrollHeight=function(){return((document.documentElement&&document.documentElement.scrollHeight)?document.documentElement.scrollHeight:((document.body&&document.body.scrollHeight)?document.body.scrollHeight:window.scrollHeight))};window.getClientScrollWidth=function(){return((document.documentElement&&document.documentElement.scrollWidth)?document.documentElement.scrollWidth:((document.body&&document.body.scrollWidth)?document.body.scrollWidth:window.scrollWidth))};window.getScrollOffsets=function(){var a=[window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop];a.left=a[0];a.top=a[1];return a};var dgTools={$:function(b){if(arguments.length>1){for(var a=0,d=[],c=arguments.length;a<c;a++){d.push(dgTools.$(arguments[a]))}return d}else{if(!b){return null}}if(b&&b.nodeType==1){return b}if(typeof b=="string"){return document.getElementById?document.getElementById(b):(document.layers?document.layers[b]:document.all[b])}return null},observe:function(d,c,e,b){if(d==null){return}if(c.indexOf("dom:",0)==0){function a(g){var f=g||event;if(c==f.eventName){e(f)}}if(d.addEventListener){d.addEventListener("dataavailable",a,b?true:false)}else{if(d.attachEvent){d.attachEvent("ondataavailable",a)}}}else{if(d.addEventListener){d.addEventListener(c,e,b?true:false)}else{if(d.attachEvent){d.attachEvent("on"+c,e)}}}return e},unobserve:function(c,b,d,a){if(c==null){return}if(c.removeEventListener){c.removeEventListener(b,d,a?true:false)}else{if(c.detachEvent){c.detachEvent("on"+b,d)}}},hover:function(e,f,a){var d={};if(f){var b=function(g){g=new dgTools.Event(g);if(g.relatedTarget==e||dgTools.Elm.hasChild(e,g.relatedTarget)){return}(f.bind(e))(g)};d.mouseover=dgTools.observe(e,"mouseover",b)}if(a){var c=function(g){g=new dgTools.Event(g);if(g.relatedTarget==e||dgTools.Elm.hasChild(e,g.relatedTarget)){return}(a.bind(e))(g)};d.mouseout=dgTools.observe(e,"mouseout",c)}return d},unhover:function(b,a){if(a){if(a.mouseover){dgTools.unobserve(b,"mouseover",a.mouseover)}if(a.mouseout){dgTools.unobserve(b,"mouseout",a.mouseout)}}},fire:function(b,a){if(b==document&&document.createEvent&&!b.dispatchEvent){b=document.documentel}var c;if(document.createEvent){c=document.createEvent("HTMLEvents");c.initEvent("dataavailable",true,true)}else{c=document.createEventObject();c.eventType="ondataavailable"}c.eventName=a;if(document.createEvent){b.dispatchEvent(c)}else{b.fireEvent(c.eventType,c)}return c},createFunction:function(a){if(typeof a=="function"){return a}return new Function(a)},extend:function(c,d,f,a){if(typeof d=="string"){d=d.split(" ")}var e;for(var b=0;b<d.length;b++){e=d[b];if(f&&f[e]!==undefined){c[e]=f[e]}else{if(a&&a[e]!==undefined){c[e]=a[e]}}}return c},easyAnimate:function(c,o,e,a,d,t,r){var v={ended:false};if(!e&&!o){if(t){t()}v.ended=true;v.stop=function(){return true};return v}v.stop=function(){s()};v.end=function(){p()};if(!r){r=dgTools.Transitions.sinoidal}else{if(typeof r==typeof""){r=dgTools.Transitions[r]}}if(typeof r!="function"){r=dgTools.Transitions.sinoidal}var m=this;var k=new Date().getTime();var f=k+a;var b=[];var q=[];var n=[];var u=[];var l=[];o=o||{};e=e||{};for(var j in o){if(e[j]!==undefined&&e[j]!==null){continue}if(j=="left"||j=="top"||j=="right"||j=="bottom"||j=="width"||j=="height"){c.style[j]=parseInt(o[j],10)+"px";if((j=="width"||j=="height")&&dgTools.Elm.getRenderedStyle(c,"display")=="inline"){c.display="inline-block;"}}else{if(j=="scrollLeft"||j=="scrollTop"){c[j]=parseInt(o[j],10)}else{if(j=="opacity"){dgTools.Elm.setOpacity(c,parseFloat(o[j]))}}}}for(var j in e){if(j=="left"||j=="top"||j=="right"||j=="bottom"||j=="width"||j=="height"){b.push(j);l[j]=true;if(o&&o[j]!==undefined&&o[j]!==null){q[j]=parseInt(o[j],10)}else{q[j]=parseInt(dgTools.Elm.getRenderedStyle(c,j),10);if(isNaN(q[j])){if(j=="width"){q[j]=parseInt(dgTools.Elm.clientWidth(c),10)}else{if(j=="height"){q[j]=parseInt(dgTools.Elm.clientHeight(c),10)}}}}n[j]=e[j];u[j]="px";if((j=="width"||j=="height")&&dgTools.Elm.getRenderedStyle(c,"display")=="inline"){c.display="inline-block;"}}else{if(j=="scrollLeft"||j=="scrollTop"){b.push(j);l[j]=false;if(o&&o[j]!==undefined&&o[j]!==null){q[j]=parseInt(o[j],10)}else{q[j]=parseInt(c[j],10)}n[j]=e[j];u[j]=""}else{if(j=="opacity"){b.push(j);l[j]=true;if(o&&o[j]!==undefined&&o[j]!==null){q[j]=parseFloat(o[j])}else{q[j]=dgTools.Elm.getOpacity(c)}n[j]=parseFloat(e[j]);u[j]=0}}}}var i=Math.floor(1000/(d||40));function h(){var z=new Date().getTime();var A,y,w;if(z<f){for(var x=0;x<b.length;x++){w=b[x];A=r((z-k)/a);y=q[w]+((n[w]-q[w])*A);if(w=="opacity"){dgTools.Elm.setOpacity(c,y)}else{if(l[w]){c.style[w]=y+u[w]}else{c[w]=y+u[w]}}}if(g!==null){g=setTimeout(h,i)}}else{for(var x=0;x<b.length;x++){w=b[x];if(w=="opacity"){dgTools.Elm.setOpacity(c,n[w])}else{if(l[w]){c.style[w]=n[w]+u[w]}else{c[w]=n[w]+u[w]}}}if(t){t(m)}}}function s(){if(g){clearTimeout(g)}g=null}function p(){f=k}var g=setTimeout(h,i);return v}};if(window["$"]==null){$=dgTools.$}dgTools.ajax={$:dgTools.$,loadScriptFromUrl:function(url,uniqueName,useCounter){var scriptTag=null;var headTag=document.getElementsByTagName("head")[0];if(uniqueName){var newCounter=false;uniqueName="$ajax_load_"+uniqueName;scriptTag=dgTools.$(uniqueName);if(scriptTag){headTag.removeChild(scriptTag)}else{newCounter=true}scriptTag=document.createElement("script");scriptTag.id=uniqueName;if(useCounter){uniqueName+="_counter$";var counter;if(newCounter){counter=0}else{counter=eval(uniqueName)}counter++;eval(uniqueName+"="+counter);if(url.indexOf("?")>=0){url+="&_counter$="+counter}else{url+="?_counter$="+counter}}}else{scriptTag=document.createElement("script")}headTag.appendChild(scriptTag);delete headTag;scriptTag.src=url},parseXmlString:function(a){var b=null;if(window.ActiveXObject){try{b=new ActiveXObject("Microsoft.XMLDOM");b.async=false;b.loadXML(a)}catch(c){}}else{if(DOMParser){var d=new DOMParser();b=d.parseFromString(a,"application/xml")}}if(b&&b.documentElement){return b.documentElement}},parseXmlFile:function(a){var b=null;if(window.ActiveXObject){try{b=new ActiveXObject("Microsoft.XMLDOM")}catch(c){try{b=document.implementation.createDocument("","",null)}catch(c){}}}b.async=false;b.load(a);if(b&&b.documentElement){return b.documentElement}},loadUrl:function(b,g,a){var c=!!g;var f=null;if(!window.ie||location.protocol!="file:"){try{f=new XMLHttpRequest()}catch(d){}}if(f==null){try{f=new ActiveXObject("Msxml2.XMLHTTP")}catch(d){}}if(f==null){try{f=new ActiveXObject("Microsoft.XMLHTTP")}catch(d){}}if(!f){return null}f.open("GET",b,c);if(c){f.onreadystatechange=function(){if(f.readyState==4){g(a(f));f=null}}}try{f.send(null)}catch(d){return null}return c?"":a(f)},loadUrlText:function(a,c){var b=function(d){if(dgTools.ajax.loadUrl.checkStatus(d)){return d.responseText}return null};return dgTools.ajax.loadUrl(a,c,b)},loadUrlXml:function(a,c){var b=function(e){if(dgTools.ajax.loadUrl.checkStatus(e)){var d=e.responseXML;return(d&&d.firstChild)?d:dgTools.ajax.parseXmlString(e.responseText)}return null};return dgTools.ajax.loadUrl(a,c,b)},loadImage:function(c,e){var d=document.createElement("img");var b=function(f){dgTools.unobserve(d,"load",b,false);dgTools.unobserve(d,"error",a,false);if(e!=null){e(true,c,d)}};var a=function(f){dgTools.unobserve(d,"load",b,false);dgTools.unobserve(d,"error",a,false);if(e!=null){e(false,c,d)}};dgTools.observe(d,"load",b,false);dgTools.observe(d,"error",a,false);d.src=c;delete d,b,a}};dgTools.ajax.loadUrl.checkStatus=function(a){return(a.readyState==4&&((a.status>=200&&a.status<300)||a.status==304||a.status===0||a.status==1223))};var ajax=dgTools.ajax;dgTools.Io={getFileName:function(d,c){var a=d.replace(/^.*[\/\\]/g,"");if(typeof(c)=="string"&&a.substr(a.length-c.length)==c){a=a.substr(0,a.length-c.length)}return a},stripHash:function(b){var a=b.indexOf("?");if(a>-1){return b.substr(0,a)}return b},getBasePath:function(b){var a=b.indexOf("?");if(a==-1){a=b.length}a=b.lastIndexOf("/",a);if(a==-1){return"/"}return b.substr(0,a+1)},isAbsolutePath:function(b){var a=b.indexOf("?");if(a==-1){a=b.length}a=b.lastIndexOf("://",a);if(a==-1){return false}return true},findScriptPath:function(e,a){var f=document.getElementsByTagName("script");for(var b=0;b<f.length;b++){var c=f[b].src;if(a){c=this.stripHash(c)}if(this.getFileName(c)==e){var d=c.substring(0,c.lastIndexOf("/")+1);if("https:"==document.location.protocol&&!this.isAbsolutePath(d)){if(d.Length>0&&d[0]=="/"){d="https://"+document.location.hostname+d}else{d="https://"+document.location.hostname+this.getBasePath(document.location.pathname)+d}}return d}}return""}};dgTools.Browser={preventBack:function(){function a(){window.history.forward()}setTimeout(a,0);dgTools.observe(window,"unload",function(){null})},isChrome:function(){return document.getElementById&&navigator.appVersion.indexOf("Chrome")>=0},winPopup:function(c,e,b,d,g){if(d==undefined||d==null){d=""}var a=window.open("",d,config="height="+b+",width="+e+",resizable=no,toolbars=no,address=no,status=no,menubar=no,location=no,toolbar=no,scrollbars=no");try{if(g==true){a.document.close();a.document.open()}}catch(f){}a.document.location=c;a.window.focus();return a},simulateInnerAnchorClick:function(b,c){for(var a=0;a<c;a++){if(a<c&&!b.firstChild){return}else{if(a==c&&!b.href){return}}if(a<c){b=b.firstChild}}if(b.href){if(b.target&&b.target.length>0){window.open(b.href,b.target)}else{document.location=b.href}return false}}};dgTools.Transitions={linear:function(a){return a},sinoidal:function(a){return(-Math.cos(a*Math.PI)/2)+0.5},swing:function(a){return(-Math.cos(a*Math.PI)/2)+0.5},reverse:function(a){return 1-a},flicker:function(a){a=((-Math.cos(a*Math.PI)/4)+0.75)+Math.random()/4;return a>1?1:a},wobble:function(a){return(-Math.cos(a*Math.PI*(9*a))/2)+0.5},pulse:function(a,b){b=b||5;return(((a%(1/b))*b).round()==0?((a*b*2)-(a*b*2).floor()):1-((a*b*2)-(a*b*2).floor()))},spring:function(a){return 1-(Math.cos(a*4.5*Math.PI)*Math.exp(-a*6))},none:function(a){return 0},full:function(a){return 1}};dgTools.Elm={hasClassName:function(c,b){var a=c.className;return(a.length>0&&(a==b||new RegExp("(^|\\s)"+b+"(\\s|$)").test(a)))},addClassName:function(b,a){if(!this.hasClassName(b,a)){b.className+=(b.className?" ":"")+a}return b},removeClassName:function(b,a){b.className=b.className.replace(new RegExp("(^|\\s+)"+a+"(\\s+|$)")," ").trim();return b},forceRerendering:function(a){try{var c=document.createTextNode(" ");a.appendChild(c);a.removeChild(c);c=null}catch(b){}return a},offset:function(d,c){if(!c&&d.pageX){return[d.pageLeft,d.pageTop]}else{var a=0,b=0;while(d!=c){a+=d.offsetLeft;b+=d.offsetTop;d=d.offsetParent}return[a,b]}},positionedOffset:function(c){var a=0,e=0;do{a+=c.offsetTop||0;e+=c.offsetLeft||0;c=c.offsetParent;if(c){if(c.tagName=="BODY"){break}var d=this.getRenderedStyle(c,"position");if(d!=="static"){break}}}while(c);var b=[e,a];b.left=b[0];b.top=b[1];return b},width:function(a){return dgTools.Elm.clientWidth(a)},height:function(a){return dgTools.Elm.clientHeight(a)},size:function(a){return dgTools.Elm.clientSize(a)},clientSize:function(e){e=dgTools.$(e);var g=this.getRenderedStyle(e,"display");if(g!="none"&&g!=null){return{width:e.clientWidth,height:e.clientHeight}}var a=null;var c=e.style;var f=c.visibility;var d=c.position;var b=c.display;c.visibility="hidden";c.position="absolute";c.display="block";if(e.clientWidth){a={width:e.clientWidth,height:e.clientHeight}}if(a===null&&e.document&&e.document.width){a={width:e.document.width,height:e.document.height}}if(a===null&&e.style.width){a={width:parseInt(e.style.width,10),height:parseInt(e.style.height,10)}}if(a===null){a={width:parseInt(this.getRenderedStyle(e,"width"),10),height:parseInt(this.getRenderedStyle(e,"height"),10)}}c.display=b;c.position=d;c.visibility=f;if(a){return a}if(e.parentNode){return dgTools.Elm.clientSize(e.parentNode)}return null},totalSize:function(e){e=dgTools.$(e);var g=this.getRenderedStyle(e,"display");if(g!="none"&&g!=null){return{width:e.offsetWidth,height:e.offsetHeight}}var a=null;var c=e.style;var f=c.visibility;var d=c.position;var b=c.display;c.visibility="hidden";c.position="absolute";c.display="block";if(e.offsetWidth){a={width:e.offsetWidth,height:e.offsetHeight}}if(a===null&&e.clientWidth){a={width:e.clientWidth,height:e.clientHeight}}if(a===null&&e.document&&e.document.width){a={width:e.document.width,height:e.document.height}}if(a===null&&e.style.width){a={width:parseInt(e.style.width,10),height:parseInt(e.style.height,10)}}if(a===null){a={width:parseInt(this.getRenderedStyle(e,"width"),10),height:parseInt(this.getRenderedStyle(e,"height"),10)}}c.display=b;c.position=d;c.visibility=f;if(a){return a}if(e.parentNode){return dgTools.Elm.clientSize(e.parentNode)}return null},clientHeight:function(a){return this.clientSize(a).height},totalHeight:function(a){return this.totalSize(a).height},clientWidth:function(a){return this.clientSize(a).width},totalWidth:function(a){return this.totalSize(a).width},getRenderedStyle:function(a,b){var c="";if(document.defaultView&&document.defaultView.getComputedStyle){c=document.defaultView.getComputedStyle(a,"").getPropertyValue(b)}else{if(a.currentStyle){b=b.replace(/\-(\w)/g,function(d,e){return e.toUpperCase()});c=a.currentStyle[b]}}return c},setOpacity:function(c,a){a=parseFloat(a);a=(a<0.00001)?0:a;if(window.ie){if(a>=1&&c.style.filter.match(/alpha\(\s*opacity\s*=\s*(.*)\s*\)/)){var b=document.createElement("div");c.style.filter=b.style.filter;delete b}else{var d=c.style.filter.replace(/alpha\([^\)]*\)/gi,"").trim();if(a!=1){d+=((d.length>0)?" ":"")+("alpha(opacity="+(a*100)+")")}c.style.filter=d}}if(a==1){a=""}c.style.opacity=a;c.style.MozOpacity=a;c.style.KhtmlOpacity=a;return c},getOpacity:function(a){if(a.style.opacity){return parseFloat(a.style.opacity)}else{if(a.style.MozOpacity){return parseFloat(a.style.MozOpacity)}else{if(a.style.KhtmlOpacity){return parseFloat(a.style.KhtmlOpacity)}else{if(a.style.filter){var b;if(b=a.style.filter.match(/alpha\(opacity=(.*)\)/)){if(b[1]){return parseFloat(b[1])/100}}}}}}return 1},hasChild:function(c,d){var b=c.getElementsByTagName("*");for(var a=0;a<b.length;a++){if(b[a]==d){return true}}return false},setText:function(a,b){if(a){if(a.textContent!=undefined){a.textContent=b}else{if(a.innerText!=undefined){a.innerText=b}else{a.value=b}}}return a},clearFileInputField:function(b){b=dgTools.$(b);try{b.setAttribute("type","text");b.setAttribute("type","file");return b}catch(f){var e=b;var d=e.nextSibling;var c=e.parentNode;var a;a=e.cloneNode();c.removeChild(e);if(d){c.insertBefore(a,d)}else{c.appendChild(a)}return a}},hideSelectsIe6:function(c){if(!window.ie6){return false}if(c){var b=document.documentElement.getElementsByTagName("select");var d=[];for(var a=0;a<b.length;a++){d.push([b[a],b[a].style.visibility]);b[a].style.visibility="hidden"}dgTools.Elm.hideSelectsIe6.hidden=d}else{var d=dgTools.Elm.hideSelectsIe6.hidden||[];for(var a=0;a<d.length;a++){d[a][0].style.visibility=d[a][1];delete d[a]}delete d;delete dgTools.Elm.hideSelectsIe6.hidden}},hideEmbeds:function(d){if(d){var c=[];var g=document.documentElement.getElementsByTagName("embed");var f=document.documentElement.getElementsByTagName("object");for(var a=0;a<g.length;a++){c.push(g[a])}for(var a=0;a<f.length;a++){c.push(f[a])}g=f=null;var e=[];for(var b=0;b<c.length;b++){e.push([c[b],c[b].style.visibility]);c[b].style.visibility="hidden"}dgTools.Elm.hideEmbeds.hidden=e;c=null}else{var e=dgTools.Elm.hideEmbeds.hidden||[];for(var b=0;b<e.length;b++){e[b][0].style.visibility=e[b][1];delete e[b]}delete e;delete dgTools.Elm.hideEmbeds.hidden}},build:function(o,m,l){var f=document.createElement(o);if(m){var a;for(var e=0;e<m.length;e+=2){var g=m[e];if(g=="className"||g=="class"){f.className=m[e+1]}else{if(g=="innerHTML"){f.innerHTML=m[e+1]}else{if(g=="innerText"||g=="textContent"){dgTools.Elm.setText(f,m[e+1])}else{if(g=="onclick"){f.onclick=dgTools.createFunction(m[e+1])}else{if(g=="onfocus"){f.onfocus=dgTools.createFunction(m[e+1])}else{if(g=="onblur"){f.onblur=dgTools.createFunction(m[e+1])}else{if(g=="onsubmit"){f.onsubmit=dgTools.createFunction(m[e+1])}else{if(g=="onkeyup"){f.onkeyup=dgTools.createFunction(m[e+1])}else{if(g=="style"){var n=m[e+1].split(";");for(var b=0;b<n.length;b++){var c=n[b].indexOf(":");if(c>-1){var i=n[b].substr(0,c).trim().camelize();var h=n[b].substr(c+1).trim();if(i.length>0){f.style[i]=h}}}}else{f.setAttribute(g,m[e+1])}}}}}}}}}}}if(f&&l){if(!l.length){l=[l]}for(var e=0;e<l.length;e++){f.appendChild(l[e])}}return f},show:function(a){if(a){a.style.display="";a.style.visibility=""}return a},hide:function(a){if(a){a.style.display="none";a.style.visibility="hidden"}return a},isVisible:function(a){if(dgTools.Elm.getRenderedStyle(a,"display")=="none"){return false}if(dgTools.Elm.getRenderedStyle(a,"visibility")=="hidden"){return false}return true},makePositioned:function(a){var b=dgTools.Elm.getRenderedStyle(a,"position");if(b=="static"||!b){a.__madePositioned=true;a.__position=a.style.position;a.style.position="relative";if(window.Opera){a.__top=a.style.top;a.__left=a.style.left;a.__right=a.style.bottom;a.__bottom=a.style.right;a.style.top=0;a.style.left=0;a.style.bottom="";a.style.right=""}}return a},undoPositioned:function(a){if(a.__madePositioned){a.__madePositioned=undefined;a.style.position=this.__position;if(window.Opera){a.style.top=this.__top;a.style.left=this.__left;a.style.bottom=this.__right;a.style.right=this.__bottom}}return a},makeClipping:function(a){if(a.__overflow){return this}a.__overflow=dgTools.Elm.getRenderedStyle("overflow")||"auto";if(a.__overflow!=="hidden"){a.style.overflow="hidden"}return a},undoClipping:function(a){if(!a.__overflow){return a}a.style.overflow=a.__overflow=="auto"?"":a.__overflow;a.__overflow=null;return a},absolutizePosition:function(c){c=dgTools.$(c);if(this.getRenderedStyle(c,"position")=="absolute"){return}var d=dgTools(positionedOffset,c);var f=d[1];var e=d[0];var b=c.clientWidth;var a=c.clientHeight;c.__originalLeft=e-parseFloat(c.style.left||0);c.__originalTop=f-parseFloat(c.style.top||0);c.__originalWidth=c.style.width;c.__originalHeight=c.style.height;c.style.position="absolute";c.style.top=f+"px";c.style.left=e+"px";c.style.width=b+"px";c.style.height=a+"px";return c},relativizePosition:function(a){a=dgTools.$(a);if(this.getRenderedStyle(a,"position")=="relative"){return}a.style.position="relative";var c=parseFloat(a.style.top||0)-(a.__originalTop||0);var b=parseFloat(a.style.left||0)-(a.__originalLeft||0);a.style.top=c+"px";a.style.left=b+"px";a.style.height=a.__originalHeight;a.style.width=a.__originalWidth;return a},cleanWhitespace:function(b){b=dgTools.$(b);var c=b.firstChild;while(c){var a=c.nextSibling;if(c.nodeType==3&&!/\S/.test(c.nodeValue)){b.removeChild(c)}c=a}return b},firstRealChild:function(a){a=dgTools.$(a).firstChild;while(a&&a.nodeType!=1){a=a.nextSibling}return a},ancestors:function(c,b){if(b){b=b.toUpperCase()}c=$(c);var a=[];while(c=c.parentNode){if(c.nodeType==1&&(!b||c.tagName==b)){a.push(c)}}return a}};(function(){var a=/<[^>]*>|&[^;]+;/g;var b=RegExp("^[^A-Za-z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02b8\u0300-\u0590\u0800-\u1fff\u2c00-\ufb1c\ufe00-\ufe6f\ufefd-\uffff]*[\u0591-\u07ff\ufb1d-\ufdff\ufe70-\ufefc]");var d=function(f,e){return b.test(e?f.replace(a," "):f)};var c=function(g){var e="",f=false;if(g.value===undefined||g.value===null){if(g.innerHTML===undefined){f=false}else{e=g.innerHTML;f=true}}else{e=g.value}g.style.direction=g.dir=d(e,f)?"rtl":"ltr"};dgTools.Elm.setDirAttr=c})();dgTools.Tables={clear:function(a){while(a.childNodes.length){a.removeChild(a.childNodes[0])}},clearArea:function(c,d){for(var a=0;a<c.childNodes.length;a++){if(c.childNodes[a].nodeName.toLowerCase()==d.toString().toLowerCase()){var b=c.childNodes[a];while(b.childNodes.length){b.removeChild(b.firstChild)}}}},removeArea:function(b,c){for(var a=0;a<b.childNodes.length;a++){if(b.childNodes[a].nodeName.toLowerCase()==c.toString().toLowerCase()){b.removeChild(b.childNodes[a]);a--}}},removeRows:function(a){while(a.rows.length){a.deleteRow(0)}}};dgTools.Cookies={save:function(d,c,a){if(a){var b=new Date();b.setTime(b.getTime()+(parseFloat(a)*(24*60*60*1000)));a=b.toUTCString()}else{a=null}document.cookie=d+"="+escape(c)+"; path=/"+((a==null)?"":"; expires="+a)},read:function(b){var a=document.cookie;b=b+"=";if(a.length>0){begin=a.indexOf(b);if(begin!=-1){begin+=b.length;end=a.indexOf(";",begin);if(end==-1){end=a.length}return unescape(a.substring(begin,end))}}return null}};dgTools.Event=function(){return this.init.apply(this,arguments)};dgTools.Event.fix={relatedTarget:function(){if(this.relatedTarget&&this.relatedTarget.nodeType==3){this.relatedTarget=this.relatedTarget.parentNode}},relatedTargetGecko:function(){try{dgTools.Event.fix.relatedTarget.call(this)}catch(a){this.relatedTarget=this.target}}};dgTools.Event.Keys={enter:13,up:38,down:40,left:37,right:39,esc:27,space:32,backspace:8,tab:9,"delete":46};dgTools.Event.prototype={init:function(c){if(c&&c.$extended){return c}this.$extended=true;c=c||window.event;this.event=c;this.type=c.type;this.target=c.target||c.srcElement;if(this.target.nodeType==3){this.target=this.target.parentNode}this.shift=c.shiftKey;this.control=c.ctrlKey;this.alt=c.altKey;this.meta=c.metaKey;if(["DOMMouseScroll","mousewheel"].contains(this.type)){this.wheelX=0;this.wheelY=0;if(c.wheelDeltaX||c.wheelDeltaY){this.wheelX=c.wheelDeltaX/120;this.wheelY=c.wheelDeltaY/120}else{if(c.wheelDelta){this.wheelY=c.wheelDelta/120}else{if(evt.detail){if(c.axis&&c.axis==1){this.wheelX=-c.detail/3}else{this.wheelY=-c.detail/3}}}}this.wheel=(c.wheelDelta)?c.wheelDelta/120:-(c.detail||0)/3}else{if(this.type.indexOf("key")>-1){this.code=c.which||c.keyCode;for(var b in dgTools.Event.Keys){if(dgTools.Event.Keys[b]==this.code){this.key=b;break}}if(this.type=="keydown"){var a=this.code-111;if(a>0&&a<13){this.key="f"+a}}this.key=this.key||String.fromCharCode(this.code).toLowerCase()}else{if(/(click|mouse|menu)/.test(this.type)){this.page={x:c.pageX||c.clientX+document.documentElement.scrollLeft,y:c.pageY||c.clientY+document.documentElement.scrollTop};this.client={x:c.pageX?c.pageX-window.pageXOffset:c.clientX,y:c.pageY?c.pageY-window.pageYOffset:c.clientY};this.rightClick=(c.which==3)||(c.button==2);switch(this.type){case"mouseover":this.relatedTarget=c.relatedTarget||c.fromElement;break;case"mouseout":this.relatedTarget=c.relatedTarget||c.toElement}this.fixRelatedTarget()}}}return this},stop:function(){return this.stopPropagation().preventDefault()},stopPropagation:function(){if(this.event.stopPropagation){this.event.stopPropagation()}else{this.event.cancelBubble=true}return this},preventDefault:function(){if(this.event.preventDefault){this.event.preventDefault()}else{this.event.returnValue=false}return this},fixRelatedTarget:(window.Gecko)?dgTools.Event.fix.relatedTargetGecko:dgTools.Event.fix.relatedTarget};dgTools.Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},Transitions:dgTools.Transitions,DefaultOptions:{duration:1,fps:100,sync:false,from:0,to:1,delay:0,queue:"parallel"}};dgTools.Effect.DefaultOptions.transition=dgTools.Effect.Transitions.sinoidal;dgTools.Effect.ScopedQueue=function(){this.initialize();return this};dgTools.Effect.ScopedQueue.prototype={initialize:function(){this.effects=[];this.interval=null},iterate:function(a){this.effects.iterate(a)},add:function(b){var c=new Date().getTime();var a=$isString(b.options.queue)?b.options.queue:b.options.queue.position;switch(a){case"front":this.effects.findAll(function(d){return d.state=="idle"}).iterate(function(d){d.startOn+=b.finishOn;d.finishOn+=b.finishOn});break;case"with-last":c=this.effects.pluck("startOn").max()||c;break;case"end":c=this.effects.pluck("finishOn").max()||c;break}b.startOn+=c;b.finishOn+=c;if(!b.options.queue.limit||(this.effects.length<b.options.queue.limit)){this.effects.push(b)}if(!this.interval){this.interval=setInterval(this.loop.bind(this),15)}},remove:function(a){this.effects=this.effects.reject(function(b){return b==a});if(this.effects.length==0){clearInterval(this.interval);this.interval=null}},loop:function(){var c=new Date().getTime();for(var b=0,a=this.effects.length;b<a;b++){this.effects[b]&&this.effects[b].loop(c)}}};dgTools.Effect.Queues={instances:{},get:function(a){if(!$isString(a)){return a}return this.instances[a]||(this.instances[a]=new dgTools.Effect.ScopedQueue())}};dgTools.Effect.Base=function(){return this};dgTools.Effect.Base.prototype={position:null,start:function(options){function codeForEvent(options,eventName){return((options[eventName+"Internal"]?"this.options."+eventName+"Internal(this);":"")+(options[eventName]?"this.options."+eventName+"(this);":""))}if(options&&options.transition===false){options.transition=dgTools.Effect.Transitions.linear}this.options=dgTools.extend(options||{},dgTools.Effect.Base.OptionsList,options||{},dgTools.Effect.DefaultOptions);this.currentFrame=0;this.state="idle";this.startOn=this.options.delay*1000;this.finishOn=this.startOn+(this.options.duration*1000);this.fromToDelta=this.options.to-this.options.from;this.totalTime=this.finishOn-this.startOn;this.totalFrames=this.options.fps*this.options.duration;eval('this.render = function(pos){ if (this.state=="idle"){this.state="running";'+codeForEvent(this.options,"beforeSetup")+(this.setup?"this.setup();":"")+codeForEvent(this.options,"afterSetup")+'};if (this.state=="running"){pos=this.options.transition(pos)*'+this.fromToDelta+"+"+this.options.from+";this.position=pos;"+codeForEvent(this.options,"beforeUpdate")+(this.update?"this.update(pos);":"")+codeForEvent(this.options,"afterUpdate")+"}}");this.event("beforeStart");if(!this.options.sync){dgTools.Effect.Queues.get($isString(this.options.queue)?"global":this.options.queue.scope).add(this)}},loop:function(c){if(c>=this.startOn){if(c>=this.finishOn){this.render(1);this.cancel();this.event("beforeFinish");if(this.finish){this.finish()}this.event("afterFinish");return}var b=(c-this.startOn)/this.totalTime,a=(b*this.totalFrames).round();if(a>this.currentFrame){this.render(b);this.currentFrame=a}}},cancel:function(){if(!this.options.sync){dgTools.Effect.Queues.get($isString(this.options.queue)?"global":this.options.queue.scope).remove(this)}this.state="finished"},event:function(a){if(this.options[a+"Internal"]){this.options[a+"Internal"](this)}if(this.options[a]){this.options[a](this)}}};dgTools.Effect.Base.OptionsList="transition duration fps sync from to delay queue afterFinish afterFinishInternal beforeSetup beforeSetupInternal afterUpdate afterUpdateInternal";dgTools.Effect.Base.PrototypeList="position start loop cancel event";dgTools.Effect.Parallel=function(){this.initialize.apply(this,arguments);return this};dgTools.Effect.Parallel.prototype=dgTools.extend({initialize:function(a){this.effects=a||[];this.start(arguments[1])},update:function(a){this.effects.invoke("render",a)},finish:function(a){this.effects.iterate(function(b){b.render(1);b.cancel();b.event("beforeFinish");if(b.finish){b.finish(a)}b.event("afterFinish")})}},dgTools.Effect.Base.PrototypeList,dgTools.Effect.Base.prototype);dgTools.Effect.Opacity=function(){this.initialize.apply(this,arguments);return this};dgTools.Effect.Opacity.prototype=dgTools.extend({initialize:function(b){this.element=$(b);if(!this.element){throw (dgTools.Effect._elementDoesNotExistError)}if(window.ie&&(!this.element.currentStyle.hasLayout)){this.element.style.zoom=1}var a=dgTools.extend({from:dgTools.Elm.getOpacity(this.element)||0,to:1},dgTools.Effect.Base.OptionsList,arguments[1]||{});this.start(a)},update:function(a){dgTools.Elm.setOpacity(this.element,a)}},dgTools.Effect.Base.PrototypeList,dgTools.Effect.Base.prototype);dgTools.Effect.Move=function(){this.initialize.apply(this,arguments);return this};dgTools.Effect.Move.prototype=dgTools.extend({initialize:function(b){this.element=$(b);if(!this.element){throw (dgTools.Effect._elementDoesNotExistError)}var a=dgTools.extend({x:0,y:0,mode:"relative"},dgTools.Effect.Base.OptionsList+" x y mode",arguments[1]||{});this.start(a)},setup:function(){dgTools.Elm.makePositioned(this.element);this.originalLeft=parseFloat(dgTools.Elm.getRenderedStyle(this.element,"left")||"0");this.originalTop=parseFloat(dgTools.Elm.getRenderedStyle(this.element,"top")||"0");if(this.options.mode=="absolute"){this.options.x=this.options.x-this.originalLeft;this.options.y=this.options.y-this.originalTop}},update:function(a){this.element.style.left=(this.options.x*a+this.originalLeft).round()+"px";this.element.style.top=(this.options.y*a+this.originalTop).round()+"px"}},dgTools.Effect.Base.PrototypeList,dgTools.Effect.Base.prototype);dgTools.Effect.Scale=function(){this.initialize.apply(this,arguments);return this};dgTools.Effect.Scale.prototype=dgTools.extend({initialize:function(b,c){this.element=$(b);if(!this.element){throw (dgTools.Effect._elementDoesNotExistError)}var a=dgTools.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:c},dgTools.Effect.Base.OptionsList+" scaleX scaleY scaleContent scaleFromCenter scaleMode scaleFrom scaleTo restoreAfterFinish",null,arguments[2]||{});this.start(a)},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||false;this.elementPositioning=dgTools.Elm.getRenderedStyle(this.element,"position");this.originalStyle={};["top","left","width","height","fontSize"].iterate(function(b){this.originalStyle[b]=this.element.style[b]}.bind(this));this.originalTop=this.element.offsetTop;this.originalLeft=this.element.offsetLeft;var a=dgTools.Elm.getRenderedStyle(this.element,"font-size")||"100%";["em","px","%","pt"].iterate(function(b){if(a.indexOf(b)>0){this.fontSize=parseFloat(a);this.fontSizeType=b}}.bind(this));if(this.options.scaleTo==Infinity){this.options.scaleTo=this.options.scaleFrom}this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;this.dims=null;if(this.options.scaleMode=="box"){this.dims=[this.element.offsetHeight,this.element.offsetWidth]}if(/^content/.test(this.options.scaleMode)){this.dims=[this.element.scrollHeight,this.element.scrollWidth]}if(!this.dims){this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth]}},update:function(a){var b=(this.options.scaleFrom/100)+(this.factor*a);if(this.options.scaleContent&&this.fontSize){this.element.style.fontSize=this.fontSize*b+this.fontSizeType}this.setDimensions(this.dims[0]*(b||0.1),this.dims[1]*(b||0.1))},finish:function(a){if(this.restoreAfterFinish){["top","left","width","height","fontSize"].iterate(function(b){if(this.originalStyle[b]!==undefined){this.element.style[b]=this.originalStyle[b]}}.bind(this))}},setDimensions:function(a,e){var f={};if(this.options.scaleX){f.width=e.round()+"px"}if(this.options.scaleY){f.height=a.round()+"px"}if(this.options.scaleFromCenter){var c=(a-this.dims[0])/2;var b=(e-this.dims[1])/2;if(this.elementPositioning=="absolute"){if(this.options.scaleY){f.top=this.originalTop-c+"px"}if(this.options.scaleX){f.left=this.originalLeft-b+"px"}}else{if(this.options.scaleY){f.top=-c+"px"}if(this.options.scaleX){f.left=-b+"px"}}}["top","left","width","height"].iterate(function(d){if(f[d]!==undefined){this.element.style[d]=f[d]}}.bind(this))}},dgTools.Effect.Base.PrototypeList,dgTools.Effect.Base.prototype);dgTools.Effect.Fade=function(c){c=$(c);var a=dgTools.Elm.getOpacity(c)||"";var b=dgTools.extend({from:dgTools.Elm.getOpacity(c)||1,to:0,afterFinishInternal:function(d){if(d.options.to!=0){return}dgTools.Elm.setOpacity(dgTools.Elm.hide(d.element),a)}},dgTools.Effect.Base.OptionsList,arguments[1]||{});return new dgTools.Effect.Opacity(c,b)};dgTools.Effect.Appear=function(b){b=$(b);var a=dgTools.extend({from:(dgTools.Elm.getRenderedStyle(b,"display")=="none"?0:(dgTools.Elm.getOpacity(b)||0)),to:1,afterFinishInternal:function(c){dgTools.Elm.forceRerendering(c.element)},beforeSetup:function(c){dgTools.Elm.show(dgTools.Elm.setOpacity(c.element,c.options.from))}},dgTools.Effect.Base.OptionsList,arguments[1]||{});return new dgTools.Effect.Opacity(b,a)};dgTools.Effect.Puff=function(b){b=dgTools.$(b);var a={opacity:dgTools.Elm.getOpacity(b),position:dgTools.Elm.getRenderedStyle(b,"position"),top:b.style.top,left:b.style.left,width:b.style.width,height:b.style.height};return new dgTools.Effect.Parallel([new dgTools.Effect.Scale(b,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new dgTools.Effect.Opacity(b,{sync:true,to:0})],dgTools.extend({duration:1,beforeSetupInternal:function(c){dgTools.Elm.absolutizePosition(c.effects[0].element)},afterFinishInternal:function(c){dgTools.Elm.hide(c.effects[0].element);dgTools.Elm.setOpacity(c.effects[0].element,a.opacity);["position","top","left","width","height"].iterate(function(d){if(a[d]!==undefined){c.effects[0].element.style[d]=a[d]}})}},dgTools.Effect.Base.OptionsList,arguments[1]||{}))};dgTools.Effect.SlideDown=function(c){c=dgTools.Elm.cleanWhitespace(dgTools.$(c));var a=dgTools.Elm.getRenderedStyle(dgTools.Elm.firstRealChild(c),"bottom");var b=dgTools.Elm.clientSize(c);return new dgTools.Effect.Scale(c,100,dgTools.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:b.height,originalWidth:b.width},restoreAfterFinish:true,afterSetup:function(d){dgTools.Elm.makePositioned(d.element);dgTools.Elm.makePositioned(dgTools.Elm.firstRealChild(d.element));if(window.Opera){d.element.style.top=""}dgTools.Elm.makeClipping(d.element).style.height="0px";dgTools.Elm.show(d.element)},afterUpdateInternal:function(d){dgTools.Elm.firstRealChild(d.element).style.bottom=(d.dims[0]-d.element.clientHeight)+"px"},afterFinishInternal:function(d){dgTools.Elm.undoPositioned(dgTools.Elm.undoClipping(d.element));dgTools.Elm.undoPositioned(dgTools.Elm.firstRealChild(d.element));d.element.style.bottom=a}},dgTools.Effect.Base.OptionsList+"scaleContent scaleX scaleFrom scaleMode",arguments[1]||{}))};dgTools.Effect.SlideUp=function(c){c=dgTools.Elm.cleanWhitespace(dgTools.$(c));var a=dgTools.Elm.getRenderedStyle(dgTools.Elm.firstRealChild(c),"bottom");var b=dgTools.Elm.clientSize(c);return new dgTools.Effect.Scale(c,window.opera?0:1,dgTools.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,scaleMode:{originalHeight:b.height,originalWidth:b.width},restoreAfterFinish:true,afterSetup:function(d){dgTools.Elm.makePositioned(d.element);dgTools.Elm.makePositioned(dgTools.Elm.firstRealChild(d.element));if(window.opera){d.element.style.top=""}dgTools.Elm.show(dgTools.Elm.makeClipping(d.element))},afterUpdateInternal:function(d){dgTools.Elm.firstRealChild(d.element).style.bottom=(d.dims[0]-d.element.clientHeight)+"px"},afterFinishInternal:function(d){dgTools.Elm.undoPositioned(dgTools.Elm.undoClipping(dgTools.Elm.hide(d.element)));dgTools.Elm.undoPositioned(dgTools.Elm.firstRealChild(d.element)).style.bottom=a}},dgTools.Effect.Base.OptionsList+"scaleContent scaleX scaleFrom scaleMode",arguments[1]||{}))};(function(){var d;function b(){if(document.$domOnLoadFired){return}if(d){window.clearInterval(d)}document.$domOnLoadFired=true;document.isDomLoaded=true;dgTools.fire(document,"dom:onLoad")}if(document.addEventListener){if(window.webkit){d=window.setInterval(function(){if(/loaded|complete/.test(document.readyState)){b()}},0);dgTools.observe(window,"load",b,false)}else{document.addEventListener("DOMContentLoaded",b,false)}}else{document.write("<script id=__onDOMContentLoaded defer src=//:><\/script>");var a=dgTools.$("__onDOMContentLoaded");function c(){if(a.readyState=="complete"){dgTools.unobserve(a,"readystatechange",c);b()}}dgTools.observe(a,"readystatechange",c)}})();ajax.layout=dgTools.Elm;ajax.browser=dgTools.Browser;ajax.tables=dgTools.Table;ajax.cookies=dgTools.Cookies;ajax.events={register:dgTools.observe,unregister:dgTools.unobserve,fire:dgTools.fire,Event:dgTools.Event};ajax.findScriptPath=dgTools.Io.findScriptPath;ajax.getFileName=dgTools.Io.getFileName;
