	$(document).ready(function() {
		$(".newsbody").hide();
		$("#n1").show();
		$("#im1").attr('src', 'images/style/blackright.png');
		$(".newsitem").click(function()
		{	
			$('.newsimage').attr('src', 'images/style/blackdown.png');
			$('div.newsbody').slideUp('normal');
			var o = "#i"+$(this).attr('id');
			$(o).attr('src', 'images/style/blackright.png');
			$(this).next().slideDown('normal');
		});

		

	});
	
	$(document).ready(function() {

	//Speed of the slideshow
	var speed = 9000;
	
	//You have to specify width and height in #slider CSS properties
	//After that, the following script will set the width and height accordingly
	$('#mask-gallery, #gallery li').width($('#slider').width());	
	$('#gallery').width($('#slider').width() * $('#gallery li').length);
	$('#mask-gallery, #gallery li, #mask-excerpt, #excerpt li').height($('#slider').height());
	
	//Assign a timer, so it will run periodically
	var run = setInterval('newsscoller(0)', speed);	
	
	$('#gallery li:first, #excerpt li:first').addClass('selected');


	//Next Slide by calling the function
	$('#btn-next').click(function () {
		newsscoller(0);	
		return false;
	});	

	//Previous slide by passing prev=1
	$('#btn-prev').click(function () {
		newsscoller(1);	
		return false;
	});	
	
	//Mouse over, pause it, on mouse out, resume the slider show
	$('#scroller').hover(
	
		function() {
			clearInterval(run);
		}, 
		function() {
			run = setInterval('newsscoller(0)', speed);	
		}
	); 	
	
	var speed1 = 9000;
	
	//You have to specify width and height in #slider CSS properties
	//After that, the following script will set the width and height accordingly
	$('#mask-gallery-photos, #gallery-photos li').width($('#slider-photos').width());	
	$('#gallery-photos').width($('#slider-photos').width() * $('#gallery-photos li').length);
	$('#mask-gallery-photos, #gallery-photos li').height($('#slider-photos').height());
	
	//Assign a timer, so it will run periodically
	var run1 = setInterval('newsscoller1(0)', speed1);	
	
	$('#gallery-photos li:first').addClass('selected');


	//Next Slide by calling the function
	$('#btn-next-photos').click(function () {
		newsscoller1(0);	
		return false;
	});	

	//Previous slide by passing prev=1
	$('#btn-prev-photos').click(function () {
		newsscoller1(1);	
		return false;
	});	
	
	//Mouse over, pause it, on mouse out, resume the slider show
	$('#scroller-photos').hover(
	
		function() {
			clearInterval(run1);
		}, 
		function() {
			run1 = setInterval('newsscoller1(0)', speed1);	
		}
	); 	
	
});


function newsscoller(prev) {

	//Get the current selected item (with selected class), if none was found, get the first item
	var current_image = $('#gallery li.selected').length ? $('#gallery li.selected') : $('#gallery li:first');
	var current_excerpt = $('#excerpt li.selected').length ? $('#excerpt li.selected') : $('#excerpt li:first');

	//if prev is set to 1 (previous item)
	if (prev) {
		
		//Get previous sibling
		var next_image = (current_image.prev().length) ? current_image.prev() : $('#gallery li:last');
		var next_excerpt = (current_excerpt.prev().length) ? current_excerpt.prev() : $('#excerpt li:last');
	
	//if prev is set to 0 (next item)
	} else {
		
		//Get next sibling
		var next_image = (current_image.next().length) ? current_image.next() : $('#gallery li:first');
		var next_excerpt = (current_excerpt.next().length) ? current_excerpt.next() : $('#excerpt li:first');
	}

	//clear the selected class
	$('#excerpt li, #gallery li').removeClass('selected');
	
	//reassign the selected class to current items
	next_image.addClass('selected');
	next_excerpt.addClass('selected');

	//Scroll the items
	$('#mask-gallery').scrollTo(next_image, 900);		
	$('#mask-excerpt').scrollTo(next_excerpt, 900);					
	
}

function newsscoller1(prev) {

	//Get the current selected item (with selected class), if none was found, get the first item
	var current_image1 = $('#gallery-photos li.selected').length ? $('#gallery-photos li.selected') : $('#gallery-photos li:first');

	//if prev is set to 1 (previous item)
	if (prev) {
		
		//Get previous sibling
		var next_image1 = (current_image1.prev().length) ? current_image1.prev() : $('#gallery-photos li:last');
	
	//if prev is set to 0 (next item)
	} else {
		
		//Get next sibling
		var next_image1 = (current_image1.next().length) ? current_image1.next() : $('#gallery-photos li:first');
	}

	//clear the selected class
	$('#gallery-photos li').removeClass('selected');
	
	//reassign the selected class to current items
	next_image1.addClass('selected');

	//Scroll the items
	$('#mask-gallery-photos').scrollTo(next_image1, 900);						
	
}

