jQuery(document).ready(function($){
	var slider_pause = 0;
	$('#feature-container').mouseover(function(){
		slider_pause=1;
	}).mouseout(function(){
		slider_pause=0;
	});
	$('#feature-container div.slide:gt(0)').hide();
	setInterval(
		function(){
			if(!slider_pause){
				$('#feature-container div.slide:first-child').fadeOut()
				.next('div.slide').fadeIn()
				.end().appendTo('#feature-container')
			}
		}, 
		8000
	);

/****************************
 * Open Links in New Window *
 ****************************/

	function externalLinks() {   
		if (!document.getElementsByTagName) return;   
		var anchors = document.getElementsByTagName("a");   
		for (var i=0; i<anchors.length; i++) {   
			var anchor = anchors[i];   
			if (anchor.getAttribute("href") &&   
				anchor.getAttribute("rel") == "external")   
				anchor.target = "_blank";   
			}   
		}   
	window.onload = externalLinks;
	
});

window.onload = function() {

	if (document.getElementById('leftFlash')) {
		var left = new SWFObject("/wp-content/themes/womansclinic/flash/leftflash.swf", "leftFlash", "253", "241", "6", "#d2eeee");
		left.write("leftFlash");
	}
	
	if (document.getElementById('rightFlash')) {
		var right = new SWFObject("/wp-content/themes/womansclinic/flash/rightflash.swf", "rightFlash", "247", "241", "6", "#d2eeee");
		right.write("rightFlash");
	}

}
