$j(document).ready(function() {
	if (swfobject.hasFlashPlayerVersion("8.0.0")) {
  			$j('#paginate-slider1').css('display', 'none');
	
	function getFMAcontent(){		
		var myXML = '';
		$j('.contentdiv').each(function(idx) {
				myXML += '<feature>';									   
				$j(this).children().each(function(i) {
					if ($j(this).attr('class') == 'real-link') {									
						myXML += '<link>' + $j(this).attr('href') + '</link>'; 
					} else {
						$j(this).children().each(function(e){
								if($j(this).attr('class') == 'fmaimage') {
									// get the image path
									myXML += '<photo>' + $j(this).find('img').attr('src') + '</photo>';
									myXML += '<thumb>/images/fma_thumb.jpg</thumb>';
								} else if ($j(this).attr('class') == 'fmatext') {
									// get the h1 and h2 text
									myXML += '<mainHead>' + $j(this).find('h1').text() + '</mainHead>';
									myXML += '<subHead>' + $j(this).find('h2').text() + '</subHead>';
								}													 
						});
					}
				});
				myXML += '</feature>';
		});		
		
		return '<fma>' + myXML + '</fma>';
		
	}
	
		var flashvars = {};
		flashvars.XMLFile = getFMAcontent();
		var params = {};
		params.allowfullscreen = "false";
		params.scale = "noscale";
		params.wmode = "transparent";
		params.allowscriptaccess = "sameDomain";
		var attributes = {};
		attributes.id = "slider1";
		swfobject.embedSWF("/images/fma.swf", "slider1", "719", "241", "8.0.0", "expressInstall.swf", flashvars, params, attributes);
		
		
	}else {
			
				featuredcontentslider.init({
					id: "slider1", //id of main slider DIV
					contentsource: ["inline", ""], //Valid values: ["inline", ""] or ["ajax", "path_to_file"]
					toc: "#increment", //Valid values: "#increment", "markup", ["label1", "label2", etc]
					nextprev: ["<<", ">>"], //labels for "prev" and "next" links. Set to "" to hide.
					enablefade: [false, 0.1], //[true/false, fadedegree]
					autorotate: [true, 2000], //[true/false, pausetime]
					onChange: function(previndex, curindex){ //event handler fired whenever script changes slide
					//previndex holds index of last slide viewed b4 current (1=1st slide, 2nd=2nd etc)
					//curindex holds index of currently shown slide (1=1st slide, 2nd=2nd etc)
				}
				});
		}

		
		

});// end document ready

