jQuery.noConflict();
jQuery(document).ready(function($){

	$.ajaxSetup ({
		// Disable caching of AJAX responses
		cache: false
	});
	
	$.ajax({
		type: "GET",
		url: "./quoteslideshow.xml",
		dataType: ($.browser.msie) ? "text" : "xml",
		success: function(data) {
			//alert('success');
			var xml;
			
			if (typeof data == "string") {
				xml = new ActiveXObject("Microsoft.XMLDOM");
				xml.async = false;
				xml.loadXML(data);
			} else {
				xml = data;
			}
				
			$(xml).find('quoteslide').each(function(){
				var $myslide = $(this); 
				var number = $myslide.attr('id');
				
				var quotation = $myslide.find('quotation').text();
				var ccifpname = $myslide.find('ccifpname').text();
				var company = $myslide.find('company').text();
				
				var imageurl = $myslide.attr('imageurl');	
				var newcontent = '<div class="slides" id="' + number + '" >';
				newcontent += '<img style="float: left; width: 128px;" alt="" src="' + imageurl + '" />'; 
				newcontent += '<p style="float: left; padding-top: 5px; width: 220px;">'; 
				newcontent += '<p>' + quotation + '</p>' + '<strong>' + ccifpname + '</strong>' + '<br />' + '<strong>' + company + '</strong>'; 
				newcontent += '</p>'; 
				newcontent += '<div style="clear:both;">' + '</div>' + '</div>';
				$('#photo-slider').append($(newcontent));
			}); 
			
			$("#photo-slider").after('<div id="slide-navigation"></div>').cycle({ 
				fx:'fade', 
				speed: 500,
				force: 1,
				timeout: 5500,
				pause: 1,
				pauseOnPagerHover: 1,
				pager:  0 
			});
			
			$("a:contains('HIDDEN')").hide();
		
		} ,
		error: function(){
    		alert('failure');
  		}
	});
	
	
	
});


