﻿ 
$(function() {
       $.ajax({
           type: "GET",
           url: "RIFlash/RIcontent.xml",
           dataType: "xml",
           success: function(xml) {
               $(xml).find('Item').each(function(){         
                  var imageAlt = $(this).attr('alt');
                  var imageWidth = $(this).attr('width');
                  var imageHeight = $(this).attr('height');
                  var imageSrc = $(this).attr('src');
                  var linkSrc = $(this).attr('link');
                  var targetSrc = $(this).attr('target');  
           
                  $("#image_wrap").append('<a href="'+linkSrc+'" target="'+targetSrc+'"><img src="'+imageSrc+'" alt="'+imageAlt+'" width="'+imageWidth+'" height="'+imageHeight+'" /></a>');
               }); //close each(
           } //close success
       }); //close $.ajax
    
       
       
       $('#image_wrap').ajaxComplete(function(even, request, settings) {
       $('#image_wrap').cycle({
        fx:      'fade', 
        speed:    1500, 
        timeout:  5000,
        next: '.next',
        prev: '.prev',
	    pause: 		true,
	    pauseOnPagerHover: true,
	    pager: "#innerFlashBox ",
	    pagerAnchorBuilder: function(idx, slide) {
		    return '<a><img src="RIFlash/smallPic/img0' + (idx+1) +'_thumb.jpg" alt=""/></a>';}
		    
      });//close cycle
   
     });  //   close $.ajaxComplete   

//      $(".scrollable").scrollable();
      
});//close document.ready      
     
//  });//close get doc


