//mosne fecit
//www.mosne.it

$(document).ready(function(){
		
		var $last="";
/* fit screen */

	//if (top.frames.length!=0)
    //top.location=self.document.location;
    if (screen.availWidth<777){
		var scrh = screen.availWidth
	}else{
		var scrh = 777;
	}
    
	//var wint = (screen.height - scrh) / 2;
	//self.moveTo(0,wint)
	self.moveTo(0,0)
	
	self.resizeTo(screen.availWidth,scrh);
    //self.resizeTo(960,500);
   
/* global vars */

		
			
			
			
			//scroll initially if there's a hash (#something) in the url 
			
			
			
			var $last = $([]);//save the last link
			
						
			$.localScroll({
				//could be a selector or a jQuery object too.
				axis:'y',//the default is 'y'
				queue:true,
				hash:true,
				easing:"easeOutQuint",
				onBefore: function (){ 
				
						$("#bmenu").animate({left:"0px"},500);
						$("#menu").animate({left:"-223px"},250);
						
												
				},
				onAfter: function (){
					
					if (window.XMLHttpRequest) {}else{
   						
						
						var iebody=(document.compatMode && document.compatMode != "BackCompat")? document.documentElement : document.body
						var dsoctop=document.all? iebody.scrollTop : pageYOffset
						
						var ttop = (dsoctop +200);
						
						
						$("#bmenu").css({top:ttop,position:"absolute"});
						$("#menu").css({top:ttop,position:"absolute"});
				
				}
					
					
					},
					
				
				duration:2500
			});
			
			
			$("#bmenu").hover(function(){
				
				$(this).animate({backgroundColor:"#000"},250);
				
				},function () {
	  			
				$(this).animate({backgroundColor:"#E2007A"},250);
				
				});
			
			$("#menu a.go").hover(function(){
								
				$(this).animate({backgroundColor:"#000"},200);
				
				},function () {
	  			
				$(this).animate({backgroundColor:"#3399FF"},200);
				
				});
			
			$("#close").hover(function(){
								
				$(this).animate({backgroundColor:"#E2007A"},200);
				
				},function () {
	  			
				$(this).animate({backgroundColor:"#3399FF"},200);
				
				});
			
			$("#lang").hover(function(){
								
				$(this).animate({backgroundColor:"#fff"},200);
				
				},function () {
	  			
				$(this).animate({backgroundColor:"#3399FF"},200);
				
				});
			
			
			
			$("#bmenu").click(function(){
									  
						$(this).animate({left:"-80px"},250);
						$("#menu").animate({left:"0px"},500);
															  
									  });
			$("#close").click(function(){
									  
						$("#bmenu").animate({left:"0px"},500);
						$("#menu").animate({left:"-223px"},250);
									  
									  });
			
		setTimeout(function(){
				$.scrollTo(99999999,0, {onAfter: function(){
											
											if (window.XMLHttpRequest) {}else{
   											
											//alert("this is explorer!");
			
						var iebody=(document.compatMode && document.compatMode != "BackCompat")? document.documentElement : document.body
						var dsoctop=document.all? iebody.scrollTop : pageYOffset
						var ttop = (dsoctop);
			
						$("#mini").hide();
						$("#bmenu").pngFix();
						$("#bmenu").css({top:ttop,position:"absolute"});
						$("#menu").css({top:ttop,position:"absolute"});
						} //if
						
						setTimeout(function(){
				
				$("#bmenu").animate({left:"-35px"},250);
				//$("#menu").animate({left:"0px"},500);
			
			}, 250);
			setTimeout(function(){
				
				//$("#bmenu").animate({left:"-35px"},250);
				$("#menu").animate({left:"0px"},500);
			
			}, 500);
						
						
						}//function
				
				
						
						});
				
				
				$.localScroll.hash({
				 //could be a selector or a jQuery object too.
				axis:'y',//the default is 'y'
				queue:true,
				duration:2500,
				timeout:550,
				easing:"easeOutQuint"
			});
				
				
				}, 500);

  
 }); // end of global scope