jQuery.noConflict();
jQuery(document).ready(function(){
 jQuery('a').focus(function(){this.blur();});
 
 jQuery('input.text,textarea.text').focus(function(){jQuery(this).addClass('textfocus');}).blur(function(){jQuery(this).removeClass('textfocus');});

 var _c=jQuery('#contenitore').offset();
 jQuery('#scrolltop').css('left',(_c.left+990)+'px').fadeIn('slow');
 jQuery(window).resize(function(){
  var _c=jQuery('#contenitore').offset();
  jQuery('#scrolltop').css('left',(_c.left+990)+'px');
 });

 if(jQuery(window).scrollTop()!=0){
  jQuery('#scrolltop').css('opacity',1).stop().animate({top:jQuery(window).scrollTop()+76},750,'swing');}

 jQuery(window).scroll(function(){
  jQuery('#scrolltop').css('opacity',1).stop().animate({top:jQuery(window).scrollTop()+76},750,'swing');});



 var ptfl=1;
 if(ptfl){
  jQuery('div.listproject p.name').each(function(){
   tnm=jQuery(this).html().toLowerCase().replace(/ /g,'-').replace(/[^-a-z0-9]/g,'');
   if(ptfl[1]==tnm) jQuery('html,body').stop().animate({scrollTop:jQuery(this).parent().offset().top-0},{delay:250,duration:500},'swing');
  });
 }
});


function scroll(obj,offset){
 if(location.pathname.replace(/^\//,'')==obj.pathname.replace(/^\//,'') && location.hostname==obj.hostname){
  var jQuerytarget=jQuery(obj.hash);
  jQuerytarget=jQuerytarget.length&&jQuerytarget||jQuery('[name='+obj.hash.slice(1)+']');
  if(jQuerytarget.length){
   var targetOffset=jQuerytarget.offset().top+offset;
   jQuery('html,body').stop().animate({scrollTop:targetOffset},500,'swing');
   return false;
  }
 }
}

function sleep(milliseconds) {
  var start = new Date().getTime();
  for (var i = 0; i < 1e7; i++) {
    if ((new Date().getTime() - start) > milliseconds){
      break;
    }
  }
}

