/*
 * Proyecto 83 - http://proyecto83.com
 * Copyright (C) 2008 Emilio Mariscal
 * 
 * == BEGIN LICENSE ==
 * 
 * Licensed under the terms of any of the following licenses at your
 * choice:
 * 
 *  - GNU General Public License Version 2 or later (the "GPL")
 *    http://www.gnu.org/licenses/gpl.html
 * 
 *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
 *    http://www.gnu.org/licenses/lgpl.html
 * 
 * == END LICENSE ==
 * 
 * 	File Name  :
 *
 * 	visualfx.js
 *
 * File Authors :
 * 		Emilio Mariscal ( emi420@gmail.com )
 */

window.onload = function() {

	var slidesCount = 3 ;
	Effect.MoveBy( 'roundedbox', 20, 0 , {duration: 0.3,  transition: Effect.Transitions.sinoidal});
	startSlideshow(1, slidesCount, 3200);
	   
    function startSlideshow(startFrame, endFrame, delay) {
		for( i = 2 ; i <= endFrame ; i++ ) { document.getElementById('slideshow' + i).style.display='none'; }
        setTimeout(switchSlides(startFrame,startFrame,endFrame, delay), delay);
    }
                            
    function switchSlides(frame, startFrame, endFrame, delay) {
        return (function() {
			var dist = 52 ;
			if( frame == endFrame )
				dist = -104
			Effect.MoveBy( 'roundedbox', dist, 0 , {duration: 0.3,  transition: Effect.Transitions.sinoidal});
            Effect.Fade('slideshow' + frame);
            if (frame == endFrame) { frame = startFrame; } else { frame = frame + 1; }
            setTimeout("Effect.Appear('slideshow" + frame + "');", 850);
            setTimeout(switchSlides(frame, startFrame, endFrame, delay), delay + 850);
			
        })
    }
	
}


