function links() {
	$("#animationFeatured > ul >li").each(function() {
		$(this).click(function(){
			window.location = $(this).children('a').attr('link');
		});
	});
}

function bobloop(){

var ob = '<!-- First Content --><div id="fragment-1" class="ui-tabs-panel" style=""><img src="Images/Home/image1.jpg" alt="" /><div class="info" ><h2><a href="Ultrasound.php" >ULTRASOUND</a></h2><p>We are the largest 3D/4D ultrasound provider in Canada. <a href="Ultrasound.php" >Read more...</a></p></div></div><!-- Second Content --><div id="fragment-2" class="ui-tabs-panel ui-tabs-hide" style=""><img src="Images/Home/image5.jpg" alt="" /><div class="info" ><h2><a href="Sonohysterography.php" >SONOHYSTEROGRAPHY</a></h2><p>We are the world&apos;s largest provider of Sonohysterography services. <a href="Sonohysterography.php" >Read more...</a></p></div></div><!-- Third Content --><div id="fragment-3" class="ui-tabs-panel ui-tabs-hide" style=""><img src="Images/Home/image2.jpg" alt="" /><div class="info" ><h2><a href="Fertility.php" >FERTILITY</a></h2><p>We are North America&apos;s largest provider of fertility ultrasounds. <a href="Fertility.php" >Read more...</a></p></div></div><!-- Fourth Content --><div id="fragment-4" class="ui-tabs-panel ui-tabs-hide" style=""><img src="Images/Home/image3.jpg" alt="" /><div class="info" ><h2><a href="X-Ray.php" >X-RAY</a></h2><p>We have one of the largest digital radiology networks in Canada. <a href="X-Ray.php" >Read more...</a></p></div></div><!-- Fifth Content --><div id="fragment-5" class="ui-tabs-panel ui-tabs-hide" style=""><img src="Images/Home/image4.jpg" alt="" /><div class="info" ><h2><a href="Mammography.php" >MAMMOGRAPHY</a></h2><p>We are CAR accredited and are affiliated with the Ontario Breast Screening Progam. <a href="Mammography.php" >Read more...</a></p></div></div><!-- Sixth Content --><div id="fragment-6" class="ui-tabs-panel ui-tabs-hide" style=""><img src="Images/Home/image6.jpg" alt="" /><div class="info" ><h2><a href="Bone-Density.php" >BONE MINERAL DENSITY</a></h2><p>Our expert clinical staff is committed to providing the best possible patient care. <a href="Bone-Density.php" >Read more...</a></p></div></div>';

$("div#homeinitial").css("opacity","50");
$("div#image2").css("opacity","0");
$("div#image3").css("opacity","0");
$("div#image4").css("opacity","0"); 
$("div#image2").css("opacity","100").delay(6000).animate({opacity:'0'}, {complete:function(){  
	$("div#image3").css("opacity","100").animate( { marginLeft:'+=160px'}, {duration: 3000, queue:true, easing:'easeInOutExpo'}); 
	$("#baby").animate({width:'50px', height: '44px', marginTop:'+=87px'}, {duration: 3000, queue:true, easing:'swing', complete:function() { 
		$("div#image4").animate({opacity:'100'},1000);
		$("div#animationHome").animate({marginTop:'-160px', marginLeft:'-80px'}, {duration:2000, easing:'easeInOutQuart',queue:false, complete:function(){ 
			$("div#top").animate({opacity:'100'}, {duration:100,complete:function() {
				$("div#animationContainer").remove();
				$(ob).css({ opacity: 0 }).insertAfter("ul.ui-tabs-nav");
				links();
				$("#animationFeatured > div:eq(0)").animate({ opacity: 1 }, 3000, function() {
					$("#animationFeatured > div").removeAttr('style');
					$("#animationFeatured").tabs({fx:{opacity: "toggle"}}).tabs("rotate", 4000, true).tabs({ show: function(event, ui){
						var bg = $(this).children('div').eq(ui.index).find('img').attr('src');
						$("#homeinitial").css({ background: "url("+bg+") no-repeat 5px 0px" });
					} });
				});
			}
		}); }
});
 }
});
}
}
);
}

$(document).ready(function(){
	bobloop();
	links();
});









