// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

function aggiornaMaschera (url, wid, tipo) {
	if (!tipo) return false;

	new Ajax.Updater('maschera',url,{
		method: "get",
		parameters: { 'wid': wid, 'tipo': tipo }
	});	
}

function controlloJS (id, tipo, velocita, orientamento) {
	if (tipo == 0) {
		// elenco
	} else if (tipo == 1) {
		// marquee
		var options = { speed : (velocita ? velocita/1000 : 2) };
		if (orientamento == 0) {
			new horizontalMarquee('resty_press_'+id,options);
		} else {
			new verticalMarquee('resty_press_'+id,options);
		} 	
	} else if (tipo == 2) {
		// random
		var classe = '.press_type_'+id;
		var list = $$(classe);
		var n = Math.floor(Math.random()*list.size());
		list[n].show();
		if (velocita) slideshow(classe, velocita);		
	}
}

function slideshow (classe, velocita) {
	alert('slideshow')	
}
