/**
 * @script: site.js
 * @website: Pneustar & Pneuspoleto <http://pneuspoleto.it/>
 * @last-update: 2009-04-08
 * @version: 1.8
 *
 * Current MooTools version: 1.2.1 stable <http://mootools.net/>
 *
 * @author: Leonardo Laureti <l.laureti@syn-ergo.com>
 * @copyright: 2009 Syn-Ergo snc, <http://syn-ergo.com/>
 *
 * Tested:
 * 	Safari 2+
 * 	Firefox 1.5+
 * 	Opera 9+
 * 	IE 6+
*/

window.addEvent('domready', function(){

	if($('slideshow')){
		var slideshow_info = $('slideshow_info').set('opacity',0.6);
		var slideshow_fx = {property:'left',duration:1500, transition:Fx.Transitions.Back.easeOut, wait:false};
		var slides =[
			{title:'L\'affidabilit&agrave; che ti serve quando ti serve!!!!', subtitle:'Benvenuti nel nostro nuovo sito!'},
			{title:'Tutti i consigli utili sui pneumatici', subtitle:'Vai alla sezione Consigli'}
		];
		var slideshow = new noobSlide({
			mode: 'vertical',
			box: $('slideshow_inner'),
			size: 300,
			items: slides,
			fxOptions: slideshow_fx,
			interval: 7500,
			autoPlay: true,
			onWalk: function(currentItem){
				slideshow_info.empty();
				new Element('h4').set('html','<span>'+currentItem.subtitle+'</span>'+currentItem.title).inject(slideshow_info);
			}
		});
	}

	if($('securedCaptcha')){
		$('securedCaptcha').addEvent('click', function(el){
			el.stop();
			var identifier = this.getProperty('rel');
			this.set('load', {method: 'get'});
			this.load('secured/' + identifier + '/refresh');
		});
	}
	
	
	var external = $$('a.external');
	external.each(function(link){
		link.set('target', '_blank');
	});

});
