﻿
var vai = true;

//Detect FF1+
if(navigator.userAgent.indexOf("Firefox")!=-1)
{
	var versionindex=navigator.userAgent.indexOf("Firefox")+8
	
	if (parseInt(navigator.userAgent.charAt(versionindex))>=1)
		//alert("You are using Firefox 1.x or above")
		vai = false;
}

//Detect IE6+
version=0
if (navigator.appVersion.indexOf("MSIE")!=-1)
{
	temp=navigator.appVersion.split("MSIE")
	version=parseFloat(temp[1])
}

if (version>=6) //NON IE browser will return 0
	//alert("You're using IE6+")
	vai = false;

if (vai)
	setTimeout ('location.href="indexOff.asp"',0);

function showContacts() {
var x = 0;
expandContacts();

    function expandContacts() {
        if (x < 220) {
            x = Math.min(x + 50, 220);
            elContactsElement.style.width = x + "px";
            setTimeout(expandContacts,50);
        }
    }
}

function hideContacts() {
var x = 220;
shrinkContacts();

    function shrinkContacts() {
        if (x > 0) {
            x = Math.max(x - 50, 0);
            elContactsElement.style.width = x + "px";
            setTimeout(shrinkContacts,50);
        }
    }
}

function toggleContacts() {
var iX = elContactsElement.style.width.replace("px","");

    if (iX <= 0) {
        showContacts();
    } else {
    hideContacts();
    }
}
function BlogIt()
{
	if (navigator.userAgent.indexOf("MSIE")>0)
	{
		var sel=document.selection.createRange();
		sel.expand("word");
		window.location="http://spaces.live.com/BlogIt.aspx?Title=la necessità di un assicurazione per le casalinghe&SourceURL=" + escape(window.location.href) + "&description=<br>Clicca <a href='http://inail.it.msn.com'>qui</a> per confrontarti con i consulenti Inail o con altre casalinghe.";
	}	
}



$(document).ready(function () {
	$('.buttons .button.submit').hover(
		function() {
			$(this).css('background-position', '0px -23px');
		},
		function() {
			$(this).css('background-position', '0px 0px');
		}
	);
	$('.buttons .button.reset').hover(
		function() {
			$(this).css('background-position', '-92px -23px');
		},
		function() {
			$(this).css('background-position', '-92px 0px');
		}
	);
	$('#content :input[type=text]').focus(
		function() {
			$(this).css('border', 'solid 1px #27B0FF').parent().css('background-image', 'url(img/field-hover-bg.png)');
		}
	);
	$('#content :input[type=text]').blur(
		function() {
			$(this).css('border', 'solid 1px #ccc').parent().css('background-image', 'url(img/field-bg.png)');
		}
	);
});
function goHome() {
	if(arguments.length > 0)
		location.href = "http://scirocco.it.msn.com";
	else
		setTimeout(function () {goHome("for real") }, 3000);
};