var numberOfRSSWindows = 4;

$(document).ready(function() {
	
	for( var x = 0; x < numberOfRSSWindows; x++ ) {
		$('#rssMin'+x).click(function() {
			var x = this.id.substring(this.id.length-1, this.id.length);
			if( x == 1 ) {
				$('#newsRight').animate({height: '22px'}, 400);
			}
			else {
				$('#newsLeft').animate({height: '22px'}, 400);
			}
		});
		$('#rssDropDown'+x).click(function() {
			var x = this.id.substring(this.id.length-1, this.id.length);
			if( x == 1 ) {
				$('#newsRight').animate({height: '190px'}, 400);
			}
			else {
				$('#newsLeft').animate({height: '190px'}, 400);
			}
		});
		$('#rssClose'+x).click(function() {
			var x = this.id.substring(this.id.length-1, this.id.length);
			if( x == 1 ) {
				$('#newsRight').fadeOut("slow");
			}
			else {
				$('#newsLeft').fadeOut("slow");
			}
		});
	}	

	//Load preloaded images
	var path = 'styles/images/navigation/';
	var images = ['home_selected.png', 'company_selected.png', 'productsAndServices_selected.png', 'usefulInformation_selected.png', 'shopping_selected.png', 'calendar_selected.png', 'news_selected.png', 'contact_selected.png'];
	for( x = 0; x < images.length; x++ ) {
		var img = new Image;
		img.src = path+images[x];
	}
});
