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('#container2').offset();
 jQuery('#scrolltop').css('left',(_c.left+1052)+'px').fadeIn('slow');
 jQuery(window).resize(function(){
  var _c=jQuery('#container2').offset();
  jQuery('#scrolltop').css('left',(_c.left+1052)+'px');
 });

 if(jQuery(window).scrollTop()!=0){
  jQuery('#scrolltop').css('opacity',1).stop().animate({top:jQuery(window).scrollTop()+190},750,'swing');}

 jQuery(window).scroll(function(){
  jQuery('#scrolltop').css('opacity',1).stop().animate({top:jQuery(window).scrollTop()+190},750,'swing');});

 jQuery('div.homeproject a.img,div.gridproject a.img').hover(function(e){
  jQuery('#prjhover').css({left:e.pageX+15,top:e.pageY}).show();
 },function(e){
  jQuery('#prjhover').css({left:e.pageX+15,top:e.pageY}).hide();
 }).mousemove(function(e){
  jQuery('#prjhover').stop().css('opacity',1).css({left:e.pageX+15,top:e.pageY});});

 var ptfl=window.location.href.match(/\/portfolio\/list\/([^\/]+)\/?/);
 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-25},{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;
  }
 }
}



