/*<![CDATA[*/
<!-- //
$(document).ready(function()
{
  temparray = new Array();
  tempstring = '';
  function fisherYates ( myArray ) {
    var i = myArray.length;
    if ( i == 0 ) return false;
    while ( --i ) {
         var j = Math.floor( Math.random() * ( i + 1 ) );
         var tempi = myArray[i];
         var tempj = myArray[j];
         myArray[i] = tempj;
         myArray[j] = tempi;
    }
  }
  $('#right .content ul.csc-bulletlist li').each(function(i){
    // list items in array:
    temparray[i] = $(this).html();
  });
  // array mischen:
  fisherYates(temparray);
  // liste leeren:
  $('#right .content ul.csc-bulletlist').remove();
  // liste wieder fuellen:
        itemcount = 7
  tempstring = '<ul class="clientslist">';
  for(j=0;j<temparray.length;j++){
    tempstring += '<li>'+temparray[j]+'</li>'+"\n";
    if( j >= itemcount && j%itemcount == 0 ){
      tempstring += '</ul>'+"\n";
      tempstring += '<ul class="clientslist">'+"\n";
    }
  }
        tempstring += '</ul>'+"\n";
  $('#right .content .csc-header').after(tempstring);
  // let the fun begin:
  $('#right .content .reflist').cycle({
    fx: 'fade',
    slideExpr: 'ul',
    next: 'ul.clientslist',
    timeout: 4000
  });
  
  
  
});

$(function(){

  var link = $('#right .content .content-nav a');
  $('#right .content .content-nav a[href*=#]').bind("click", function(event) {
    event.preventDefault();
    var ziel = $(this).attr("href");
    if( ziel.indexOf('#') != '0'){
    	// falls blah.html#ziel
		ziel = ziel.split('#');
		ziel = '#'+ziel[1]; // #ziel
	}
    if ($.browser.opera) {
      var target = 'html';
    }else{
      var target = 'html,body';
    }
    $(link).not($(this)).removeClass('active');
    $(this).addClass('active');
    $(target).animate({
      scrollTop: $(ziel).offset().top
    }, 1000 , function (){
      location.hash = ziel;
    });
  });
  
	if( location.hash != ''){
    	var ziel = location.hash;
    	if ($.browser.opera) {
      		var target = 'html';
    	}else{
      		var target = 'html,body';
    	}
    	$(target).animate({
    		scrollTop: $(ziel).offset().top
    	}, 1000 , function (){
			location.hash = ziel;
		});
		$('#right .content .content-nav a[href*='+ziel+']').addClass('active');
	} else {
  		$(link).first().addClass('first active');
  	}
});

// -->
/*]]>*/

