	//check if the SWZ object exists
	if(Object.isUndefined(SWZ)){
		var SWZ = {};
	}
	
	//SWZ.Newsblock
	SWZ.Newsblock2 = Class.create({
	
		initialize:function(options){
		
			//create the accessor to the object
			obj = this;		
		
			//create the options object
			obj.options = {
				id 				: '',
				itemClass		: 'newsitem',
				titleClass 		: 'title',
				highlightClass 	: 'highlight',
				bodiesClass		: 'bodies',
				titlesClass		: 'titles'
			}
			
			Object.extend(obj.options,options || '');
			
			obj.setup();		
		},
		
		setup:function(){
		
			//create the accessor to the object
			obj = this;		
		
			//the first thing to do is to parse the objects into their different divs...
			obj.arrNewsItems = new Array();
		
			//create all the html for the news items
			$$('#' + obj.options.id + ' .' + obj.options.itemClass).each(function(item,index){
			
				//create the holding div
				obj.arrNewsItems[index] = Builder.node('div',{className : obj.options.itemClass},'');
				
				subdiv = Builder.node('div',{},'');
				
				//loop through the li tags and add to the arrNewsItems
				$(item).select('li').each(function(listItem){
					thisDiv = Builder.node('div',{className : listItem.className},'');
					thisDiv.innerHTML = listItem.innerHTML;
					subdiv.appendChild(thisDiv);
				});
				
				obj.arrNewsItems[index].appendChild(subdiv);								
			});
			
			//get an array of all the titles
			obj.arrNewsTitles = new Array();
			obj = this;
			$$('#' + obj.options.id + ' .' + obj.options.titleClass).each(function(item,index){
				obj.arrNewsTitles[index] = Builder.node('div',{className : item.className},'');							
				obj.arrNewsTitles[index].innerHTML = item.innerHTML;
			});
			
			//group the bodies together
			obj.bodies = Builder.node('div',{className : obj.options.bodiesClass},'');
			for(i=0;i<obj.arrNewsItems.length;i++){
				obj.bodies.appendChild(obj.arrNewsItems[i]);
			}

			//group the titles together
			obj.titles = Builder.node('div',{className : obj.options.titlesClass},'');			
			for(i=0;i<obj.arrNewsTitles.length;i++){
				obj.titles.appendChild(obj.arrNewsTitles[i]);
			}
			
			//group the bodies and titles together
			obj.newsblock = Builder.node('div',{id : obj.options.id, className : $(obj.options.id).className},[obj.bodies,obj.titles]);
			
			//replace the original
			$(obj.options.id).replace(obj.newsblock);
			
			
			for(i=0;i<obj.arrNewsItems.length;i++){
				if(i==0){
					$(obj.arrNewsItems[i]).style.display = 'block';				
					$(obj.arrNewsTitles[i]).addClassName(obj.options.highlightClass);
				} else {			
					$(obj.arrNewsItems[i]).style.display = 'none';				
					$(obj.arrNewsTitles[i]).removeClassName(obj.options.highlightClass);
				}
			}
			
			
			//set the current news item to zero
			obj.currentNewsItem = 0;			
			
			//setup the listeners for mouse over and mouse out
			obj.addListeners();		
						
		},
		
		addListeners:function(){
			//create the accessor to the object
			obj = this;		
		
			//add the listener
			obj.arrNewsTitles.each(function(item,index){
				$(item).observe('mouseover',obj.titleOver.bindAsEventListener(item,index,obj));
			});
		},
		
		titleOver:function(title,index,obj){
	
			//hide the old item and remove the class from the title
			$(obj.arrNewsItems[obj.currentNewsItem]).hide();
			$(obj.arrNewsTitles[obj.currentNewsItem]).removeClassName(obj.options.highlightClass);
			
			//show the new item and highlight the title
			$(obj.arrNewsItems[index]).show();
			$(obj.arrNewsTitles[index]).addClassName(obj.options.highlightClass);
			
			//set the new/current item
			obj.currentNewsItem = index;	
		}	

	});
	
	
	
	SWZ.Newsblock2.Timed = Class.create(SWZ.Newsblock2,{
	
		initialize:function($super,options){
			//create the accessor to the object
			obj = this;		
		
			obj.options = {
				delay : 5 //in seconds
			}
			Object.extend(obj.options,options || '');
			
			obj.animating = false;			
			
			$super(obj.options);		
		},
		
		
		setup:function($super){
			//create the accessor to the object
			obj = this;		
			
			//call the superclass
			$super();		
			
			//start the items
			obj.play();
		},
		
		
		addListeners:function(){
			//create the accessor to the object
			obj = this;		
		
			//add the listeners to the titles
			$(obj.arrNewsTitles).each(function(item,index){
				$(item).observe('mouseover',$(obj).titleOver.bindAsEventListener(item,index,obj));
				$(item).observe('mouseout',$(obj).titleOut.bindAsEventListener(item,index,obj));
			});
			//add the listeners to the bodies
			$(obj.arrNewsItems).each(function(item,index){
				$(item).observe('mouseover',$(obj).pause.bindAsEventListener(obj));
				$(item).observe('mouseout',$(obj).play.bindAsEventListener(obj));
			});
			
			$(obj.bodies).observe('mouseover',$(obj).pause.bindAsEventListener(obj));
			$(obj.bodies).observe('mouseout',$(obj).play.bindAsEventListener(obj));
			
			$(obj.titles).observe('mouseover',$(obj).pause.bindAsEventListener(obj));
			$(obj.titles).observe('mouseout',$(obj).play.bindAsEventListener(obj));
			
		},
		
		titleOver:function($super,title,index,obj){
		
			//call the superclass
			$super(title,index,obj);
			
			//pause the timer
			obj.pause(obj);
		},
		
		titleOut:function(title,index,obj){
		
			//pause the timer
			obj.play(obj);
		},
		
		play:function(obj){		
			//create the accessor to the object
			obj = this;		
		
			//cancel the old timer
			obj.pause();
		
			//create a new timer
			obj.timer = setTimeout(function(){
				obj.rotateNews();				
			},obj.options.delay * 1000);
			
		},
		
		pause:function(obj){
			//create the accessor to the object
			obj = this;		
			
			//clear the timer
			clearTimeout(obj.timer);	
		},
		
		
		//rotateNews()
		//function to call the rotation
		rotateNews:function(){
			//create the accessor to the object
			obj = this;		
		
			//log to the console (if available)
			//console.log('rotateNews(' + obj.options.id +') at ' + new Date());
		
			//get the current index
			currentIndex = 0;
			$(obj.arrNewsItems).each(function(item,index){
				if(item.style.display != 'none'){
					currentIndex = index;
				}
			});
			
			//get the new index
			if(currentIndex+1 == $(obj.arrNewsItems).length){
				newIndex = 0
			} else {
				newIndex = currentIndex + 1;
			}
			
			//get the new object
			newObj = $(obj.arrNewsItems[newIndex]);
			newInd = newIndex;
				
			//show the new body
			obj.showBody(newObj,newInd);
			
			//create the timer
			obj.play();
		},
		
		//showBody()
		//function to show the body of a news item
		showBody:function(obj,ind){
			//create the accessor to the object
			obj = this;		
			

			//get the id of the current showing
			$(obj.arrNewsItems).each(function(item,index){
				if(item.style.display != 'none'){
					currentBody 	= $(obj.arrNewsItems[index]);
					currentTitle	= $(obj.arrNewsTitles[index]);
				}
			});
			newBody		= $(obj.arrNewsItems[ind]);
			newTitle 	= $(obj.arrNewsTitles[ind]);
			

			//make the switch
			if(obj.animating == false){
				new Effect.SlideUp(currentBody,{
					beforeStart:function(){
						obj.animating = true;
						obj.currentNewsItem = ind;
					},
					afterFinish:function(){
						$(currentTitle).removeClassName(obj.options.highlightClass);
						$(newTitle).addClassName(obj.options.highlightClass);	
						new Effect.SlideDown(newBody,{
							afterFinish:function(){
								obj.animating = false;	
							}
						});
					}
								   
				});
			} else {
				$(currentBody).hide();
				$(newBody).show();
				$(currentTitle).removeClassName(obj.options.highlightClass);
				$(newTitle).addClassName(obj.options.highlightClass);
			}
		}
	
	});
