var Selo = function () {}
Selo.init = function () {
    Selo.fn.relativeBlockDraw();
    Selo.fn.clickBinds();
    Selo.fn.placeholder();
}
Selo.fn = {
    relativeBlockDraw: function () {
        a = $('.mainTable').offset();
        b = $('.mainTable').width();
        $('.servicesBlock').css('left', a.left + 57 + 'px');
        $('.allBlock').css('left', a.left + b - 57 - 295 + 'px');
    },
    clickBinds: function () {
        $('.selaKomi').click(function () {
            c = $(this).hasClass('sClicked');
            if (!c) {
                $('.allBlock').slideDown('fast');
                $(this).addClass('sClicked');
            } else {
                $('.allBlock').slideUp('fast');
                $(this).removeClass('sClicked');
            }
            return false;
        });
        $('.toAll').click(function () {
            d = $(this).hasClass('clicked');
            if (!d) {
                $('.servicesBlock').slideDown('fast');
                $(this).addClass('clicked');
            } else {
                $('.servicesBlock').slideUp('fast');
                $(this).removeClass('clicked');
            }
            return false;
        });
    },
    placeholder: function () {
        e = $('.sStr').val();
        $('.sStr').focus(function () {
            if ($(this).val() == e) {
                $(this).val('').css('color', '#000');
            }
        }).blur(function () {
            if ($(this).val() == '') {
                $(this).val(e).css('color', '#999');
            }
        });
    }
}

function partnersListRolling() {
  var a;
  a = parseInt($('.mPhotoGal div.bannersTapeWrapper').css("margin-left").match(/\d{1,}/));
  $('.mPhotoGal  .next a').click(function(){
    var m, l;
    
    l = $('.mPhotoGal  div.bannersTape div').length;
    if (l < 8) {
      return false;
    }
    m = (l-7)*109;
    a-=109;
    if (Math.abs(a)+1 > m) {
      a = 0;
    }
    $('.mPhotoGal  div.bannersTapeWrapper').animate({'margin-left': a});
    return false;
  });
  $('.mPhotoGal  .prev a').click(function(){
    var m, l;
 
    l = $('.mPhotoGal  div.bannersTape div').length;
    if (l < 8) {
      return false;
    }
    m = (l-7)*109;
    if ((Math.abs(a)-1) < 0) {
      a = -m+109;
    } else {
      a+=109;
    } 
    $('.mPhotoGal  div.bannersTapeWrapper').animate({'margin-left': a});
    return false;
  })
}

/*function debug(text) {
  ((window.console && console.log) ||
   (window.opera && opera.postError) ||
   window.alert).call(this, text);
}
jQuery.noConflict();

(function($){
  $(function(){

    var setGrid = function () {
      return $("#grid-wrapper").vgrid({
        easeing: "easeOutQuint",
        useLoadImageEvent: true,
        time: 800,
        delay: 60,
        selRefGrid: "#grid-wrapper div.x1",
        selFitWidth: ["#container", "#footer"],
        gridDefWidth: 290 + 15 + 15 + 5,
        fadeIn: {
          time: 500,
          delay: 50
        }

      });
    };
    
    setTimeout(setGrid, 300);
    
    
    $(window).load(function(e){
      setTimeout(function(){ 
        // prevent flicker in grid area - see also style.css
        $("#grid-wrapper").css("paddingTop", "0px");
      }, 1000);
    });
    
  }); // end of document ready
})(jQuery); // end of jQuery name space   
*/

