$(document).ready(function(){
   
    if (!($.browser.msie && window.external && (typeof window.XMLHttpRequest == "undefined"))) {
       $(".mainMenuImg, .aniImg").mouseover(function(){
          $(this).animate( { 'marginLeft':"12px" }, { queue:true, duration:200 } )
       });

       $(".mainMenuImg, .aniImg").mouseout(function(){
          $(this).animate( { 'marginLeft':"0px" }, { queue:true, duration:200 } )
       });
    } else {
      $(".mainMenu, .footerStampDiv").pngFix();
       
      $("img.mainMenuImg").wrap("<div class='mainMenuDiv'></div>");   
       $(".mainMenuDiv").mouseover(function(){
          $(this).animate( { 'paddingLeft':"12px" }, { queue:true, duration:200 } )
       });
       $(".mainMenuDiv").mouseout(function(){
          $(this).animate( { 'paddingLeft':"0px" }, { queue:true, duration:200 } )
       });
    }
    /*
    if (navigator.appVersion.search(/Chrome/i) != -1) {
       $("#partnersMarquee").wrap("<div style='width:570px;'></div>");
       $("#clientsMarquee").wrap("<div style='width:570px;'></div>");
    }
    */
   
   
    $(".cdPhotos a").fancybox({
    	hideOnContentClick: true,
    	overlayOpacity: 0.3,
    	zoomSpeedIn: 600,
    	zoomSpeedOut:300
    });
    

    
    $(".partnersTable img").mouseover(function(){
      $(this).animate( { 'opacity':1 }, { queue:true, duration:200 } )
    });
    
    $(".partnersTable img").mouseout(function(){
      $(this).animate( { 'opacity':0.5 }, { queue:true, duration:200 } )
    });
    
    $(".partnersTable img").css( "opacity", 0.5 );
   
    

    
   scrollClass = function(idObj, speed, countTd) {
      this.idObj = idObj;
      this.speed = speed;
      this.countTd = countTd || $("#scroll1 table tr td").length;
      this.widthT = 150 * this.countTd;
      this.width1 = parseInt($("#"+idObj).css("width"));
      this.dw = this.widthT - this.width1;
      
      $("#"+idObj+" table").css({"width" : this.widthT+"px"});

      $("#"+idObj).mouseover(function(){
         $("table", this).stop(true);
      });
      
      var scrolling = function(dw, idObj) {
         var dw1 = -dw;
         var dw2 = parseInt($("#"+idObj+" table").css("marginLeft"));
         if (($("#"+idObj+" table").hasClass("p1Right") && dw2 != 0) || (dw + dw2 < 100)) {
            $("#"+idObj+" table").removeClass("p1Left");
            $("#"+idObj+" table").addClass("p1Right");
            dw1 = 0;
         } else {
            $("#"+idObj+" table").removeClass("p1Right");
            $("#"+idObj+" table").addClass("p1Left");
         }
         
         $("#"+idObj+" table").animate({"marginLeft" : dw1+"px"}, speed, function(){scrolling(dw, idObj)});
         
         
      }
      
      this.scrolling = function() {
         scrolling(this.dw, this.idObj);
      }
   }
   
   p1 = new scrollClass("scroll1", 7000, 18);
   p1.scrolling();
   $("#"+p1.idObj).mouseout(function(){
      p1.scrolling();
   });

/*   
   p2 = new scrollClass("clientsMarquee", 10000, 12);
   p2.scrolling();
   $("#"+p2.idObj).mouseout(function(){
      p2.scrolling();
   });
*/    
   
     
   
});

var develop = function() {
   window.open('http://www.bondsoft.ru/portfolio.html', '', 'left=100, top=50, resizable=1, scrollbars=1, menubar=1, toolbal=1,location=1,status=1');
}
