// JavaScript Document

function VideoHomeSWF()
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="266" height="166">')
	document.write('<param name="movie" value="Video/Home/Video-Home.swf" />')
	document.write(' <param name="quality" value="high" />')
	document.write('<embed src="Video/Home/Video-Home.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="266" height="166"></embed>')
	document.write('</object>')
}

function VideoPitStopSWF()
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="266" height="166">')
	document.write('<param name="movie" value="Video/PitStop/Video-PitStop.swf" />')
	document.write(' <param name="quality" value="high" />')
	document.write('<embed src="Video/PitStop/Video-PitStop.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="266" height="166"></embed>')
	document.write('</object>')
}

function VideoFormula3SWF()
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="266" height="166">')
	document.write('<param name="movie" value="Video/F3/Formula3.swf" />')
	document.write(' <param name="quality" value="high" />')
	document.write('<embed src="Video/F3/Formula3.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="266" height="166"></embed>')
	document.write('</object>')
}

function VideoGTSWF()
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="266" height="166">')
	document.write('<param name="movie" value="Video/GT/Video-GT.swf" />')
	document.write(' <param name="quality" value="high" />')
	document.write('<embed src="Video/GT/Video-GT.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="266" height="166"></embed>')
	document.write('</object>')
}

function VideoKartSWF()
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="266" height="166">')
	document.write('<param name="movie" value="Video/Kart/Video-Kart.swf" />')
	document.write(' <param name="quality" value="high" />')
	document.write('<embed src="Video/Kart/Video-Kart.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="266" height="166"></embed>')
	document.write('</object>')
}

function VideoNissanSWF()
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-1s53540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="266" height="166">')
	document.write('<param name="movie" value="Video/Nissan/Nissan.swf" />')
	document.write(' <param name="quality" value="high" />')
	document.write('<embed src="Video/Nissan/Nissan.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="266" height="166"></embed>')
	document.write('</object>')
}

function VideoF1SWF()
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-1s53540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="266" height="166">')
	document.write('<param name="movie" value="Video/F1/Video-F1-CameraCar.swf" />')
	document.write(' <param name="quality" value="high" />')
	document.write('<embed src="Video/F1/Video-F1-CameraCar.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="266" height="166"></embed>')
	document.write('</object>')
}

function VideoYouTube( ytid, vwidth, vheight )
{
	//vwidth = "425";
	//vheight = "344";
	ytpath = "http://www.youtube.com/v/";
	
	
	document.write('<object codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="'+ vwidth +'" height="' + vheight + '">');
	document.write(' <param name="movie" value="' + ytpath + ytid + '" ></param>');
	document.write(' <param name="allowFullScreen" value="true"></param>');
	document.write(' <param name="allowscriptaccess" value="always"></param>');
	document.write(' <param name="quality" value="high" ></param>');
	document.write(' <embed src="' + ytpath + ytid + '" quality="high" allowscriptaccess="always" allowfullscreen="true" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="'+ vwidth +'" height="' + vheight + '"></embed>')
	document.write('</object>')
}


function VideoPagineNew( swf, vwidth, vheight )
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-1s53540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="'+ vwidth +'" height="' + vheight + '">')
	document.write('<param name="movie" value="' + swf +'" />')
	document.write(' <param name="quality" value="high" />')
	document.write('<embed src="' + swf +'" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="'+ vwidth +'" height="' + vheight + '"></embed>')
	document.write('</object>')
}

function VideoPopupWindow(href, title, wwidth, wheight) {
	var stile = "top=20, left=20, width=" + wwidth + ", height=" + wheight + ", status=no, menubar=no, toolbar=no scrollbar=no";
	window.open(href, title, stile);
}

// FUNZIONI VALIDAZIONE FORM

function Trim(stringa)
{
   reTrim=/\s+$|^\s+/g;
   return stringa.replace(reTrim,"");
}

function ControllaMail(strEmail)
{
Filtro = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
if (Filtro.test(strEmail))
{
  return true;
}
else
{
	return false;
}
}


// FUNZIONE TABBER

function Espandi(id)
{
	var el = document.getElementById(id);
	if (el.style.display == "block") 
		el.style.display = "none";
	else
		el.style.display = "block";
}

/*
Yetii - Yetii - Yet (E)Another Tab Interface Implementation
http://www.kminek.pl/lab/yetii/
(c) 2007 Grzegorz Wojcik
It is up to You to leave or remove this copyright notice
---
Slightly modified for IE5.x support by Alessandro Fulciniti - http://www.html.it
*/

function Yetii(obj,active){
    
	this.active = (active) ? active : 1,
    this.timeout = null,
    this.tabclass = 'tab',
    this.activeclass = 'active',
    
    this.getTabs = function(){
 
        var retnode = [];
        var elem = document.getElementById(obj).childNodes;     //modified for IE 5.x support
        for (var i = 0; i < elem.length; i++) {
        if (elem[i].className==this.tabclass) retnode[retnode.length]=elem[i];
        }
    
        return retnode;
    
    },
        
    this.links = document.getElementById(obj+'-nav').getElementsByTagName('a'),
    this.tabs = this.getTabs();
    
    this.show = function(number){
        
        for (var i = 0; i < this.tabs.length; i++) {
        this.tabs[i].style.display = ((i+1)==number) ? 'block' : 'none';
        this.links[i].className = ((i+1)==number) ? this.activeclass : '';
        }
    
    },
    
    this.rotate = function(interval){
    
        this.show(this.active);
        this.active++;
    
        if(this.active > this.tabs.length) this.active = 1;
    
        var self = this;
        this.timeout = setTimeout(function(){self.rotate(interval);}, interval*1000);
    
    },
    
    this.init = function(interval){
    
        this.show(this.active);
        
        var self = this; 
        for (var i = 0; i < this.links.length; i++) {
        this.links[i].customindex = i+1;
        this.links[i].onclick = function(){ if (self.timeout) clearTimeout(self.timeout); self.show(this.customindex); return false; };
        } 
        
        if (interval) this.rotate(interval);
            
    };

};
