var SSnum;


	function aleatorio(inferior,superior){
    	numPossibilidades = superior - inferior
    	aleat = Math.random() * numPossibilidades
    	aleat = Math.floor(aleat)
    	return parseInt(inferior) + aleat
	}

    function mudaSS(inImagens, destino, tempo) {
    	if ( document.getElementById(destino) ) {
    		var imagens = new Array();
			imagens = inImagens.split(',');
			document.getElementById(destino).src=imagens[aleatorio(0,(imagens.length-1))];
			setTimeout("mudaSS('"+inImagens+"','"+destino+"','"+tempo+"')", tempo);
    	}
    }

    function mudaSS_Seq(inImagens, destino, tempo, pos) {
    	if ( pos == null )
    		var pos = 0;
    	if ( document.getElementById(destino) ) {
    		var imagens = new Array();
			imagens = inImagens.split(',');
    			if ( pos == imagens.length )
		    		pos = 0;
			document.getElementById(destino).src=imagens[pos];
			document.getElementById('link'+destino).href=imagens[pos];
			pos++;
			SSnum=pos+1;
			setTimeout("mudaSS_Seq('"+inImagens+"','"+destino+"','"+tempo+"','"+pos+"')", tempo);
    	}

    }
