$(function() {
$('#slideshow').hide();
var timeoutID1;
var timeoutID2;
$('#slideshow img:first').load(function(){
		//alert('slideshow img:first Load');
		timeoutID1 = window.setTimeout(function() { $('#slideshow img:first').trigger('load'); },1000);
		if($('#slideshow img:first').attr( "complete"))
		{
		window.clearTimeout(timeoutID1);
		//alert('slideshow img:first Complete');
		$('#slideshow').fadeIn();		
		$('#slideshow').cycle({
			fx:     'fade',
			speed:  1500,
			timeout: 1,
			pager:  '#nav',
			pause: 1,
			pagerAnchorBuilder: function(idx, slide) {
				// return sel string for existing anchor
				return '#nav li:eq(' + (idx) + ') a';
			}
		});
		}	
	
});

$('.HeaderCycle img:first').load(function(){
		//alert('slideshow img:first Load');
		timeoutIDHeader = window.setTimeout(function() { $('.HeaderCycle img:first').trigger('load'); },1000);
		if($('.HeaderCycle img:first').attr( "complete"))
		{
		window.clearTimeout(timeoutIDHeader);
		//alert('slideshow img:first Complete');		
		$('.HeaderCycle').fadeIn();		
		$('.HeaderCycle').cycle({
			fx:     'fade',
			speed:  3500,
			timeout: 1			
		});
		}		
});


	timeoutID1 = window.setTimeout(function() { $('#slideshow img:first').trigger('load'); },1000);
	
	timeoutIDHeader = window.setTimeout(function() { $('.HeaderCycle img:first').trigger('load'); },1000);
	
	$('img.headerimage').load(function(){
	
		timeoutID2 = window.setTimeout(function() {$('img.headerimage').trigger('load');},1000);
		//alert('img.headerimage Load');
		if($(this).attr( "complete"))
		{				
			window.clearTimeout(timeoutID2);	
			//alert('img.headerimage Complete');
			$(this).fadeIn(2500);			
		}
		
	});				
	
	timeoutID2 = window.setTimeout(function() {$('img.headerimage').trigger('load');},1000);
	
});

function animate()
{

}