// Rotation footer
var iProjectFooter;
var iFooterControl=0;

function rotationFooter() {
	if(iFooterControl>=iProjectFooter-2)
		iFooterControl = 0;
	else
		iFooterControl = iFooterControl+2;
	$("#already-trusted-logos a").hide();
	$("#already-trusted-logos a:eq("+iFooterControl+")").fadeIn("slow");
	$("#already-trusted-logos a:eq("+(iFooterControl+1)+")").fadeIn("slow");
}
$(document).ready(function(){
var iFocus;
var iWidth;
iFocus = 0;

	// Index rotation
	var projectFooterInterval;
	iProjectFooter = $("#already-trusted-logos > a").length;
	
	$("#already-trusted-logos img, #client-list img").fadeTo(0, 0.35); 
	$("#already-trusted-logos img, #client-list img").hover( 
		function () {
			$(this).fadeTo("fast", 1);
		},  
		function () {
			$(this).fadeTo(0, 0.35);
		}
	);
	
	projectIndexInterval = setInterval(rotationFooter,5000);
	
 // Submits & Images	
 $("input[type*='image'], input[type*='submit']").hover( 
      function () { 
	   iWidth = $(this).width();
       $(this).css({'background-position':'-'+iWidth+'px 0'});
      },  
      function () { 
	   $(this).css({'background-position':'0 0'})
      } 
    ); 
	
 // Inputs & Textareas (hover)	
 $("input, textarea, ").hover( 
      function () { 
	   iWidth = $(this).parent().width();
	   if (iFocus == 0) {
       $(this).parent().css({'background-position':'-'+iWidth+'px 0'});
	   }
      },  
      function () { 
	   if (iFocus == 0) {
       $(this).parent().css({'background-position':'0 0'});
	   }
      } 
    );

 // Inputs & Textareas (focus/blur)		
 $("input, textarea").focus(function () {
   iWidth = $(this).parent().width();
   $(this).parent().css({'background-position':'-'+iWidth+'px 0'});
   iFocus=1;
  });
 $("input, textarea").blur(function () {
   $(this).parent().css({'background-position':'0 0','color':'#999999'});
   iFocus=0;
  }); 
  
})	