 $(document).ready(function()
	{
	 $.ajax({
		type: "GET",
		url: "../wp-content/themes/sepia/slideshow/photos_top.xml",
		dataType: "xml",
		success: parseXml1
	  });
	  
	   $.ajax({
		type: "GET",
		url: "../wp-content/themes/sepia/slideshow/photos_KS.xml",
		dataType: "xml",
		success: parseXml2
	  });
	  
	  $.ajax({
		type: "GET",
		url: "../wp-content/themes/sepia/slideshow/photos_KE.xml",
		dataType: "xml",
		success: parseXml3
	  });
	 
	 $.ajax({
		type: "GET",
		url: "../wp-content/themes/sepia/slideshow/photos_DDS.xml",
		dataType: "xml",
		success: parseXml4
	  });
	 
	  $.ajax({
		type: "GET",
		url: "../wp-content/themes/sepia/slideshow/photos_QQS.xml",
		dataType: "xml",
		success: parseXml5
	  });
	 
	 $.ajax({
		type: "GET",
		url: "../wp-content/themes/sepia/slideshow/photos_D220.xml",
		dataType: "xml",
		success: parseXml6
	  });
	 
	  $.ajax({
		type: "GET",
		url: "../wp-content/themes/sepia/slideshow/photos_D221.xml",
		dataType: "xml",
		success: parseXml7
	  });
	 
	 
	 
});


function parseXml1(xml1)
{
  
  $(xml1).find("image").each(function()
  {
    var imgurl1 = $(this).attr("url");
	var newimgurl1 = ".."+imgurl1;
	$("#slideshow1").append("<img src="+newimgurl1+">");
	
  });

}

function parseXml2(xml2)
{
  
  $(xml2).find("image").each(function()
  {
    var imgurl2 = $(this).attr("url");
	var newimgurl2 = ".."+imgurl2;
	$("#slideshow2").append("<img src="+newimgurl2+">");
	
  });

}

function parseXml3(xml3)
{
  
  $(xml3).find("image").each(function()
  {
    var imgurl3 = $(this).attr("url");
	var newimgurl3 = ".."+imgurl3;
	$("#slideshow3").append("<img src="+newimgurl3+">");
	
  });

}

function parseXml4(xml4)
{
  
  $(xml4).find("image").each(function()
  {
    var imgurl4 = $(this).attr("url");
	var newimgurl4 = ".."+imgurl4;
	$("#slideshow4").append("<img src="+newimgurl4+">");
	
  });

}

function parseXml5(xml5)
{
  
  $(xml5).find("image").each(function()
  {
    var imgurl5 = $(this).attr("url");
	var newimgurl5 = ".."+imgurl5;
	$("#slideshow5").append("<img src="+newimgurl5+">");
	
  });

}

function parseXml6(xml6)
{
  
  $(xml6).find("image").each(function()
  {
    var imgurl6 = $(this).attr("url");
	var newimgurl6 = ".."+imgurl6;
	$("#slideshow6").append("<img src="+newimgurl6+">");
	
  });

}

function parseXml7(xml7)
{
  
  $(xml7).find("image").each(function()
  {
    var imgurl7 = $(this).attr("url");
	var newimgurl7 = ".."+imgurl7;
	$("#slideshow7").append("<img src="+newimgurl7+">");
	
  });

}




function slideSwitch1() {
    var $active = $('#slideshow1 IMG.active');

    if ( $active.length == 0 ) $active = $('#slideshow1 IMG:last');

   
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow1 IMG:first');

  
    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

function slideSwitch2() {
    var $active = $('#slideshow2 IMG.active');

    if ( $active.length == 0 ) $active = $('#slideshow2 IMG:last');

   
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow2 IMG:first');

  
    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

function slideSwitch3() {
    var $active = $('#slideshow3 IMG.active');

    if ( $active.length == 0 ) $active = $('#slideshow3 IMG:last');

   
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow3 IMG:first');

  
    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

function slideSwitch4() {
    var $active = $('#slideshow4 IMG.active');

    if ( $active.length == 0 ) $active = $('#slideshow4 IMG:last');

   
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow4 IMG:first');

  
    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

function slideSwitch5() {
    var $active = $('#slideshow5 IMG.active');

    if ( $active.length == 0 ) $active = $('#slideshow5 IMG:last');

   
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow5 IMG:first');

  
    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

function slideSwitch6() {
    var $active = $('#slideshow6 IMG.active');

    if ( $active.length == 0 ) $active = $('#slideshow6 IMG:last');

   
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow6 IMG:first');

  
    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

function slideSwitch7() {
    var $active = $('#slideshow7 IMG.active');

    if ( $active.length == 0 ) $active = $('#slideshow7 IMG:last');

   
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow7 IMG:first');

  
    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}




$(function() {
    setInterval( "slideSwitch1()", 4050 );
});

$(function() {
    setInterval( "slideSwitch2()", 5000 );
});

$(function() {
    setInterval( "slideSwitch3()", 4050 );
});


$(function() {
    setInterval( "slideSwitch4()", 5000 );
});



$(function() {
    setInterval( "slideSwitch5()", 4050 );
});



$(function() {
    setInterval( "slideSwitch6()", 5000 );
});


$(function() {
    setInterval( "slideSwitch7()", 4050 );
});











