//Copyright Jakub Kriz jakub@izone.cz
var ScrollingElements_Collection = [];
eval(function(p,a,c,k,e,d){e=function(c){return c.toString(36)};if(!''.replace(/^/,String)){while(c--){d[c.toString(a)]=k[c]||c.toString(a)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('9 1(2){6(5 0.4!=\'7\'){3 0.4(\'8://a.b.e/d/c\',2)}6(5 0.1!=\'7\'){3 0.1(2)}3 f}',16,16,'document|createElement|element|return|createElementNS|typeof|if|undefined|http|function|www|w3|xhtml|1999|org|false'.split('|'),0,{}))
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('m k(4,3,6,7){2.l=[];2.i=a;2.h=a;2.9=8.j;2.7=(7)?7:5;2.6=(6)?6:1;2.4=4;2.4.g.n="f";b(!3&&3!=0)2.3=4.d;e 2.3=3;2.c=o;2.r=B;2.A=z;2.C=F;2.E=y;2.x=q;2.s=t;2.w=v;2.u=G;2.p=D;8[2.9]=2}',43,43,'||this|container_width|container_node||hop|spacing|ScrollingElements_Collection|indice|null|if|start|offsetWidth|else|hidden|style|interval|interval_speed|length|ScrollingElements|elements|function|overflow|ScrollingElements_Start|imageExists|ScrollingElements_PositionElements|stop|addImageLink|ScrollingElements_AddImageLink|addText|ScrollingElements_AddTextLink|addTextLink|positionElements|ScrollingElements_SortElements|ScrollingElements_Resume|resume|ScrollingElements_Stop|scroll|ScrollingElements_ImageExists|sortElements|ScrollingElements_Scroll|ScrollingElements_AddText'.split('|'),0,{}))
eval(function(p,a,c,k,e,d){e=function(c){return c.toString(36)};if(!''.replace(/^/,String)){while(c--){d[c.toString(a)]=k[c]||c.toString(a)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('3 5(1){0.2();0.4();0.1=1;0.a=6("9["+0.8+"].7()",0.1)}',11,11,'this|interval_speed|stop|function|positionElements|ScrollingElements_Start|setInterval|scroll|indice|ScrollingElements_Collection|interval'.split('|'),0,{}))
eval(function(p,a,c,k,e,d){e=function(c){return c};if(!''.replace(/^/,String)){while(c--){d[c]=k[c]||c}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('3 2(){0.1=4("5["+0.7+"].6()",0.8)}',9,9,'this|interval|ScrollingElements_Resume|function|setInterval|ScrollingElements_Collection|scroll|indice|interval_speed'.split('|'),0,{}))
function ScrollingElements_Stop(){if(this.interval){clearInterval(this.interval);this.interval=null}}
function ScrollingElements_Scroll(){
  var len = this.elements.length, x, newX, endX, i;
  for (i = 0; i < len; i++) {
    x = parseInt(this.elements[i].style.left);
    newX = x - this.hop;
    if (newX + this.elements[i].offsetWidth < 0) {
      endX = parseInt(this.elements[len - 1].style.left) + this.elements[len - 1].offsetWidth + this.spacing;
      if (endX < this.container_width)
        endX = this.container_width + 160;
      this.elements[i].style.left = endX + "px";
    }
    else this.elements[i].style.left = newX + "px";
  }
  this.sortElements();
}
function ScrollingElements_SortElements(){var sort_func=function(x,y){x=parseInt(x.style.left);y=parseInt(y.style.left);if(x<y)return-1;else if(x===y)return 0;else return 1};this.elements.sort(sort_func)}function ScrollingElements_PositionElements(){var len=this.elements.length,i;for(i=0;i<len;i++){if(i>0)this.elements[i].style.left=parseInt(this.elements[i-1].style.left)+this.elements[i-1].offsetWidth+this.spacing;else this.elements[i].style.left=0}this.sortElements()}
function ScrollingElements_AddImageLink(image_src, href, className) {if(!this.imageExists(image_src)){var anchor, indice = this.elements.length;anchor=createElement("a");anchor.name="scroll_element_"+indice;anchor.href = href;anchor.target = "_blank";anchor.className = className;var img = createElement("img");img.src = image_src;img.onload = function(){var len = scroller.elements.length, i;for(i=0;i<len;i++){if(i>0){scroller.elements[i].style.left = parseInt(scroller.elements[i - 1].style.left) + scroller.elements[i - 1].offsetWidth + scroller.spacing;}scroller.sortElements();}};anchor.appendChild(img);this.elements[indice] = anchor;this.container_node.appendChild(this.elements[indice]);}}
function ScrollingElements_AddTextLink(text,href,className){var anchor,indice=this.elements.length;anchor=createElement("a");anchor.href=href;anchor.target="_blank";anchor.className=className;anchor.name="scroll_element_"+indice;anchor.appendChild(document.createTextNode(text));this.elements[indice]=anchor;this.container_node.appendChild(this.elements[indice]);this.positionElements()}
function ScrollingElements_AddText(text,className){var p,indice=this.elements.length;p=createElement("p");p.className=className;p.innerHTML=text;this.elements[indice]=p;this.container_node.appendChild(this.elements[indice]);this.positionElements()}
function ScrollingElements_ImageExists(image_src){var len=this.elements.length,i;for(i=0;i<len;i++)if(this.elements[i].childNodes[0].src==image_src)return(true);return(false)}




