/*
var time='3000'; //numero = secondi x 1000
var timeout=null;
startTimeout();

function startTimeout()
{ 
var contenuto=getParameterByName('contenuto');
var modello=getParameterByName('modello');
if(contenuto=='' && modello=='')
var contenuto='home';
if(contenuto=='home')
timeout=window.setTimeout("window.location.assign('index.php?contenuto=info');",time);
return timeout;
}
*/
function getParameterByName( name )
{
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp( regexS );
var results = regex.exec( window.location.href );
if( results == null )
return "";
else
return results[1];
}





$(document).ready(function(){
$("#ifram").width($(window).width()-40);
$("#ifram").height($(window).height()-60);
mainmenu();
var $el, leftPos, newWidth,
$mainNav2 = $("#navp");
$mainNav2.append("<li id='magic-line-two'></li>");
var $magicLineTwo = $("#magic-line-two");
$("#magic-line-two").width($(".current_page_item_two").width())
$("#magic-line-two").height($mainNav2.height())
$("#magic-line-two").css("left", $(".current_page_item_two a").position().left)
$("#magic-line-two").data("origLeft", $(".current_page_item_two a").position().left)
$("#magic-line-two").data("origWidth", $magicLineTwo.width())
$("#magic-line-two").data("origColor", $(".current_page_item_two a").attr("rel"));
$("#navp li").find("a").hover(function() {
        $el = $(this);
        leftPos = $el.position().left;
        newWidth = $el.parent().width();
        $magicLineTwo.stop().animate({
            left: leftPos,
            width: newWidth,
            backgroundColor: $el.attr("rel")
        })
    }, function() {
        $magicLineTwo.stop().animate({
            left: $magicLineTwo.data("origLeft"),
            width: $magicLineTwo.data("origWidth"),
            backgroundColor: $magicLineTwo.data("origColor")
        });    
    });
});

$(window).resize(function () {
$("#ifram").width($(window).width()-40)
$("#ifram").height($(window).height()-60)
});


function mainmenu(){
$(" #nav ul ").css({display: "none"}); // Opera Fix
$(" #nav li").hover(function(){
		$(this).find('ul:first').css({visibility: "visible",display: "none"}).show(400);
		},function(){
		$(this).find('ul:first').css({visibility: "hidden"});
		});
}

function MM_openBrWindow(theURL,winName,features) {
wopen=window.open(theURL,winName,features);
wopen.focus();
}
