// JavaScript Document


// Define the entry point
$(document).ready(function () {


    // The DOM (document object model) is constructed

    // We will initialize and run our plugin here

    Slideshow();

    InitMenu();
});

function InitMenu() {

 

}


var lastframe = 0;

function Slideshow() {

if($('#slideshowFrame2').attr('class')!= null)
{
  if($('#slideshowFrame' + (lastframe+1)).attr('class')!= null)
  {
    $('#slideshowFrame' + (lastframe+1)).fadeIn('slow',function(){ 
    $('#slideshowFrame' + lastframe).css('display','none');
    lastframe=(lastframe+1);
    });
  }
  else {
    $('#slideshowFrame' + 1).css('display', 'block');
    $('#slideshowFrame' + lastframe).fadeOut('slow', function () { 
    lastframe=1;
    });
  }

  setTimeout('Slideshow()', 10000);
}
else
{
$('#slideshowFrame' + (lastframe+1)).fadeIn('slow',function(){ 
    $('#slideshowFrame' + lastframe).css('display','none');
    lastframe=(lastframe+1);
    });
}
}

function LoadContent(newContent) {

    var toLoad = './contents/' + newContent + '.html';
    if (!$.browser.msie) {
        $('#jscontent').fadeOut('normal', loadContent);
    }
    else {
        $('#jscontent').load(toLoad, '', InitListeners);
    }

    function showNewContent() {
        $('#jscontent').fadeIn('normal');
        InitListeners();
    }

    function loadContent() {
        $('#jscontent').load(toLoad, '', showNewContent);
    }


}

