// Number of segments in total
			var segments = 6;
			// Delay between transitions - in milliseconds
			var delaytransition = 5000;
			// Delay at start of animation
			var delaystart = 5000;
			
			var maindelaystart = 4000;
			
			jQuery(document).ready(function(){
				tmpbg = jQuery("#imagepanel>ul>li:first img:first").attr("src");
				jQuery("#bigpanel").css({backgroundImage:"url("+tmpbg+")"});
				jQuery("#imagepanel").css({display:"none"});
				
				//temptext = jQuery("#imagepanel>ul>li:last>span").html();
				//temptext = "Welcome to the home of SFS - <br />our business, your partner";
				temptext = "Welcome to Southampton Freight Services Ltd, The Small, Medium and Large Sized Forwarder";
				jQuery("#bigpanel").append("<div id='textpanel'><span>"+temptext+"</span></div>");
				
						tmpheight = jQuery("#textpanel span").height() +20;
						containerheight = jQuery("#textpanel").height();
						jQuery("#textpanel span").css({marginTop:(containerheight-tmpheight)/2});

				jQuery("#bigpanel").append("<div id='innerpanel'></div>");
				jQuery("#innerpanel").css({backgroundImage:"url("+tmpbg+")"});
				for (var i=1;i<=segments;i++){
					jQuery("#innerpanel").append("<div class='segment' id='segment"+i+"'></div>");
					jQuery("#segment"+i).css({opacity:0});
				}
				jQuery("#textpanel").css({opacity:0.7});
				
				jQuery("body").animate({g:1},maindelaystart,function(){rotate();});
				
				function rotate() {
					jQuery("#imagepanel>ul>li:last").after(jQuery("#imagepanel>ul>li:first")); 
					jQuery("#imagepanel>ul>li:first").each(function(){
						panelbg = jQuery(this).find("img:first").attr("src");
						paneltext = jQuery(this).find("span").html();
						jQuery(this).find("li").each(function(n){
							segmentbg = jQuery(this).find("img").attr("src");
							jQuery("#segment"+(n+1)).css({backgroundImage:"url("+segmentbg+")"});
						});
					});
					jQuery("#bigpanel").css({backgroundImage:"url("+panelbg+")"});
					jQuery("#textpanel").css({opacity:1});
					jQuery("#textpanel span").animate({opacity:0},500);
					jQuery("#innerpanel").animate({opacity:0},1000,function(){
						jQuery(this).css({backgroundImage:"url("+panelbg+")"}).css({opacity:1});
						jQuery("#textpanel").animate({opacity:0.7},300);
						jQuery("#textpanel span").html(paneltext).animate({opacity:1},500);
						
						tmpheight = jQuery("#textpanel span").height() + 20;
						containerheight = jQuery("#textpanel").height();
						jQuery("#textpanel span").css({marginTop:(containerheight-tmpheight)/2});
						
						jQuery("body").animate({g:1},delaystart,function(){
							for (var i=1;i<=segments;i++){
								jQuery("#segment"+i).animate({g:1},500*i).animate({opacity:1},1000);	
							}
							jQuery(this).animate({g:1},delaytransition,function(){
							for (var i=1;i<=segments;i++){
								jQuery("#segment"+i).animate({g:1},500*i).animate({opacity:0},1000);	
							}	
							});
							jQuery(this).animate({g:1},(segments*500+2000),function(){rotate();});
						});
					})
				}
				
							
			});