﻿//    var timerInterval = 5000;
//    
//    var currentImage = 1;

//function animateHomepageImages()
//{
//    setInterval("animateNextImage(currentImage)", timerInterval);
//}

//function animateNextImage(count)
//{
//    var jQueryId;
//    var lastImage = 0;
//    
//    if(count < 1)
//    {
//        count++;
//        lastImage = -1;
//    }

//    switch(count) 
//    {
//        case 1:
//            if(lastImage > -1)
//            {
//                lastImage = 3;
//            }
//           
//            if(lastImage == 3) {
//                $("#popup3").fadeOut("100", function() {
//                    showImage("#popup1", "170px", "101px", "0px");                
//                });
//            }
//            else
//            {
//                showImage("#popup1", "163px", "102px", "0px");
//            } 
//            break;   
//        case 2: 
//            $("#popup1").fadeOut("100", function() {
//                showImage("#popup2", "163px", "112px", "0px");
//            });
//            break;
//        case 3:
//            $("#popup2").fadeOut("100", function() {
//                showImage("#popup3", "170px", "112px", "3px");
//            });
//            break;
//    }
//    
//    if(currentImage < 3)
//    {
//        currentImage++; 
//    }
//    else
//    {
//        currentImage = 1;
//    }
//}

function showImage(id, finalWidth, finalHeight, finalMarginTop)
{


    $(id).removeAttr("style");
    $(id).css("display", "block");
    
    
    $(id).animate({
        width: finalWidth,
        height: finalHeight,
        marginTop: finalMarginTop},
        500
    );  
 
}

$(document).ready(function() {
    $("#thumb1").mouseover(function(){showImage("#popup1", "163px", "102px", "0px");})
    $("#popup1").mouseout(function(){$("#popup1").fadeOut("100");});
    $("#thumb2").mouseover(function(){showImage("#popup2", "163px", "112px", "0px");})
    $("#popup2").mouseout(function(){$("#popup2").fadeOut("100");}); 
    $("#thumb3").mouseover(function(){showImage("#popup3", "165px", "112px", "0px");})
    $("#popup3").mouseout(function(){$("#popup3").fadeOut("100");});   
    
    $('ul#moa_images').innerfade({
					speed: 1000,
					timeout: 5000,
					type: 'sequence',
					containerheight: '220px'
				});
});




 