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}('f 3T(1d,o,28){8 1E=t 3R();1E.3O(1E.3W()+28);p.17=1d+"="+2H(o)+((28==1x)?"":";3G="+1E.3H())}f 4m(1d){5(p.17.l>0){15=p.17.O(1d+"=");5(15!=-1){15=15+1d.l+1;1I=p.17.O(";",15);5(1I==-1){1I=p.17.l}7 4a(p.17.2g(15,1I))}}7""}5(1w k=="1Q"){8 k=t 1c()}5(1w k.1h=="1Q"){k.1h=t 1c()}5(1w k.1A=="1Q"){k.1A=t 1c()}k.1g=f(20,L,w,h,1R,c,24,2c,22,1q,1S){5(!p.44||!p.2G){7}4.2s=1S?1S:"4c";4.31=k.1h.1Y(4.2s);4.27=t 1c();4.1t=t 1c();4.26=t 1u();5(20){4.D("1Z",20)}5(L){4.D("L",L)}5(w){4.D("1b",w)}5(h){4.D("1a",h)}5(1R){4.D("1i",t k.P(1R.1m().1j(".")))}4.1y=k.1A.2R(4.m("1i"),24);5(c){4.2b("45",c)}8 q=2c?2c:"3f";4.2b("3g",q);4.D("2t",24);4.D("1f",C);8 2d=(22)?22:1n.1o;4.D("2Y",2d);4.D("1H","");5(1q){4.D("1H",1q)}};k.1g.1v={D:f(2f,2e){4.26[2f]=2e},m:f(2l){7 4.26[2l]},2b:f(2x,2Q){4.27[2x]=2Q},1V:f(){7 4.27},1e:f(2U,2S){4.1t[2U]=2S},3h:f(32){7 4.1t[32]},30:f(){7 4.1t},1O:f(){8 2a=t 1u();8 H;8 23=4.30();K(H 1W 23){2a.1U(H+"="+23[H])}7 2a},2D:f(){8 F="";5(Y.1L&&Y.1N&&Y.1N.l){5(4.m("1f")){4.1e("2M","3i")}F="<3e Q=\\"3d/x-39-3a\\" 3b=\\""+4.m("1Z")+"\\" 1b=\\""+4.m("1b")+"\\" 1a=\\""+4.m("1a")+"\\"";F+=" L=\\""+4.m("L")+"\\" N=\\""+4.m("L")+"\\" ";8 21=4.1V();K(8 H 1W 21){F+=[H]+"=\\""+21[H]+"\\" "}8 29=4.1O().2j("&");5(29.l>0){F+="2m=\\""+29+"\\""}F+="/>"}18{5(4.m("1f")){4.1e("2M","3c")}F="<2y L=\\""+4.m("L")+"\\" 3k=\\"3r:3s-3t-3u-3q-3p\\" 1b=\\""+4.m("1b")+"\\" 1a=\\""+4.m("1a")+"\\">";F+="<1T N=\\"38\\" o=\\""+4.m("1Z")+"\\" />";8 1X=4.1V();K(8 H 1W 1X){F+="<1T N=\\""+H+"\\" o=\\""+1X[H]+"\\" />"}8 1P=4.1O().2j("&");5(1P.l>0){F+="<1T N=\\"2m\\" o=\\""+1P+"\\" />"}F+="</2y>"}7 F},3o:f(1F){5(4.m("2t")){8 2F=t k.P([6,0,3v]);5(4.1y.1J(2F)&&!4.1y.1J(4.m("1i"))){4.D("1f",T);4.1e("36",2H(4.m("2Y")));p.v=p.v.35(0,47)+" - 2V 3m 4f";4.1e("4e",p.v)}}5(4.31||4.m("1f")||4.1y.1J(4.m("1i"))){8 n=(1w 1F=="4g")?p.2G(1F):1F;5(!n)7 C;n.4h=4.2D();7 T}18{5(4.m("1H")!=""){p.1o.1C(4.m("1H"))}}7 C}};k.1A.2R=f(W,2o){8 J=t k.P([0,0,0]);5(Y.1L&&Y.1N.l){8 x=Y.1L["4j 2V"];5(x&&x.2q){J=t k.P(x.2q.1C(/([a-z]|[A-Z]|\\s)+/,"").1C(/(\\s+r|\\s+b[0-9]+)/,".").1j("."))}}18{2p{8 1G=t 2r("1D.1D");K(8 i=3;1G!=1x;i++){1G=t 2r("1D.1D."+i);J=t k.P([i,0,0])}}2z(e){}5(W&&J.I>W.I){7 J}5(!W||((W.13!=0||W.1B!=0)&&J.I==W.I)||J.I!=6||2o){2p{J=t k.P(1G.3w("$1i").1j(" ")[1].1j(","))}2z(e){}}}7 J};k.P=f(19){4.I=1p(19[0])!=1x?1p(19[0]):0;4.13=1p(19[1])||0;4.1B=1p(19[2])||0};k.P.1v.1J=f(14){5(4.I<14.I){7 C}5(4.I>14.I){7 T}5(4.13<14.13){7 C}5(4.13>14.13){7 T}5(4.1B<14.1B){7 C}7 T};k.1h={1Y:f(2k){8 q=p.1o.49||p.1o.4b;5(q){8 1k=q.O(2k+"=");8 2i=(q.O("&",1k)>-1)?q.O("&",1k):q.l;5(q.l>1&&1k>-1){7 q.2g(q.O("=",1k)+1,2i)}}7""}};5(1u.1v.1U==1x){1u.1v.1U=f(2W){4[4.l]=2W;7 4.l}}8 4k=k.1h.1Y;8 4v=k.1g;8 1g=k.1g;f 2h(){8 4w,G=p.4x;K(8 i=0,R=G.l;i<R;i++){G[i].4z=34}}f 34(){B="";K(8 M,4y,G=4.4s,i=0,R=G.l;i<R;i++){M=G[i];1M=M.4n;5(1M!=""){2I(G,M,1M.1j(" "))}}5(B!=""){1n.4o(B);7 C}18{7 T}}f 2I(G,d,1K){K(8 X,V,i=0,R=1K.l;i<R;i++){X=1K[i];U(X){g"4p":{U(d.Q){g"11":g"12":g"16":{5(d.o==""){B+=4r+" \'"+d.v+"\' "+4q+"\\n";7}u}g"2E-43":{5(d.2J.2K==0){B+=2P+" \'"+d.v+"\' "+2O+"\\n";7}u}g"2E-42":{5(d.2J.2K==-1){B+=2P+" \'"+d.v+"\' "+2O+"\\n";7}u}g"2X":{5(d.N!=2N){2N=d.N;K(8 25=C,j=0,2L=G.l;j<2L;j++){M=G[j];5(M.Q=="2X"&&M.N==d.N&&M.3I){25=T}}5(!25){B+=3J+" \'"+d.v+"\' "+3L+"\\n";7}}u}}u}g"3K":{U(d.Q){g"11":g"12":g"16":{8 E=d.o;5(1r(E)||!2u(E)||E<1){B+=3F+" \'"+d.v+"\' "+3E+"\\n";7}u}}u}g"3z":{U(d.Q){g"11":g"12":g"16":{d.o=2A(d.o);5(1r(d.o)||!2B(d.o)){B+=3y+" \'"+d.v+"\' "+3x+"\\n";7}u}}u}g"3A":{U(d.Q){g"11":g"12":g"16":{8 E=d.o;5(E.l>0&&!2C(E)){B+=3B+" \'"+d.v+"\' "+3D+"\\n";7}u}}u}g"3C":{U(d.Q){g"11":g"12":g"16":{8 E=d.o;5(E.l>0&&!2T(E)){B+=3M+" \'"+d.v+"\' "+3N+"\\n";7}u}}u}g"3X":{U(d.Q){g"11":g"12":g"16":{8 E=d.o;5(!33(E)){B+=3Z+" \'"+d.v+"\' "+41+"\\n";7}u}}u}40:{5(X.O("3V")>0){V=X.2v(6);5(d.o.l<V){B+=3U+" \'"+d.v+"\' "+3P+" "+V+"\\n";7}}18{5(X.O("3Q")>0){V=X.2v(6);5(d.o.l>V){B+=3S+" \'"+d.v+"\' "+4i+" "+V+"\\n";7}}}u}}}}f 2u(x){8 y=1p(x,10);5(1r(y)){7 C}7 x==y&&x.1m()==y.1m()}f 2B(x){8 y=3Y(x);5(1r(y)){7 C}7 x==y&&x.1m()==y.1m()}f 2C(2Z){7/^[1q-1l-1z-9-]+(\\.[1q-1l-1z-9-]+)*@[a-1l-1z-9-]+(\\.[a-1l-1z-9-]+)*(\\.[a-1l-Z]{2,3})$/.2n(2Z)}f 2T(2w){7/(4u|4l):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?/.2n(2w)}f 2A(1s){7 1s.1C(/,/46,".")}f 33(1s){K(8 i=0,R=1s.l;i<R;i++){5(1r(1s.37(i))){7 C}}7 T}f 3n(){1n.1o="3l:"+1n.3j(4d)+48;7 C}1n.4t=2h;',62,284,'||||this|if||return|var|||||field||function|case||||deconcept|length|getAttribute||value|document||||new|break|title||||||err|false|setAttribute|field_value|_19|ref|key|major|_25|for|id|current_element|name|indexOf|PlayerVersion|type|i_length||true|switch|current_length|_23|current_rule|navigator|||text|password|minor|fv|c_start|textarea|cookie|else|_29|height|width|Object|c_name|addVariable|doExpressInstall|SWFObject|util|version|split|_2d|zA|toString|window|location|parseInt|_a|isNaN|num|variables|Array|prototype|typeof|null|installedVer|Z0|SWFObjectUtil|rev|replace|ShockwaveFlash|exdate|_20|axo|redirectUrl|c_end|versionIsValid|rules|plugins|current_element_class|mimeTypes|getVariablePairs|_1f|undefined|_5|_b|param|push|getParams|in|_1d|getRequestParameter|swf|_1|_1a|_9|_18|_7|element_checked|attributes|params|expiredays|_1c|_16|addParam|_8|_d|_f|_e|substring|A_set_onsubmit_handlers|_2e|join|_2b|_10|flashvars|test|_24|try|description|ActiveXObject|DETECT_KEY|useExpressInstall|A_is_integer|substr|url|_11|object|catch|A_replace_comma|A_is_float|A_is_email|getSWFHTML|select|_21|getElementById|escape|A_check_field|options|selectedIndex|j_length|MMplayerType|last_checked_element|A_FORM_REQUIRED_SELECT2|A_FORM_REQUIRED_SELECT1|_12|getPlayerVersion|_14|A_is_url|_13|Flash|_2f|radio|xiRedirectUrl|email|getVariables|skipDetect|_15|A_is_digit|A_validate_form|slice|MMredirectURL|charAt|movie|shockwave|flash|src|ActiveX|application|embed|high|quality|getVariable|PlugIn|prompt|classid|mailto|Player|A_recommend_page|write|444553540000|96B8|clsid|D27CDB6E|AE6D|11cf|65|GetVariable|A_FORM_FLOAT_TEXT2|A_FORM_FLOAT_TEXT1|A_float|A_email|A_FORM_EMAIL_TEXT1|A_url|A_FORM_EMAIL_TEXT2|A_FORM_NATURAL_TEXT2|A_FORM_NATURAL_TEXT1|expires|toGMTString|checked|A_FORM_REQUIRED_RADIO1|A_natural|A_FORM_REQUIRED_RADIO2|A_FORM_URL_TEXT1|A_FORM_URL_TEXT2|setDate|A_FORM_MIN2|_max_|Date|A_FORM_MAX1|A_set_cookie|A_FORM_MIN1|_min_|getDate|A_digit|parseFloat|A_FORM_DIGIT_TEXT1|default|A_FORM_DIGIT_TEXT2|multiple|one|createElement|bgcolor|gi||A_RECOMMEND_PAGE_TEXT|search|unescape|hash|detectflash|A_RECOMMEND_PAGE_ENTER_EMAIL|MMdoctitle|Installation|string|innerHTML|A_FORM_MAX2|Shockwave|getQueryParamValue|https|A_get_cookie|className|alert|A_required|A_FORM_REQUIRED_TEXT2|A_FORM_REQUIRED_TEXT1|elements|onload|http|FlashObject|current_form|forms|current_type|onsubmit'.split('|'),0,{}))




/*******************************************************************************************************************************************/

/*
  A_sortable
  pouzitie: pridajte do class tabulky A_sortable
*/


var stIsIE = /*@cc_on!@*/false;

sorttable = {
  init: function() {
    // quit if this function has already been called
    if (arguments.callee.done) return;
    // flag this function so we don't do the same thing twice
    arguments.callee.done = true;
    // kill the timer
    if (_timer) clearInterval(_timer);

    if (!document.createElement || !document.getElementsByTagName) return;

    sorttable.DATE_RE = /^(\d\d?)[\/\.-](\d\d?)[\/\.-]((\d\d)?\d\d)$/;

    forEach(document.getElementsByTagName('table'), function(table) {
      if (table.className.search(/\bA_sortable\b/) != -1) {
        sorttable.makeSortable(table);
      }
    });

  },

  makeSortable: function(table) {
    if (table.getElementsByTagName('thead').length == 0) {
      // table doesn't have a tHead. Since it should have, create one and
      // put the first table row in it.
      the = document.createElement('thead');
      the.appendChild(table.rows[0]);
      table.insertBefore(the,table.firstChild);
    }
    // Safari doesn't support table.tHead, sigh
    if (table.tHead == null) table.tHead = table.getElementsByTagName('thead')[0];

    if (table.tHead.rows.length != 1) return; // can't cope with two header rows

    // Sorttable v1 put rows with a class of "sortbottom" at the bottom (as
    // "total" rows, for example). This is B&R, since what you're supposed
    // to do is put them in a tfoot. So, if there are sortbottom rows,
    // for backwards compatibility, move them to tfoot (creating it if needed).
    sortbottomrows = [];
    for (var i=0; i<table.rows.length; i++) {
      if (table.rows[i].className.search(/\bsortbottom\b/) != -1) {
        sortbottomrows[sortbottomrows.length] = table.rows[i];
      }
    }
    if (sortbottomrows) {
      if (table.tFoot == null) {
        // table doesn't have a tfoot. Create one.
        tfo = document.createElement('tfoot');
        table.appendChild(tfo);
      }
      for (var i=0; i<sortbottomrows.length; i++) {
        tfo.appendChild(sortbottomrows[i]);
      }
      delete sortbottomrows;
    }

    // work through each column and calculate its type
    headrow = table.tHead.rows[0].cells;
    for (var i=0; i<headrow.length; i++) {
      // manually override the type with a sorttable_type attribute
      if (!headrow[i].className.match(/\bsorttable_nosort\b/)) { // skip this col
        mtch = headrow[i].className.match(/\bsorttable_([a-z0-9]+)\b/);
        if (mtch) { override = mtch[1]; }
	      if (mtch && typeof sorttable["sort_"+override] == 'function') {
	        headrow[i].sorttable_sortfunction = sorttable["sort_"+override];
	      } else {
	        headrow[i].sorttable_sortfunction = sorttable.guessType(table,i);
	      }
	      // make it clickable to sort
	      headrow[i].sorttable_columnindex = i;
	      headrow[i].sorttable_tbody = table.tBodies[0];
	      dean_addEvent(headrow[i],"click", function(e) {

          if (this.className.search(/\bsorttable_sorted\b/) != -1) {
            // if we're already sorted by this column, just
            // reverse the table, which is quicker
            sorttable.reverse(this.sorttable_tbody);
            this.className = this.className.replace('sorttable_sorted',
                                                    'sorttable_sorted_reverse');
            this.removeChild(document.getElementById('sorttable_sortfwdind'));
            sortrevind = document.createElement('span');
            sortrevind.id = "sorttable_sortrevind";
            sortrevind.innerHTML = stIsIE ? '&nbsp<font face="webdings">5</font>' : '&nbsp;&#x25B4;';
            this.appendChild(sortrevind);
            return;
          }
          if (this.className.search(/\bsorttable_sorted_reverse\b/) != -1) {
            // if we're already sorted by this column in reverse, just
            // re-reverse the table, which is quicker
            sorttable.reverse(this.sorttable_tbody);
            this.className = this.className.replace('sorttable_sorted_reverse',
                                                    'sorttable_sorted');
            this.removeChild(document.getElementById('sorttable_sortrevind'));
            sortfwdind = document.createElement('span');
            sortfwdind.id = "sorttable_sortfwdind";
            sortfwdind.innerHTML = stIsIE ? '&nbsp<font face="webdings">6</font>' : '&nbsp;&#x25BE;';
            this.appendChild(sortfwdind);
            return;
          }

          // remove sorttable_sorted classes
          theadrow = this.parentNode;
          forEach(theadrow.childNodes, function(cell) {
            if (cell.nodeType == 1) { // an element
              cell.className = cell.className.replace('sorttable_sorted_reverse','');
              cell.className = cell.className.replace('sorttable_sorted','');
            }
          });
          sortfwdind = document.getElementById('sorttable_sortfwdind');
          if (sortfwdind) { sortfwdind.parentNode.removeChild(sortfwdind); }
          sortrevind = document.getElementById('sorttable_sortrevind');
          if (sortrevind) { sortrevind.parentNode.removeChild(sortrevind); }

          this.className += ' sorttable_sorted';
          sortfwdind = document.createElement('span');
          sortfwdind.id = "sorttable_sortfwdind";
          sortfwdind.innerHTML = stIsIE ? '&nbsp<font face="webdings">6</font>' : '&nbsp;&#x25BE;';
          this.appendChild(sortfwdind);

	        // build an array to sort. This is a Schwartzian transform thing,
	        // i.e., we "decorate" each row with the actual sort key,
	        // sort based on the sort keys, and then put the rows back in order
	        // which is a lot faster because you only do getInnerText once per row
	        row_array = [];
	        col = this.sorttable_columnindex;
	        rows = this.sorttable_tbody.rows;
	        for (var j=0; j<rows.length; j++) {
	          row_array[row_array.length] = [sorttable.getInnerText(rows[j].cells[col]), rows[j]];
	        }
	        /* If you want a stable sort, uncomment the following line */
	        //sorttable.shaker_sort(row_array, this.sorttable_sortfunction);
	        /* and comment out this one */
	        row_array.sort(this.sorttable_sortfunction);

	        tb = this.sorttable_tbody;
	        for (var j=0; j<row_array.length; j++) {
	          tb.appendChild(row_array[j][1]);
	        }

	        delete row_array;
	      });
	    }
    }
  },

  guessType: function(table, column) {
    // guess the type of a column based on its first non-blank row
    sortfn = sorttable.sort_alpha;
    for (var i=0; i<table.tBodies[0].rows.length; i++) {
      text = sorttable.getInnerText(table.tBodies[0].rows[i].cells[column]);
      if (text != '') {
        if (text.match(/^-?[£$¤]?[\d,.]+%?$/)) {
          return sorttable.sort_numeric;
        }
        // check for a date: dd/mm/yyyy or dd/mm/yy
        // can have / or . or - as separator
        // can be mm/dd as well
        possdate = text.match(sorttable.DATE_RE)
        if (possdate) {
          // looks like a date
          first = parseInt(possdate[1]);
          second = parseInt(possdate[2]);
          if (first > 12) {
            // definitely dd/mm
            return sorttable.sort_ddmm;
          } else if (second > 12) {
            return sorttable.sort_mmdd;
          } else {
            // looks like a date, but we can't tell which, so assume
            // that it's dd/mm (English imperialism!) and keep looking
            sortfn = sorttable.sort_ddmm;
          }
        }
      }
    }
    return sortfn;
  },

  getInnerText: function(node) {
    // gets the text we want to use for sorting for a cell.
    // strips leading and trailing whitespace.
    // this is *not* a generic getInnerText function; it's special to sorttable.
    // for example, you can override the cell text with a customkey attribute.
    // it also gets .value for <input> fields.

    hasInputs = (typeof node.getElementsByTagName == 'function') &&
                 node.getElementsByTagName('input').length;

    if (node.getAttribute("sorttable_customkey") != null) {
      return node.getAttribute("sorttable_customkey");
    }
    else if (typeof node.textContent != 'undefined' && !hasInputs) {
      return node.textContent.replace(/^\s+|\s+$/g, '');
    }
    else if (typeof node.innerText != 'undefined' && !hasInputs) {
      return node.innerText.replace(/^\s+|\s+$/g, '');
    }
    else if (typeof node.text != 'undefined' && !hasInputs) {
      return node.text.replace(/^\s+|\s+$/g, '');
    }
    else {
      switch (node.nodeType) {
        case 3:
          if (node.nodeName.toLowerCase() == 'input') {
            return node.value.replace(/^\s+|\s+$/g, '');
          }
        case 4:
          return node.nodeValue.replace(/^\s+|\s+$/g, '');
          break;
        case 1:
        case 11:
          var innerText = '';
          for (var i = 0; i < node.childNodes.length; i++) {
            innerText += sorttable.getInnerText(node.childNodes[i]);
          }
          return innerText.replace(/^\s+|\s+$/g, '');
          break;
        default:
          return '';
      }
    }
  },

  reverse: function(tbody) {
    // reverse the rows in a tbody
    newrows = [];
    for (var i=0; i<tbody.rows.length; i++) {
      newrows[newrows.length] = tbody.rows[i];
    }
    for (var i=newrows.length-1; i>=0; i--) {
       tbody.appendChild(newrows[i]);
    }
    delete newrows;
  },

  /* sort functions
     each sort function takes two parameters, a and b
     you are comparing a[0] and b[0] */
  sort_numeric: function(a,b) {
    aa = parseFloat(a[0].replace(/[^0-9.-]/g,''));
    if (isNaN(aa)) aa = 0;
    bb = parseFloat(b[0].replace(/[^0-9.-]/g,''));
    if (isNaN(bb)) bb = 0;
    return aa-bb;
  },
  sort_alpha: function(a,b) {
    if (a[0]==b[0]) return 0;
    if (a[0]<b[0]) return -1;
    return 1;
  },
  sort_ddmm: function(a,b) {
    mtch = a[0].match(sorttable.DATE_RE);
    y = mtch[3]; m = mtch[2]; d = mtch[1];
    if (m.length == 1) m = '0'+m;
    if (d.length == 1) d = '0'+d;
    dt1 = y+m+d;
    mtch = b[0].match(sorttable.DATE_RE);
    y = mtch[3]; m = mtch[2]; d = mtch[1];
    if (m.length == 1) m = '0'+m;
    if (d.length == 1) d = '0'+d;
    dt2 = y+m+d;
    if (dt1==dt2) return 0;
    if (dt1<dt2) return -1;
    return 1;
  },
  sort_mmdd: function(a,b) {
    mtch = a[0].match(sorttable.DATE_RE);
    y = mtch[3]; d = mtch[2]; m = mtch[1];
    if (m.length == 1) m = '0'+m;
    if (d.length == 1) d = '0'+d;
    dt1 = y+m+d;
    mtch = b[0].match(sorttable.DATE_RE);
    y = mtch[3]; d = mtch[2]; m = mtch[1];
    if (m.length == 1) m = '0'+m;
    if (d.length == 1) d = '0'+d;
    dt2 = y+m+d;
    if (dt1==dt2) return 0;
    if (dt1<dt2) return -1;
    return 1;
  },

  shaker_sort: function(list, comp_func) {
    // A stable sort function to allow multi-level sorting of data
    // see: http://en.wikipedia.org/wiki/Cocktail_sort
    // thanks to Joseph Nahmias
    var b = 0;
    var t = list.length - 1;
    var swap = true;

    while(swap) {
        swap = false;
        for(var i = b; i < t; ++i) {
            if ( comp_func(list[i], list[i+1]) > 0 ) {
                var q = list[i]; list[i] = list[i+1]; list[i+1] = q;
                swap = true;
            }
        } // for
        t--;

        if (!swap) break;

        for(var i = t; i > b; --i) {
            if ( comp_func(list[i], list[i-1]) < 0 ) {
                var q = list[i]; list[i] = list[i-1]; list[i-1] = q;
                swap = true;
            }
        } // for
        b++;

    } // while(swap)
  }
}

/* ******************************************************************
   Supporting functions: bundled here to avoid depending on a library
   ****************************************************************** */

// Dean Edwards/Matthias Miller/John Resig

/* for Mozilla/Opera9 */
if (document.addEventListener) {
    document.addEventListener("DOMContentLoaded", sorttable.init, false);
}

/* for Internet Explorer */
/*@cc_on @*/
/*@if (@_win32)
    document.write("<script id=__ie_onload defer src=javascript:void(0)><\/script>");
    var script = document.getElementById("__ie_onload");
    script.onreadystatechange = function() {
        if (this.readyState == "complete") {
            sorttable.init(); // call the onload handler
        }
    };
/*@end @*/

/* for Safari */
if (/WebKit/i.test(navigator.userAgent)) { // sniff
    var _timer = setInterval(function() {
        if (/loaded|complete/.test(document.readyState)) {
            sorttable.init(); // call the onload handler
        }
    }, 10);
}

/* for other browsers */
//window.onload = sorttable.init; // toto by zabilo vsetok predchadzajuci skript

// written by Dean Edwards, 2005
// with input from Tino Zijdel, Matthias Miller, Diego Perini

// http://dean.edwards.name/weblog/2005/10/add-event/

function dean_addEvent(element, type, handler) {
	if (element.addEventListener) {
		element.addEventListener(type, handler, false);
	} else {
		// assign each event handler a unique ID
		if (!handler.$$guid) handler.$$guid = dean_addEvent.guid++;
		// create a hash table of event types for the element
		if (!element.events) element.events = {};
		// create a hash table of event handlers for each element/event pair
		var handlers = element.events[type];
		if (!handlers) {
			handlers = element.events[type] = {};
			// store the existing event handler (if there is one)
			if (element["on" + type]) {
				handlers[0] = element["on" + type];
			}
		}
		// store the event handler in the hash table
		handlers[handler.$$guid] = handler;
		// assign a global event handler to do all the work
		element["on" + type] = handleEvent;
	}
};
// a counter used to create unique IDs
dean_addEvent.guid = 1;

function removeEvent(element, type, handler) {
	if (element.removeEventListener) {
		element.removeEventListener(type, handler, false);
	} else {
		// delete the event handler from the hash table
		if (element.events && element.events[type]) {
			delete element.events[type][handler.$$guid];
		}
	}
};

function handleEvent(event) {
	var returnValue = true;
	// grab the event object (IE uses a global event object)
	event = event || fixEvent(((this.ownerDocument || this.document || this).parentWindow || window).event);
	// get a reference to the hash table of event handlers
	var handlers = this.events[event.type];
	// execute each event handler
	for (var i in handlers) {
		this.$$handleEvent = handlers[i];
		if (this.$$handleEvent(event) === false) {
			returnValue = false;
		}
	}
	return returnValue;
};

function fixEvent(event) {
	// add W3C standard event methods
	event.preventDefault = fixEvent.preventDefault;
	event.stopPropagation = fixEvent.stopPropagation;
	return event;
};
fixEvent.preventDefault = function() {
	this.returnValue = false;
};
fixEvent.stopPropagation = function() {
  this.cancelBubble = true;
}

// Dean's forEach: http://dean.edwards.name/base/forEach.js
/*
	forEach, version 1.0
	Copyright 2006, Dean Edwards
	License: http://www.opensource.org/licenses/mit-license.php
*/

// array-like enumeration
if (!Array.forEach) { // mozilla already supports this
	Array.forEach = function(array, block, context) {
		for (var i = 0; i < array.length; i++) {
			block.call(context, array[i], i, array);
		}
	};
}

// generic enumeration
Function.prototype.forEach = function(object, block, context) {
	for (var key in object) {
		if (typeof this.prototype[key] == "undefined") {
			block.call(context, object[key], key, object);
		}
	}
};

// character enumeration
String.forEach = function(string, block, context) {
	Array.forEach(string.split(""), function(chr, index) {
		block.call(context, chr, index, string);
	});
};

// globally resolve forEach enumeration
var forEach = function(object, block, context) {
	if (object) {
		var resolve = Object; // default
		if (object instanceof Function) {
			// functions have a "length" property
			resolve = Function;
		} else if (object.forEach instanceof Function) {
			// the object implements a custom forEach method so use that
			object.forEach(block, context);
			return;
		} else if (typeof object == "string") {
			// the object is a string
			resolve = String;
		} else if (typeof object.length == "number") {
			// the object is array-like
			resolve = Array;
		}
		resolve.forEach(object, block, context);
	}
};


/**************************
 bookmarkSite
  pouzitie: bookmarkSite( title, url);
  naprkilad: <a href="javascript:bookmarkSite(this.title, document.location);" onMouseover="if(checkBrowser('Opera')) this.href=document.location" rel="sidebar" title="<? echo $A_project_default_title.' - '.$A_cms->get_title_by_seoname($mod[sizeof($mod)-1]);?>">
***************************/

function checkBrowser(name) {
   return (navigator.appName == name) ? true : false;
}
function bookmarkSite(title, url) {
   if (window.sidebar) { // firefox
      window.sidebar.addPanel(title, url, "");
   } else if (window.opera && window.print) {   // opera
      ;
   } else if(document.all) {   // explorer
      window.external.AddFavorite(url, title);
   }
}

/******************************************************************************************************************************/

