function prenotazione() {
    window.addEvent('domready', function(){
    var output = $('output');
    var form = document.getElementById("Prenotazione");
    new FormCheck('Prenotazione', {
        display : {
			closeTipsButton : 0,
			flashTips : 1,
            scrollToFirst : true
        },
        submitByAjax : true,
        onAjaxRequest: function() {
            $('button').set('disabled',true);
            for (var i=0; i<form.elements.length; i++) form.elements[i].readOnly=true;
            output.set('html', '<img src="images/load.gif" style="" alt="Loading..." title="Loading..." />');
        },
        onAjaxSuccess: function(response) {
            output.set('html', '');
            $('button').set('disabled',false);
            for (var i=0; i<form.elements.length; i++) form.elements[i].readOnly=false;
            if (response == "<!-- ERRORE_CODICE -->") roar_msg("<img src=\"images/error.png\" hspace=\"5\" alt=\"Errore\" title=\"Errore\" />Il codice antispam non corrisponde, riprova!", 0);
            else if (response == "<!-- ERRORE -->") roar_msg("<img src=\"images/error.png\" hspace=\"5\" alt=\"Errore\" title=\"Errore\" />Qualcosa &egrave; andato storto, riprova pi&ugrave; tardi!", 0);
            else if (response == "<!-- SUCCESSO -->") {
                roar_msg("<img src=\"images/ok.png\" hspace=\"5\" alt=\"Successo\" title=\"Successo\" />La tua prenotazione &egrave; stata inoltrata con successo, grazie!", 0);
                $('button').set('disabled',true);
                for (var i=0; i<form.elements.length; i++) form.elements[i].disabled=true;
            }
        }});
    });
}

function cloacking(who, domain, style) {
    email = who + '@' + domain;
    output = '<a href="mailto:'+email+'"><span style="'+style+'">'+email+'</span></a>';
    document.write(output);
}

function uppercase(text){
	var phrase = text.toUpperCase();
	return phrase;
}

function lowercase(text){
	var phrase = text.toLowerCase();
	return phrase;
}

function roar_msg(text, i) {
    roars[i].alert(text);
    return false;
}

function images_preload() {
    var immagini=new Array()
    for (cont=0;cont<images_preload.arguments.length;cont++) {
        immagini[cont]=new Image()
        immagini[cont].src=images_preload.arguments[cont]
    }
}
images_preload ("images/load.gif");

var omitformtags=["input", "textarea", "select"];
function disableSelect(e) {
    for (i=0; i<omitformtags.length; i++)
        if (omitformtags[i]==(e.target.tagName.toLowerCase()))
            return;
    return false
}
function reEnable() { return true; }

function noSelect() {
    if (typeof document.onselectstart!="undefined") {
        document.onselectstart=new Function ("return false")
        if (document.getElementsByTagName) {
            tags=document.getElementsByTagName('*')
            for (j = 0; j < tags.length; j++) {
                for (i = 0; i < omitformtags.length; i++)
                    if (tags[j].tagName.toLowerCase()==omitformtags[i]) {
                        tags[j].onselectstart=function() {
                            document.onselectstart=new Function ('return true')
                        }
                        if (tags[j].onmouseup!==null) {
                            var mUp=tags[j].onmouseup.toString()
                            mUp='document.onselectstart=new Function (\'return false\');\n'+mUp.substr(mUp.indexOf('{')+2,mUp.lastIndexOf('}')-mUp.indexOf('{')-3);
                            tags[j].onmouseup=new Function(mUp);
                        } else {
                            tags[j].onmouseup=function() {
                            document.onselectstart=new Function ('return false')
                        }
                    }
                }
            }
        }
    } else {
        document.onmousedown=disableSelect
        document.onmouseup=reEnable
    }
}
window.onload=noSelect;

window.addEvent('domready', function() {
    $(document.body).setStyle('overflow-x','hidden');
    roars = [new Roar(),new Roar({position: 'upperRight'}),new Roar({position: 'lowerLeft'}),new Roar({position: 'lowerRight'})];
	initMultiBox = new multiBox({
		mbClass: '.mb',
   		contentColor: '#000',
		container: $(document.body),
		descClassName: 'multiBoxDesc',
		path: './files/',
		useOverlay: true,
		addDownload: false,
		pathToDownloadScript: '',
		addRollover: true,
		addOverlayIcon: false,
		addChain: false,
		recalcTop: false,
		addTips: false
	});
});
