﻿$(function(){
$(".fade").load(function()
{
	$(this).fadeTo(100, 0.0);
	$(this).fadeTo(500, 1.0);
	
	if ( isfirst )
	{
	    isfirst = false;
	    timer = setTimeout(pic_change1_before, 7000);
	}
});
});

var timer;
var num = 2;
var isfirst = true;
var nochange = false;

function pic_change1_before() 
{
    clearTimeout(timer);
    
    document.images["screenshot"].src="./img/screenshot" + num + ".png";
    
    num = num + 1;

    if ( !nochange )
    {    
        timer = setTimeout(pic_change1_before, 7000);
    }
    
    if ( num > 4 ) 
    {
        num = 1;
        nochange = true;
    }
    
   
}
