home *** CD-ROM | disk | FTP | other *** search
- // after site is loaded
- document.observe("dom:loaded", function() {
- start = 1;
- pos = 0;
- limit = 6;
- divs = $$('.teaserSmall');
- browseDiv = $$('#browseBTN'); // Von Rene hinzugef├╝gt
- parts = Math.ceil(divs.length/limit);
- html = '';
-
- // Änderung Rene - Damit die Navigationselemnte in der Übersicht nicht angezeigt werden
- if( parts == 1 ){
- browseDiv.each(function(e) {
- e.hide();
- });
- }
- // Änderung Rene - Ende
-
- $R(1,parts).each(function(e,i) {
- j = i+1;
- if (start==j)
- {
- x = start;
- jump = j;
- }
- else
- {
- x += limit;
- jump = x;
- }
- html += '<a href="#" class="btn_browseNum" onclick="jump(-1,'+jump+','+j+')">'+j+'</a>';
- });
- $$('#browseBTN span')[0].insert(html);
- _pos = function(position)
- {
- $$('#browseBTN span a').each(function(e,i) {
- if (position == i)
- {
- e.setStyle({ background: 'blue url(\'images/btn_browseNum.gif\') no-repeat 0px -21px' });
- }
- else
- {
- e.setStyle({ background: 'blue url(\'images/btn_browseNum.gif\') no-repeat 0px 0px' });
- }
- });
- }
- page = function(start,position)
- {
- divs.each(function(e,i) {
- e.hide();
- if (i==start-1 || (i>start-1 && i<start-1+limit) ) {
- e.show();
- };
- });
- _pos(position);
- }
- jump = function(direction,jump,no)
- {
- if ((start==1&&direction==0) || (start==((parts-1)*limit+1)&&direction==1)) return;
- start = (jump) ? jump : ((direction) ? start+limit : start-limit);
- pos = (direction) ? pos+1 : pos-1;
- pos = (no) ? no-1 : pos;
- page(start,pos);
- }
- page(start,pos);
- });