/* ----------------------------------------------------------
	title		  : CR Framework
	created		  : 9/2/08
	last updated  : 9/2/08
	history		  :
---------------------------------------------------------- */



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

//hide to load images
//remove default placeholder
$('#feature-rotator').css('display','none').empty();



	
	$.ajax({
		type: "GET",
		url: "/Websites/canopyroads/templates/crTheme/feature.xml",
		dataType: "xml",
		success: function(xml) {
			$(xml).find('album').each(function(){
				var dirPath = $(this).attr('lgPath');
					
					$(this).find('img').each(function(){
						var imgPath = $(this).attr('src');			
						var linkPath = $(this).attr('link');
						
						
						var newImg = '<img src="' + dirPath + imgPath + '" alt="" />';
						
						if (linkPath == '#' || linkPath == '' || linkPath == null) {
							//do nothing						
							} else {
							var newImg = '<a href="' + linkPath + '">'+ newImg + '</a>';
							}
						
						
						$(newImg).appendTo('#feature-rotator');
					
					});
			}); 
		
		
		$('#feature-rotator').cycle('fade').css('display','block');
		}
	}); 
	






//if section nav is empty
var sectionNavHTML = $('#section-nav').children();

if ($(sectionNavHTML).length == 0) {
	$('#section-nav').remove();
}


});//end doc ready