﻿$(document).ready(function () {
  $(function() {
       $.ajax({
           type: "GET",
           url: "RIFlash/RIcontent.xml",
           dataType: "xml",
           success: function(xml) {
               $(xml).find('Image').each(function(){
                  
                   var imageSrc = $(this).text();
                   var imageAlt = $(this).attr('alt');
                   var imageWidth = $(this).attr('width');
                   var imageHeight = $(this).attr('height');
                    var imagelink = $(this).attr('link');
                    var imageClass = $(this).attr('class');
                    if((imageClass == 'img1') || (imageClass == 'img2')  || (imageClass == 'img4'))
                        {  
                            $("#FlashBox").append('<a href="' + imagelink+ '"><img src="'+imageSrc+'" alt="'+imageAlt+'" width="'+imageWidth+'" height="'+imageHeight+'" /></a>');
                        }

                    else
                        {
                            $("#FlashBox").append('<a href="video.aspx" target="name"' + ' onclick="window.open(\'video.aspx\',\'name\',\'left=500px,top=100px,height=610,width=610,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no\'); return false;"><img src="' + imageSrc + '" alt="' + imageAlt + '" width="' + imageWidth + '" height="' + imageHeight + '" />');
                            //$("#FlashBox").append('<img src="'+imageSrc+'" alt="'+imageAlt+'" width="'+imageWidth+'" height="'+imageHeight+'" />');
                        }
               }); //close each(
           }
       }); //close $.ajax(
     }); //close $(

  
  
  
    // index Flash
    $('#FlashBox').ajaxComplete(function(even, request, settings) {
      $('#FlashBox').cycle({
        fx:      'fade', 
        speed:    1500, 
        timeout:  5000,
		    pause: 		true,
		    pauseOnPagerHover: true
	   
      });
    });

  });


