$(document).ready(function() {
	jQuery("body").append("<div style='position:absolute; text-align:center; padding-top:20px; width:300px; height:50px;' id='comingSoon' class='testobianco'>Presto disponibile</div>");  
	//$("#topnav li").prepend("<span></span>"); //Throws an empty span tag right before the a tag
	
	//$("#topnav li").each(function() { //For each list item...
	//	var linkText = $(this).find("a").html(); //Find the text inside of the a tag
	//	$(this).find("span").show().html(linkText); //Add the text in the span tag
	//}); 
	
	$("#topnav li").hover(function() {	//On hover...
		//$(this).find("span#selectedhome").stop();
		$(this).find("span").stop().animate({ 
			marginTop: "-31" //Find the span tag and move it up 40 pixels
		}, 250);
	} , function() { //On hover out...
		$(this).find("span").stop().animate({
			marginTop: "0" //Move the span back to its original state (0px)
		}, 250);
	});	
});

function comingSoon(){   
    //jQuery("#comingSoon").load("addCarrello.aspx?id=" + mag + "&qta=" + qta + "&nocache=" + new Date().getTime(),'',function(){
    jQuery("#comingSoon").css("top", ( jQuery(window).height() - jQuery("#comingSoon").height() ) / 2+jQuery(window).scrollTop() + "px");
    jQuery("#comingSoon").css("left", ( jQuery(window).width() - jQuery("#comingSoon").width() ) / 2+jQuery(window).scrollLeft() + "px");    
    jQuery("#comingSoon").css("margin", 0)
    jQuery("#comingSoon").fadeIn(500, function () {
	    window.setTimeout('jQuery("#comingSoon").animate({"width": "toggle", "height": "toggle", "opacity": "toggle", "left": "+=300px", "top": "-=300px"}, 300,"linear",function(){jQuery("#comingSoon").fadeOut(300);} );',1000);             
    });    
}
