//DISJOINTED ROLLOVERS USING BUTTON NAVIGATION AND IMAGES FADING IN AND OUT

$(document).ready(function(){
	//disjointed rollover function starting point
	$("div#button li").hover(function(){
		//make a variable and assign the hovered id to it
		var elid = $(this).attr('id');
		//hide the image currently there
		$("div#images div").hide();
		//fade in the image with the same id as the selected buttom
		$("div#images div#foto_" + elid + "").fadeIn("slow");
	
		});

	$(".listTriggerTarget").hide();
	$(".listTrigger").click(function () {
		var id = $(this).attr('id');
		$(".listTriggerTarget").slideUp();
		tmpArr = id.split('_');
		$("#oltre_"+tmpArr[1]).slideDown("slow")
	})
	
	$("form").submit(function(){
		if ($('#testo').length==1){
			$('#testo').val($('#testo').val().replace(/;/g, ",").replace(/=/g, " uguale a ").replace(/-/g, "_"));
		}
		if ($('#messaggio').length==1){
			$('#messaggio').val($('#messaggio').val().replace(/;/g, ",").replace(/=/g, " uguale a ").replace(/-/g, "_"));
		}
		if ($('#text_standard').length==1){
			$('#text_standard').val($('#text_standard').val().replace(/;/g, ",").replace(/=/g, " uguale a ").replace(/-/g, "_"));
		}
    });
 });
