var timer = null;
var mouse = false;
var lastMouse = false;

function showDiv(id){ mouse = id; }

setInterval(function() {
    //alert(mouse);
    
    if(mouse == false){
        for(x=1; x < 10; x++){
            hideDiv('prod'+x);
        }
    }else{
        if(lastMouse != mouse){ hideDiv(lastMouse); }
        lastMouse = mouse;
        div = document.getElementById(mouse);
        div.style.display = "block";
    }
}, 250);
        
function hideDiv(id){
    if( document.getElementById(id) ){
        div = document.getElementById(id);
        div.style.display = "none";
    }
    return;
}

function preloadProducts(){
    if (document.images){
        preload_image_object = new Image();
        
        // set image url
        image_url = new Array();
        
        for(i=0; i<=9; i++){
            image_url[i] = "products/prod"+ i +".jpg";    
        }
        //now preload it        
        for(i=0; i<=3; i++){ 
          preload_image_object.src = image_url[i];
        }
    }  
}

$(document).ready( function() {
   $('.toWinner').click( function(){
      window.location = 'jacques.php';  
   });
    
    $('.toRegister').click( function(){
      window.location = 'new-account.php';  
   });
    
    $('.toPortfolio').click( function(){
        window.location = 'products.php';
    });
    
});