$(document).ready(function() {
   $('.b1, .show-pop1').click(function(){
      $('.popup-box1').show();
   });
   $('.hide-pop1').click(function(){
      $('.popup-box1').hide();
   });
	
	$('.more-link a').click(function(){
      $a = $(this);
		var text = "Еще предложения";
		if( $(this).parent().next().is(":hidden") ) text = "Скрыть предложения";
		$(this).text(text);
		$(this).parent().next().slideToggle();
   });
	
});

$(document).ready(function() {
   $('.b2, .show-pop2').click(function(){
      $('.popup-box2').show();
   });
   $('.hide-pop2').click(function(){
      $('.popup-box2').hide();
   });
});

$(document).ready(function() {
   $('.b3, .show-pop3').click(function(){
      $('.popup-box3').show();
   });
   $('.hide-pop3').click(function(){
      $('.popup-box3').hide();
   });
});

$(document).ready(function(){
   $(".pod-m").each(function() {
      $(this).hover(
         function() {
            $(this).addClass("active");
         },
         function() { 
            $(this).removeClass("active");
         }
      );
   });
});

$(document).ready(function(){
   $(".ind").each(function() {
      $(".s1").hover(
         function() {
            $(this).addClass("mes");
         },
         function() { 
            $(this).removeClass("mes");
         }
      );
   });
});

$(document).ready(function(){
   $(".ind").each(function() {
      $(".s2").hover(
         function() {
            $(this).addClass("mes");
         },
         function() { 
            $(this).removeClass("mes");
         }
      );
   });
});

$(document).ready(function() {
   if( $("div.red").parents(".popup").parent().length ) {
      $("div.red").parents(".popup").parent().show();
   }
});

function ClientBrowse() { this.w=0; this.h=0;
if (self.screen) { this.w=screen.width; this.h=screen.height; }
else if (self.java) { var jkit=java.awt.Toolkit.getDefaultToolkit(); var scrsize=jkit.getScreenSize(); this.w=scrsize.width; this.h=scrsize.height; } return this; }
function OpenWin(url,nwin,w,h,s) { p=new ClientBrowse();
if (w) { leftPos=(p.w-w)/2; } else { w=p.w-100; leftPos=(p.w-w)/2; }
if (h) { topPos=(p.h-h)/2; } else { h=p.h-100; topPos=10; }
(s==1)?null:s=0; (nwin)?null:nwin="win"; var property="left="+leftPos+",top="+topPos+",width="+w+",height="+h+",scrollbars="+s;
pop = window.open (url,nwin,property); 
return pop; }
