$(document).ready(

	function()
	{

	$("#OB_img").animate({
			opacity:0
		},
		1,function(){$("#OB_img").show()}
	
		)


		$('#newscontainer').cycle({ 
			fx:'fade',
			timeout:5000,
			speed:500,
			pause:true,
			pager:'#podcounter',
			pagerAnchorBuilder: function(idx, slide) { 
        return '<li><a href="#">screen</a></li>'; 
    	},

			pagerClick: function(idx, slide) { 
        $('#newscontainer').cycle('pause');
    	}
    	 			
		});		

	$('#OB_img').css({
		left:((($('body').width() - $('#pageframe').width()) /2)+6) + 'px',
		top:($('#header').height() +1+23) + 'px'

	});
	

		var ob_imgCloseImg = new Image(); 
		$(ob_imgCloseImg)
		.load (function () {
	
			$("#OB_img").animate({
					opacity:1
				},
				3000,
				function(){
						$("#OB_overlay").animate({
						opacity:0
					},3000)
						$("#OB_img").animate({
						opacity:0
					}
					,
					3000,
					function()
					{
								$("#OB_overlay").empty().remove();
								$("#OB_img").empty().remove();
								setTimeout("crossSlideGo()",2000);
					}
					
					
					
				)}
			)
	})
  .attr('src', 'img/coverlogo.jpg');

		

		


		
		
		
	}
);


function crossSlideGo(){
	$('#specialpod').crossSlide({
	  fade: 2
	}, [
	
	{
	    src:  'slideshow2010/cover.jpg',
	    href: "territori_2010.asp",
//	    from: '100% 0% 1x',
//	//		from: '52% 5% 0.70x',
//	    to:   '70% 35% 1.5x',

	    from: '100% 0% 1x',
	    to:   '100% 0% 1.2x',

	    time: 10
	  }, 

		{
		
		    src:  'slideshow2010/Pieter_Bruegel.JPG',
		    href: "territori_2010.asp",
		    from: '100% 100% 1x',
		    to:   '0% 0% 1.2x',
		    time: 15
		  }, 
	
	{
	
	    src:  'slideshow2010/Brindisi_grande.jpg',
	    href: "territori_2010.asp",
	    from: '0% 100% 1x',
	    to:   '50% 80% 1.2x',
	    time: 10
	  },	
	{
	    src:  'slideshow2010/caravaggio_bacco-uff.jpg',
	    href: "territori_2010.asp",
	    from: '40% 20% 1x',
	    to:   '100% 90% 1.5x',
	    time: 15
	  }
	]);
}
