String.implement({

    /**
 * String.truncate(max, atChar, trail)
 *
 * ++All parameters are optional.
 * @param max = (integer) maximum length of truncated string. Defaults to 100 chars.
 * @param atChar = (string) truncate at the last index of this string. If not found, just truncates to max length.
 *                 If null, does not search and truncates to max length. Defaults to split at space.
 * @param trail = (string) what you want appended to the end of the returned string. Defaults to '...'
 *
 * @author Michael Fuery, Fuery Solutions, Inc. http://www.fuerysolutions.com/
 *
 * +Requires MooTools Core
 */
    truncate:function(max, trail, atChar){
	var s = this.trim();
	if(s.length < 1) return '';
	max = $pick(max, 100);
	atChar = $pick(atChar, false); // break at space
	trail = $pick(trail, '...');
	if(s.length > max){
	    if(atChar){
		var index = s.lastIndexOf(atChar);
		lastIndex = (index != -1)? index: max;
		s = s.substring(0, lastIndex);
	    }
	    s += trail;
	}
	return s;
    }
});

function paragrafoEventi(){
    var container = $$('.eventiVBO_testo');
    container.each(function(el){
	var paragrafi=el.getElements('p');
	var testo='';
	paragrafi.each(function(paragrafo){
	    testo += paragrafo.get('html');
	});
	el.store('testoCompleto','<p>'+testo+'</p>');
	testoTroncato='<p>'+testo.truncate(200,'...',true)+'</p>';
	el.set('html',testoTroncato);
	var espandi = new Element('div', {
	    'class': 'Espandi',
	    'html': '['+getGlobalLabel("Espandi")+'...]',
	    'onclick': "var container=$$('.eventiVBO_testo');container.each(function(el){if(this.getParent('div')!=el){el.set('html',el.retrieve('testoTroncato'));}else{el.set('html',el.retrieve('testoCompleto'));}}.bind(this));",
	    'styles': {
		'display': 'block',
		'color': 'black',
		'font-size': '10px',
		'cursor': 'pointer'
	    }
	});
	if(testo.length>200){
	    espandi.inject(el);
	}
	el.store('testoTroncato',el.get('html'));
    });
}

function disabilitatoENascosto(id,tipo,nomeValidatore){
    switch (tipo){
	case 'select':
	    nomeValidatore.unregister('lbl_'+id);
	    break;
	case 'required':
	    nomeValidatore.unregister(id);
	    break;
	case 'check':
	    nomeValidatore.unregister(id+'_1');
	    break;
    }
    $('fieldContainer_'+id).setStyle('display','none');
    $(id).setProperty('readonly','readonly');
    $(id).setProperty('disabled','disabled');
    $(id).set('value','');
}
function obbligatorio(id,type,nomeValidatore){
    switch (type){
	case 'select':
	    nomeValidatore.register(id,{
	    type: "select",
	    re: /^[-+]?[1-9]\d*$/,
	    msg: "validate_occorreSelezionare"
	});
	break;
	case 'required':
	    nomeValidatore.register(id,{
	    type: "required",
	    re: /[^.*]/,
	    msg: "validate_campoVuoto"
	});
	break;
	case 'check':
	    nomeValidatore.register(id+'_1',{
	    type: "required",
	    re: /[^.*]/,
	    msg: "validate_campoVuoto"
	});
	break;
    }
    $(id).removeProperty('readonly','readonly');
    $(id).removeProperty('disabled','disabled');
    $('fieldContainer_'+id).setStyle('display','block');
}

function candidatura_onClickSubmit(){
    isValid=true;
    $('areeInteresse').getFirst('p').setStyle('color','black');
    $('tipoContratto').getFirst('p').setStyle('color','black');
	
    var areaInteresse = ['inputField_candidatura_AIPtecnicolaboratorio','inputField_candidatura_AIPasstecnicapostv',
    'inputField_candidatura_AIPcommercialeitalia','inputField_candidatura_AIPcommercialeestero','inputField_candidatura_AIPamministrazione','inputField_candidatura_AIPcomunicazione','inputField_candidatura_AIPdisegnotecnico','inputField_candidatura_AIPacquisti','inputField_candidatura_AIPqualita','inputField_candidatura_AIPlogistica','inputField_candidatura_AIPrisorseumane','inputField_candidatura_AIPprogettazione','inputField_candidatura_AIParchitettura','inputField_candidatura_AIPingegnerizzazione','inputField_candidatura_AIPinformatica','inputField_candidatura_AIPreception','inputField_candidatura_AIPservizi'];
	
    contatoreInteresse=0;
    areaInteresse.each(function(el){
	contatoreInteresse = $(el+'_1').get('checked')? contatoreInteresse+1 : contatoreInteresse;
    });
    if($('areeInteresse_msg')) $('areeInteresse_msg').dispose();
    if(contatoreInteresse>3 || contatoreInteresse==0){
	isValid=false;
	$('areeInteresse').getFirst('p').setStyle('color','red');
	var thead = new Element('div', {
	    'id': 'areeInteresse_msg',
	    'class': 'fValidator-msg',
	    'html': 'selezionare da 1 a 3 interessi'
	}).inject($('areeInteresse').getFirst('p'));
    }
	
    var cadidatura = ['inputField_candidatura_CONTRtempoind','inputField_candidatura_CONTRtempodet','inputField_candidatura_CONTRapprendistato','inputField_candidatura_CONTRtirocinio','inputField_candidatura_CONTRcocopro','inputField_candidatura_CONTRparttime'];
    contatoreCadidatura=0;
    cadidatura.each(function(el){
	contatoreCadidatura = $(el+'_1').get('checked')? contatoreCadidatura+1 : contatoreCadidatura;
    });
    if($('cadidatura_msg')) $('cadidatura_msg').dispose();
    if(contatoreCadidatura==0){
	isValid=false;
	$('tipoContratto').getFirst('p').setStyle('color','red');
	var thead = new Element('div', {
	    'id': 'cadidatura_msg',
	    'class': 'fValidator-msg',
	    'html': 'selezionare almeno un tipo di contratto'
	}).inject($('tipoContratto').getFirst('p'));
    }

    return isValid;
}

function candidatura_beforeSubmit(){
    if ( !$("checkPrivacy").get('checked') ) {
	Mediabox.open("#mb_checkPrivacy", '', '300 30');
	isValid=false;
    } else {
	isValid=true;
    }
    return isValid;
}

function candidatura_Laurea_change(idLaurea){
    switch (idLaurea) {
	case '1': // Nessuno selezionato
	case '0':
	    disabilitatoENascosto('inputField_candidatura_SpecificaLaurea','required',validatore_form_candidatura);
	    break;
	default:
	    obbligatorio('inputField_candidatura_SpecificaLaurea','required',validatore_form_candidatura);
	    break;
    }
}

function candidatura_Diploma_change(idDiploma){
    switch (idDiploma) {
	case '1': // Nessuno selezionato
	case '0':
	    disabilitatoENascosto('inputField_candidatura_SpecificaDiploma','required',validatore_form_candidatura);
	    break;
	default:
	    obbligatorio('inputField_candidatura_SpecificaDiploma','required',validatore_form_candidatura);
	    break;
    }
}
function candidatura_Specializzazioni_click(div){
    temp=$$("#"+div.id+" input[checked]");
    if (temp.length>0) {
	if (temp[0].get("value")==1) { //se e' si
	    obbligatorio('inputField_candidatura_SpecializzazioniSpecifica','required',validatore_form_candidatura);
	} else {
	    disabilitatoENascosto('inputField_candidatura_SpecializzazioniSpecifica','required',validatore_form_candidatura);
	}
    }else{
	disabilitatoENascosto('inputField_candidatura_SpecializzazioniSpecifica','required',validatore_form_candidatura);
    }
}

function candidatura_Domicilio_click(div){
    temp=$$("#"+div.id+" input[checked]");
    if (temp.length>0) {
	if (temp[0].get("value")==1) { //se e' si
	    obbligatorio('inputField_candidatura_IndirizzoDomicilio','required',validatore_form_candidatura);
	    obbligatorio('inputField_candidatura_CapDomicilio','required',validatore_form_candidatura);
	    obbligatorio('inputField_candidatura_LocalitaDomicilio','required',validatore_form_candidatura);
	    obbligatorio('inputField_candidatura_ProvinciaDomicilio','required',validatore_form_candidatura);
	    obbligatorio('inputField_candidatura_StatoDomicilio','required',validatore_form_candidatura);
	} else {
	    disabilitatoENascosto('inputField_candidatura_IndirizzoDomicilio','required',validatore_form_candidatura);
	    disabilitatoENascosto('inputField_candidatura_CapDomicilio','required',validatore_form_candidatura);
	    disabilitatoENascosto('inputField_candidatura_LocalitaDomicilio','required',validatore_form_candidatura);
	    disabilitatoENascosto('inputField_candidatura_ProvinciaDomicilio','required',validatore_form_candidatura);
	    disabilitatoENascosto('inputField_candidatura_StatoDomicilio','required',validatore_form_candidatura);
	}
    }else{
	disabilitatoENascosto('inputField_candidatura_IndirizzoDomicilio','required',validatore_form_candidatura);
	disabilitatoENascosto('inputField_candidatura_CapDomicilio','required',validatore_form_candidatura);
	disabilitatoENascosto('inputField_candidatura_LocalitaDomicilio','required',validatore_form_candidatura);
	disabilitatoENascosto('inputField_candidatura_ProvinciaDomicilio','required',validatore_form_candidatura);
	disabilitatoENascosto('inputField_candidatura_StatoDomicilio','required',validatore_form_candidatura);
    }
}

function selettore(elementi,classe){
    var tabs = $$(elementi);
    tabs.each(function(tab){
	tab.addEvent("mouseover", function() {
	    tabs.each(function(tab){
		tab.removeClass(classe)
		});
	    this.addClass(classe);
	}.bind(tab));
	tab.addEvent("mouseleave", function() {
	    tabs.each(function(tab){
		tab.removeClass(classe)
		});
	}.bind(tab));
    });
}


var SimpleSlideshow = new Class({
    options: {
	showControls: false,
	showDuration: 5000,
	showTOC: false,
	tocWidth: 20,
	tocHeight: 20,
	tocLimit: 12,
	tocClass: 'toc',
	tocActiveClass: 'toc-active',
	autoRun: true
    },
    Implements: [Options,Events],
    initialize: function(container,elements,options) {
	this.setOptions(options);
	this.container = $(container);
	this.elements = $$(elements);
	this.currentIndex = 0;
	this.interval = '';
	if(this.options.showTOC) this.toc = [];
		
	this.elements.each(function(el,i){
			
	    if(this.options.showTOC && this.elements.length>1) {
		this.toc.push(new Element('a',{
		    text: i+1,
		    href: '#',
		    'class': this.options.tocClass + '' + (i == 0 ? ' ' + this.options.tocActiveClass : ''),
		    events: {
			click: function(e) {
			    if(e) e.stop();
			    this.stop();
			    this.show(i);
			}.bind(this)
		    },
		    styles: {
			left: ( ( ( i ) % this.options.tocLimit ) * (this.options.tocWidth + 10) ),
			top: this.container.getStyle('height').toInt() + ( ((i + this.options.tocLimit) / this.options.tocLimit ).toInt() * 25 )
		    // 						bottom: this.options.tocHeight - (((i + this.options.tocLimit) / this.options.tocLimit ).toInt() * 25 )
		    }
		}).inject(this.container.getParent('div')));
	    }
	    if(i > 0) el.set('opacity',0);
	},this);
		
	if(this.options.showControls && this.elements.length>1) {
	    this.createControls();
	}
	if(this.options.autoRun){
	    this.container.addEvents({
		mouseenter: function() {
		    this.stop();
		}.bind(this),
		mouseleave: function() {
		    this.start();
		}.bind(this)
	    });
	}

    },

    show: function(elementTo) {
	if(this.elements.length>1){
	    this.elements[this.currentIndex].fade('out');
	    if(this.options.showTOC) this.toc[this.currentIndex].removeClass(this.options.tocActiveClass);
	    this.elements[this.currentIndex = ($(this.elements[elementTo]) ? elementTo : (this.currentIndex < this.elements.length - 1 ? this.currentIndex+1 : 0))].fade('in');
	    if(this.options.showTOC) this.toc[this.currentIndex].addClass(this.options.tocActiveClass);
	}
    },

    start: function() {
	this.interval = this.show.bind(this).periodical(this.options.showDuration);
    },
    stop: function() {
	$clear(this.interval);
    },

    createControls: function() {
	var next = new Element('a',{
	    href: '#',
	    id: 'next',
	    text: '',
	    events: {
		click: function(e) {
		    if(e) e.stop();
		    this.stop();
		    this.show();
		}.bind(this),
		mouseover: function(e){
		    this.setStyle("opacity",1)
		},
		mouseout: function(e){
		    this.setStyle("opacity",0.2)
		}
	    }
	}).inject(this.container);
	var previous = new Element('a',{
	    href: '#',
	    id: 'previous',
	    text: '',
	    events: {
		click: function(e) {
		    if(e) e.stop();
		    this.stop();
		    this.show(this.currentIndex != 0 ? this.currentIndex -1 : this.elements.length-1);
		}.bind(this),
		mouseover: function(e){
		    this.setStyle("opacity",1)
		},
		mouseout: function(e){
		    this.setStyle("opacity",0.2)
		}
	    }
	}).inject(this.container);
    }
});

function comparsa(){
    var toggle=$('ricerca_rapida').retrieve('toggle');
    if(toggle==null) toggle=0;
	
    var form_ricerca_x=$('form_ricerca_rapida').getSize().x ;
	
    if(toggle==0){ // comparsa
	
	var validatore_form_ricerca_rapida = new fValidator("form_ricerca_rapida",{
	    colorButton:false,
	    viewMsgButton:false,
	    onNotValid: spostaMsg
	});
	if($('form_ricerca_rapida')) {
	    var TL_NomeGruppo = new TextboxList('idGruppo', {
		unique: true,
		minLength: 1,
		max: 1,
		maxResults: 5,
		onlyFromValues: true,
		placeholder: getGlobalLabel('TextboxList_placeholder'),
		plugins: {
		    autocomplete: {}
	    }
	    });
			
	TL_NomeGruppo.container.addClass('textboxlist-loading');
	new Request.JSON({
	    url: 'ricerca.autocomplete.php',
	    onSuccess: function(r){
		TL_NomeGruppo.plugins['autocomplete'].setValues(r),
		TL_NomeGruppo.container.removeClass('textboxlist-loading')
	    }
	}).send();
}	
			
$('ricerca_rapida').store('toggle','1');
var myEffectComparsa = new Fx.Morph('ricerca_rapida', {
    duration: 'long',
    transition: Fx.Transitions.Sine.easeOut
    });
myEffectComparsa.start({
    'left': ['-'+form_ricerca_x+'px', '2px']
});
		
}else{ // scomparsa
    $('ricerca_rapida').store('toggle','0');
    var myEffectScomparsa = new Fx.Morph('ricerca_rapida', {
	duration: 'long',
	transition: Fx.Transitions.Sine.easeOut
	});
    myEffectScomparsa.start({
	'left': ['2px', '-'+form_ricerca_x+'px']
    });
}	
}

var Equalizer = new Class({
    initialize: function(elements) {
	this.elements = $$(elements);
    },
    equalize: function(hw) {
	if(!hw) {
	    hw = 'height';
	}
	var max = 0,
	prop = (typeof document.body.style.maxHeight != 'undefined' ? 'min-' : '') + hw; //ie6 ftl
	offset = 'offset' + hw.capitalize();
	this.elements.each(function(element,i) {
	    var calc = element[offset];
	    if(calc > max) {
		max = calc;
	    }
	},this);
	this.elements.each(function(element,i) {
	    element.setStyle(prop,max - (element[offset] - element.getStyle(hw).toInt()));
	});
	return max;
    }
});

function submitFormAttivazione(){	
    new Request.HTML({
	method: 'post',
	url: "inc.perte.php",
	update: $('form_attivazioneCard'),
	useSpinner: true,
	spinnerOptions: {
	    message: getGlobalLabel('loading')
	},
	evalScripts: true,
	evalResponse: true
    }).post($('attivazioneCard'));
    return false;
}

function spostaImmagine(){
    var dimensioniImmagine=$('ImmaginePrincipale').getSize();

    

    if(dimensioniImmagine.y>0){
//	if(dimensioniImmagine.y < 400){
//	    $('ImmaginePrincipale').setPosition({
//		x: dimensioniImmagine.x ,
//		y: 200
//	    });
//	}
	if(dimensioniImmagine.x < 253){
	    $('ImmaginePrincipale').setPosition({
		x: 253-dimensioniImmagine.x ,
		y: $('ImmaginePrincipale').getStyle('top').toInt()
	    });
	}
	if(dimensioniImmagine.y > 600){
	    $('prodotto_img_container').setStyle('height',dimensioniImmagine.y);
	    $('blocco_img').setStyle('height',dimensioniImmagine.y);
	}
    }
}

function generaFormPerte(){
    if(MooTools.version=='1.3'){
	var currentLang=Locale.getCurrent().name.split('-')[0];
    }else{
	var currentLang=MooTools.lang.getCurrentLanguage().split('-')[0];
    }

    var labelInvia=getGlobalLabel('invia');

    $('form_attivazioneCard').set('html','<form id="attivazioneCard" action="" method="post"><input type="hidden" id="lang" name="lang" value="'+currentLang+'"></input><div class="field text" id="fieldContainer_TestoRecapito"><div class="label"><label for="TestoRecapito">@</label></div><div class="input"><input type="text" id="TestoRecapito" name="TestoRecapito" value="" class="fValidate:email JSType_required"></input></div><div class="clear"></div></div> <div class="field text" id="fieldContainer_NumeroCard"><div class="label"><label for="NumeroCard">Viabizzuno perte n&deg;</label></div><div class="input"><input type="text" id="NumeroCard" name="NumeroCard" value="" class="fValidate:integer JSType_required"></input></div><div class="clear"></div></div><div class="label"><label>&nbsp;</label></div><div class="ds"><div class="lsbb"><input type="submit" name="btnG" class="lsb" id="perte_submitform" value="'+labelInvia+'"></div></div><div class="clear"></div></form>');

    var validatore_form_attivazioneCard = new fValidator("attivazioneCard",{
	onBeforeSubmit: 'submitFormAttivazione()',
	colorButton:false,
	viewMsgButton:false
    });
}

function spostaMsg(){
    if($('idGruppo__required_msg')) $('idGruppo__required_msg').getParent('div').grab($('idGruppo__required_msg'));
}

function candidatura_notValid(){
    if($('inputField_candidatura_SpostItalia__required_msg')) $('fieldContainer_inputField_candidatura_SpostItalia').grab($('inputField_candidatura_SpostItalia__required_msg'));
    if($('inputField_candidatura_SpostEstero__required_msg')) $('fieldContainer_inputField_candidatura_SpostEstero').grab($('inputField_candidatura_SpostEstero__required_msg'));
}

function submitContatto(){	
    new Request.HTML({
	method: 'post',
	url: "contatti.ricerca.php",
	update: $('risultatiRicerca'),
	useSpinner: true,
	spinnerOptions: {
	    message: getGlobalLabel('loading')
	},
	evalScripts: true,
	evalResponse: true
    }).post($('form_ricerca_contatto'));
    return false;
}

function accordionLibro(){
    var ac = new Fx.Accordion($$('p.toggler'),$$('p.accordion'),{
	alwaysHide: true,
	start : 'all-closed',
	height: true,
	duration: 500
    });
}

function imgProgettista(){
    var elencoImg = $$('#progettista_img_container .progettista_img');
    var altezzaImg=0;
    if(Browser.Engine.webkit){
	altezzaImg = elencoImg[0].getStyle('height').toInt();
	if(altezzaImg==0) altezzaImg=600;
    }else{
	while(altezzaImg==0) altezzaImg = elencoImg[0].getStyle('height').toInt();
    }
	
    $('progettista_img_container').setStyle('height',altezzaImg);
    $('blocco_img').setStyle('height',altezzaImg+100);
    var slideProgettista = new SimpleSlideshow('progettista_img_container','#progettista_img_container .progettista_img', {
	showTOC: true
    });
    slideProgettista.start();
}


document.addEvent('domready', function() {

    var mySpinner = new Spinner(document.body,{
	'style': {
	    'background-color' : 'white',
	    'opacity' : 0.9,
	    'z-index' : 100
	}
    });

    var arrayAnchor = document.body.getElements('#menuContainer a');
		
    arrayAnchor.each(function(el){
	if(el.get('href')!='#')
	    el.addEvent("click", function() {
		mySpinner.show();
	    });
    })


    var form_ricerca_x=$('form_ricerca_rapida').getSize().x;
    $('ricerca_rapida').setStyle('left','-'+form_ricerca_x+'px');
	
    if($('form_ricerca_contatto')) {
	var validatore_form_ricerca_contatto = new fValidator("form_ricerca_contatto",{
	    colorButton:false,
	    viewMsgButton:false,
	    styleNeutral: {
		'font-family': 'FuturaMedium',
		'color': '#000000',
		'background-color': '#FFFFFF',
		'border-width': '1px',
		'border-style': 'solid',
		'border-color': '#BBBBBB'
	    },
	    styleValid: {
		'font-family': 'FuturaMedium',
		'color': '#000000',
		'background-color': '#FFFFFF',
		'border-width': '1px',
		'border-style': 'solid',
		'border-color': '#BBBBBB'
	    },
	    styleFocus: {
		'font-family': 'FuturaMedium',
		'color': '#000000',
		'background-color': '#FFFFFF',
		'border-width': '1px',
		'border-style': 'solid',
		'border-color': '#000000'
	    },
	    styleInvalid: {
		'font-family': 'FuturaMedium',
		'color': '#000000',
		'background-color': '#FFFFFF',
		'border-width': '1px',
		'border-style': 'solid',
		'border-color': '#CC0000'
	    },
	    onBeforeSubmit: 'submitContatto()'
	});
	if(MooTools.version=='1.3'){
	    var currentLang=Locale.getCurrent().name.split('-')[0];
	}else{
	    var currentLang=MooTools.lang.getCurrentLanguage().split('-')[0];
	}
	$('idNazione').addEvent("change", function() { // idMCNazione
	    $('risultatiRicerca').empty();
	    new Request.HTML({
		method: 'post',
		url: 'contatti.divZona.php?idNazione='+this.value+'&selLang='+currentLang,
		update: $('fieldContainer_inputField_Provincia'),
		evalScripts: true,
		evalResponse: true
	    }).send();
	});
		
    }


    if (Browser.Platform.ipod)
	var myMenu = new UvumiDropdown("menu",{
	    mode:'vertical',
	    clickToOpen: true
	});
    else{
	var myMenu = new UvumiDropdown("menu",{
	    mode:'vertical',
	    openDelay:50,
	    closeDelay:10,
	    duration:20
	});
    }
	
    selettore('#tabella .prodotto_td','selected');
    selettore('#menu .menu_li_quartoLiv','over_quartoLiv');
    selettore('.eventiVBO_evento','eventiVBO_evento_over');
    var equalizer = new Equalizer('.equalize').equalize('height');
	
    if($('news_container')){
	if( $$('.new').length > 0 ){
	    var slideNew = new SimpleSlideshow('news_container','#news_container .new', {
		showControls: true,
		showDuration: 9000
	    });
	    slideNew.start();
	}
    }
    if($('prodotto_img_container')){
	if( $$('.prodotto_img').length > 0 ){
	    var slideProdotto = new SimpleSlideshow('prodotto_img_container','#prodotto_img_container .prodotto_img', {
		showTOC: true,
		autoRun:false
	    });
	    slideProdotto.stop();
	}
    }
    if($('evento_img_container')){
	var slideEvento = new SimpleSlideshow('evento_img_container','#evento_img_container .prodotto_img', {
	    showTOC: true
	});
	slideEvento.start();
    }
    if($('progettista_img_container')){
	if(Browser.Engine.webkit)
	    setTimeout('imgProgettista()',250);
	else
	    setTimeout('imgProgettista()',150);
    }
		
			
    if (!Browser.Platform.ipod){
	if ($('video_viabizzuno_flash')){
	    $('video_viabizzuno_flash').setStyle('display','block');
	    $('video_viabizzuno_tagVideo').setStyle('display','none');
	}
		
	if($('pagina_Viabizzuno')){
	    var srcFlash=$('videoSrc').get('data-nomeFlash');
	    if(Browser.firefox){
		// Firefox
		$("prodotto_img_container").set("html", '<object id="MediaboxSWF" height="325" width="433" type="application/x-shockwave-flash" data="http://redigo.viabizzuno.com/libraries/mediaBox/NonverBlaster.swf?mediaURL=http://www.viabizzuno.com/marionannivideo/'+srcFlash+'.low.flv&amp;allowSmoothing=true&amp;autoPlay=true&amp;buffer=6&amp;showTimecode=false&amp;loop=true&amp;controlColor=0xFFFFFF&amp;controlBackColor=0x000000&amp;defaultVolume=100&amp;scaleIfFullScreen=true&amp;showScalingButton=true&amp;crop=false">					<param name="quality" value="high">					<param name="allowScriptAccess" value="always">					<param name="wMode" value="transparent">	<param name="swLiveConnect" value="true">					<param name="wmode" value="opaque">					<param name="bgcolor" value="#000000">					<param name="allowscriptaccess" value="true">					<param name="allowfullscreen" value="true">				</object>			');
	    }
	    if(Browser.ie && !Browser.ie9){
		// Internet Explorer
		$("prodotto_img_container").set("html", '<OBJECT id="MediaboxSWF" height="325" width="433" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">			<PARAM NAME="_cx" VALUE="16933">			<PARAM NAME="_cy" VALUE="9525">			<PARAM NAME="FlashVars" VALUE="">			<PARAM NAME="Movie" VALUE="http://redigo.viabizzuno.com/libraries/mediaBox/NonverBlaster.swf?mediaURL=http://www.viabizzuno.com/marionannivideo/'+srcFlash+'.low.flv&amp;allowSmoothing=true&amp;autoPlay=true&amp;buffer=6&amp;showTimecode=false&amp;loop=true&amp;controlColor=0xFFFFFF&amp;controlBackColor=0x000000&amp;defaultVolume=100&amp;scaleIfFullScreen=true&amp;showScalingButton=true&amp;crop=false">			<PARAM NAME="Src" VALUE="http://redigo.viabizzuno.com/libraries/mediaBox/NonverBlaster.swf?mediaURL=http://www.viabizzuno.com/marionannivideo/'+srcFlash+'.low.flv&amp;allowSmoothing=true&amp;autoPlay=true&amp;buffer=6&amp;showTimecode=false&amp;loop=true&amp;controlColor=0xFFFFFF&amp;controlBackColor=0x000000&amp;defaultVolume=100&amp;scaleIfFullScreen=true&amp;showScalingButton=true&amp;crop=false">			<PARAM NAME="WMode" VALUE="Transparent">			<PARAM NAME="Play" VALUE="0">			<PARAM NAME="Loop" VALUE="-1">			<PARAM NAME="Quality" VALUE="High">			<PARAM NAME="SAlign" VALUE="LT">			<PARAM NAME="Menu" VALUE="-1">			<PARAM NAME="Base" VALUE="">			<PARAM NAME="AllowScriptAccess" VALUE="always">			<PARAM NAME="Scale" VALUE="NoScale">			<PARAM NAME="DeviceFont" VALUE="0">			<PARAM NAME="EmbedMovie" VALUE="0">			<PARAM NAME="BGColor" VALUE="000000">			<PARAM NAME="SWRemote" VALUE="">			<PARAM NAME="MovieData" VALUE="">			<PARAM NAME="SeamlessTabbing" VALUE="1">			<PARAM NAME="Profile" VALUE="0">			<PARAM NAME="ProfileAddress" VALUE="">			<PARAM NAME="ProfilePort" VALUE="0">			<PARAM NAME="AllowNetworking" VALUE="all">			<PARAM NAME="AllowFullScreen" VALUE="true">			</OBJECT>');
	    }
	}
    }
    if ($("inputField_candidatura_Domicilio")){
	candidatura_Domicilio_click($("inputField_candidatura_Domicilio"));
	candidatura_Diploma_change('0');
	candidatura_Laurea_change('0');
	candidatura_Specializzazioni_click($("inputField_candidatura_Specializzazioni"));
		
	var arraySelect = ["Diploma","Laurea","Italiano","Inglese","Francese","Spagnolo","Tedesco","Russo","Solidworks","Autocad","AdobeCS","Gamma","MSOffice"].each(function(select){
	    $('inputField_candidatura_'+select).getElements('option').each(function(el){
		if(el.get('html')==" " || el.get('html')=="" || el.get('html')=="&nbsp;" ) el.destroy();
	    })
	});
		
    }
	
    if($('linkPerte')){
	$('linkPerte').addEvent('click', function(){
	    var divForm_attivazioneCard = new Element('div', {
		'id': 'form_attivazioneCard'
	    }).inject($('linkPerte'),'after');
	    $('prodotto_dx').grab(divForm_attivazioneCard);
		
	    $('linkPerte').dispose();
	    generaFormPerte();
	});
    }
		
    if($('prodotti_libro')){
	accordionLibro();
    }
	
    if($('eventiVBO')){
	paragrafoEventi();
    }
	
    if($('ImmaginePrincipale')){
	if(Browser.Engine.webkit)
	    setTimeout('spostaImmagine()',150);
	else
	    spostaImmagine();
    }
	
    mySpinner.hide();
    myMasks.hide();
});
