	//check if the SWZ object exists
	if(Object.isUndefined(SWZ)){
		var SWZ = {};
	}
	
	SWZ.Newsblock = {};	
	
	SWZ.Newsblock.V1 = Class.create({
		
		initialize:function(options){
		
			this.options = {
				
				id 				: 'SWZNewsblock',
				baseClass		: 'swzNewsblock',		
				
				itemClass		: 'newsItem',
				bodyClass		: 'body',
				titleClass  	: 'title',
				highlightClass 	: 'highlight',
				
				bodiesClass		: 'bodies',
				titlesClass 	: 'titles',
				
				width 			: 250,
				height			: 550,
				bodyWidth		: 246,
				bodyHeight		: 148,
				bodiesHeight	: 150,
				bodiesWidth		: 200,
				titleWidth		: 246,						
				titlesWidth		: 248
			};
			Object.extend(this.options,options || '');
			
			//setup the html
			this.setup();
		},
		
		setup:function(){
		
			//create the accessor object for use in external classes
			nb = this;
			
			//create an array with the body elements
			this.arrBodies = new Array();
			$$('#' + this.options.id + ' .' + this.options.bodyClass).each(function(item,index){
				//get the html
				html = item.innerHTML;
				
				//create the inner element
				innerDiv 		   = Builder.node('div',{},'');
				innerDiv.innerHTML = html;
				
				//create the outer div
				outerDiv = Builder.node('div',{},innerDiv);
				
				//create the grouped div to hold the outer with the inner inside
				groupedDiv = Builder.node('div',{
					style 		: 'position:absolute;overflow:hidden;width:' + nb.options.bodyWidth + 'px;height:' + nb.options.bodyHeight + 'px;display:none;',
					className 	: nb.options.baseClass + nb.options.bodyClass.capitalize()
				},outerDiv);
				
				//add the grouped div to the array
				nb.arrBodies[index] = groupedDiv;				
			});

			
			//create an array with the title elements
			this.arrTitles = new Array();
			$$('#' + this.options.id + ' .' + this.options.titleClass).each(function(item,index){
				//get the html
				html = item.innerHTML;
				
				//create the inner element
				innerDiv 		   = Builder.node('div',{},'');
				innerDiv.innerHTML = html;
				
				//create the outer div
				outerDiv = Builder.node('div',{},innerDiv);
				
				//create the grouped div to hold the outer with the inner inside
				groupedDiv = Builder.node('div',{
					style		: 'width:' + nb.options.titleWidth + 'px;',
					className 	: nb.options.baseClass + nb.options.titleClass.capitalize()
				},outerDiv);
				
				//add the grouped div to the array
				nb.arrTitles[index] = groupedDiv;
			});			
			
			
			//create the holder for all the bodies
			this.bodies = Builder.node('div',{
				style 		: 'position:relative;overflow:hidden;width:' + nb.options.bodiesWidth + 'px;height:' + nb.options.bodiesHeight + 'px;',
				className 	: nb.options.baseClass + nb.options.bodiesClass.capitalize()			
			},'');
			
			//append the bodies to the bodies holder
			this.arrBodies.each(function(item){
				nb.bodies.appendChild(item);
			});
			
			//create the holder for all the titles
			this.titles = Builder.node('div',{
				style 		: 'width:' + nb.options.titlesWidth + 'px;height:' + (nb.options.height - nb.options.bodiesHeight) + 'px;',
				className 	: nb.options.baseClass + nb.options.titlesClass.capitalize()
			},'');

			//append the titles to the titles holder
			this.arrTitles.each(function(item){
				nb.titles.appendChild(item);
			});
			
			//create the wrapper div for everything
			wrapper = Builder.node('div',{id : nb.options.id, className : $(nb.options.id).className, style:'width:' + nb.options.width + 'px;'},[nb.bodies,nb.titles]);
			
			//replace the object with the set id
			$(this.options.id).replace(wrapper);
			
			//set the current news item to 0
			$(this.arrBodies[0]).show();
			$(this.arrTitles[0]).addClassName(nb.options.baseClass + nb.options.highlightClass.capitalize());
			
			this.currentNewsItem = 0;
			
			//setup the listeners for mouse over and mouse out
			this.addListeners();			
		},
		
		
		addListeners:function(){
			//create the accessor to the object
			thisNewsblock = this;		
		
			//add the listener
			thisNewsblock.arrTitles.each(function(item,index){
				$(item).observe('mouseover',thisNewsblock.titleOver.bindAsEventListener(item,index,thisNewsblock));
			});
		},
		
		
		titleOver:function(title,index,thisNewsblock){
		
			//hide the old item and remove the class from the title
			thisNewsblock.arrBodies[thisNewsblock.currentNewsItem].hide();
			thisNewsblock.arrTitles[thisNewsblock.currentNewsItem].removeClassName(thisNewsblock.options.baseClass + thisNewsblock.options.highlightClass.capitalize());
			
			//show the new item and highlight the title
			thisNewsblock.arrBodies[index].show();
			thisNewsblock.arrTitles[index].addClassName(thisNewsblock.options.baseClass + thisNewsblock.options.highlightClass.capitalize());
			
			//set the new/current item
			thisNewsblock.currentNewsItem = index;	
		}			
	
	});
	
	SWZ.Newsblock.V1.Timed = Class.create(SWZ.Newsblock.V1,{
	
		initialize:function($super,options){
		
			this.options = {
				delay			: 4,
				duration		: 1,
				animate			: true
			}
			Object.extend(this.options, options || '');

			this.animating = false;						
			$super(this.options);
		
		},
		
		setup:function($super){
	
			//call the superclass
			$super();		
			
			//start the items
			this.play();
		},		
		
		addListeners:function(){
			//create the accessor to the object
			thisNewsblock = this;		
		
			//add the listeners to the titles
			$(thisNewsblock.arrTitles).each(function(item,index){
				$(item).observe('mouseover',$(thisNewsblock).titleOver.bindAsEventListener(item,index,thisNewsblock));
				$(item).observe('mouseout',$(thisNewsblock).titleOut.bindAsEventListener(item,index,thisNewsblock));
			});
			//add the listeners to the bodies
			$(thisNewsblock.arrBodies).each(function(item,index){
				$(item).observe('mouseover',$(thisNewsblock).pause.bindAsEventListener(thisNewsblock));
				$(item).observe('mouseout',$(thisNewsblock).play.bindAsEventListener(thisNewsblock));
			});
			
			$(thisNewsblock.bodies).observe('mouseover',$(thisNewsblock).pause.bindAsEventListener(thisNewsblock));
			$(thisNewsblock.bodies).observe('mouseout',$(thisNewsblock).play.bindAsEventListener(thisNewsblock));
			
			$(thisNewsblock.titles).observe('mouseover',$(thisNewsblock).pause.bindAsEventListener(thisNewsblock));
			$(thisNewsblock.titles).observe('mouseout',$(thisNewsblock).play.bindAsEventListener(thisNewsblock));
			
		},
		
		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(){	
			//cancel the old timer
			this.pause();
		
			//create a new timer
			this.timer = setTimeout(function(){
				this.rotateNews();				
			}.bind(this),this.options.delay * 1000);
		},
		
		pause:function(){	
			//clear the timer
			clearTimeout(this.timer);	
		},
		
		//rotateNews()
		//function to call the rotation
		rotateNews:function(){
		
			//log to the console (if available)
			//console.log('rotateNews(' + obj.options.id +') at ' + new Date());
		
			//get the current index
			currentIndex = 0;
			$(this.arrBodies).each(function(item,index){
				if(item.style.display != 'none'){
					currentIndex = index;
				}
			});
			
			//get the new index
			if(currentIndex+1 == $(this.arrBodies).length){
				newIndex = 0
			} else {
				newIndex = currentIndex + 1;
			}
			
			//get the new object
			newObj = $(this.arrBodies[newIndex]);
			newInd = newIndex;
				
			//show the new body
			this.showBody(newObj,newInd);
			
			//create the timer
			this.play();
		},		
		
		
		//showBody()
		//function to show the body of a news item
		showBody:function(obj,ind){
			
			thisNewsblock = this

			//get the id of the current showing
			$(thisNewsblock.arrBodies).each(function(item,index){
				if(item.style.display != 'none'){
					currentBody 	= $(thisNewsblock.arrBodies[index]);
					currentTitle	= $(thisNewsblock.arrTitles[index]);
				}
			});
			newBody		= $(thisNewsblock.arrBodies[ind]);
			newTitle 	= $(thisNewsblock.arrTitles[ind]);
									
			//create the animation options...
			if(this.options.animate==true){
	
			
				aniOptions = {
					beforeStart : function(){
						thisNewsblock.animating = true;
						$(currentTitle).removeClassName(thisNewsblock.options.baseClass + thisNewsblock.options.highlightClass.capitalize());
						$(newTitle).addClassName(thisNewsblock.options.baseClass + thisNewsblock.options.highlightClass.capitalize());
						thisNewsblock.currentNewsItem = ind;
						currentBody.hide();
					},
					afterFinish : function(){
						thisNewsblock.animating = false;
					},
					duration : thisNewsblock.options.duration
				}
				
				if(thisNewsblock.animating == false){
					if(currentBody!=newBody){				
						new Effect.Parallel([
							new Effect.SlideUp(currentBody,{ queue: 'front' }),
							new Effect.SlideDown(newBody,{ queue: 'end' })
						],aniOptions);
					}
				} else {
					$(currentBody).hide();
					$(newBody).show();
					$(currentTitle).removeClassName(thisNewsblock.options.baseClass + thisNewsblock.options.highlightClass.capitalize());
					$(newTitle).addClassName(thisNewsblock.options.baseClass + thisNewsblock.options.highlightClass.capitalize());
				}
			} else {
				currentBody.hide();
				newBody.show();
				$(currentTitle).removeClassName(thisNewsblock.options.baseClass + thisNewsblock.options.highlightClass.capitalize());
				$(newTitle).addClassName(thisNewsblock.options.baseClass + thisNewsblock.options.highlightClass.capitalize());
			}

		}

	
	});