window.addEvent('domready',function(){

	var prevArray = $$('.prev');

	prevArray.each(function(item,index) {

		item.id = item.id + "" + index;

	});

	var nextArray = $$('.next');

	nextArray.each(function(item,index) {

		item.id = item.id + "" + index;

	});

	var boxArray = $$('.box');	

	boxArray.each(function(item,index) {

		item.id = item.id + "" + index;

		new noobSlide({

			box: $(item.id),

			items: $$("#"+item.id +" .img_row"),

			size: 621,

			buttons: {previous: $("prev"+index), next: $("next"+index) }

		}).walk(0,false,true);

	});



  var testitems=new Array();

	height=426;
	NavName = navigator.appName;
	NavVers = navigator.appVersion;
	var reg1=new RegExp("[MSIE 6.0]","g");
	var reg2=new RegExp("[Microsoft Internet Explorer]","g");
	if(NavVers.match(reg1) && NavName.match(reg2)){
		height=393;
	}
	

	var imgArray = $$('.events_textcontent img');

	imgArray.each(function(item,index){
	

	

    $('box').innerHTML += "<span><img src=" + item.src + " height=\""+height+"px\" alt=\"Photo\" /></span>\n";

	  $('handles').innerHTML += "<div><img src=" + item.src + " class=\"shadow\" alt=\"Photo Thumb\"  height=58 /></div>\n";

	  testitems[index]= index;

    });

	

	var imgArray1 = $$('.events_textcontent img');

	imgArray1.each(function(item,index){

    item.style.display="none";

    });

    

	var imgArrayShad = $$('.events_content .xavier');

	imgArrayShad.each(function(item,index){

    item.style.display="none";

    });

    

    

  var miniTemp = $$('.mini_temp');

  miniTemp.each(function(item,index){

    item.style.display = "none";

    var imgTemp = $$("#"+item.id+" img");

    imgTemp.each(function(imgItem,imgIndex){

      if(imgIndex==0){

        var adr = "";

        var adTemp = $$("#"+item.id+" a");

        adTemp.each(function(aItem,aIndex){

          if(aItem.title == item.title){

            adr = aItem.href;

          }

          });

        $('mini').innerHTML += "<div class=\"mini\"><a href="+adr+" "+item.title+"\> <img src="+imgItem.src+" class=\"shadow\" height=93 /></a></div>\n";

      }  

    });

  });

  

  var allLink = $$('.mini a');

  allLink.each(function(item,index){

    item.style.listStyleType="none";

    item.style.background="none";

  });

  

  var allcat = $$('.events_category');

  allcat.each(function(catitem,catindex){

      var alink = $$('.events_pic a');

      alink.each(function(item,index){

        if(index==0){

          $('alles_link').href = item.href;

              }

        });

      });

	

    var hs6 = new noobSlide({

			mode: 'vertical',

			box: $('box'),

			items: testitems,

			size: height,

			handles: $ES('div','handles'),

			handle_event: 'mouseenter',

			fxOptions: {

				duration: 1000,

				transition: Fx.Transitions.Quint.easeOut,

				wait: false

			},

			onWalk: function(currentItem,currentHandle){

				this.handles.setOpacity(0.3);

				currentHandle.setOpacity(1);

			}

		});

		hs6.next();

		

});








