  var captcha_reload_count = 0;
	var captcha_image_url = "/captcha.php";
  function new_captcha_image() {
    if (captcha_image_url.indexOf('?') == -1) {
		  document.getElementById('captcha_image').src= captcha_image_url+'?c='+captcha_reload_count;
		} else {
		  document.getElementById('captcha_image').src= captcha_image_url+'&c='+captcha_reload_count;
		}

    document.getElementById('captcha_input').value="";
    document.getElementById('captcha_input').focus();
    captcha_reload_count++;
  }

	function opendetailwindow() { 
    window.open('','detailwindow','toolbar=no,scrollbars=yes,resizable=no,width=680,height=480');
  }
  
  function right(e) {
    if ((document.layers || (document.getElementById && !document.all)) && (e.which == 2 || e.which == 3)) {
      alert("© Copyright by {site_name}");
      return false;
    }
    else if (event.button == 2 || event.button == 3) {
      alert("© Copyright by {site_name}");
      return false;
    }
    return true;
  }


$(function(){
  bind_zoominout();

  $('#usersbox_container').hide();
  $('#usersbox_title a.shown').show();
  $('#usersbox_title a.hidden').hide();
  $('#usersbox_title').click(function(){
    $("#usersbox_container").toggle();
    $("#usersbox_title a").toggle();
  });
  $('#zaz3').animate({ opacity: 1}, 6000);

  (function(){
	  var xx=0;
	  var xxmax=0;
	  var sstep=100;
	  var paleopacity=0.15;
	  $('#catscrolldown').click(function(){
	    xx++;
	    $('#catscrollcontent').animate({scrollTop:'+='+sstep}, 'slow');
	    if(xx>0){$('#catscrollup').css({'opacity':1});}
	    if(xx>=xxmax){$('#catscrolldown').css({'opacity':paleopacity}); x=xxmax;}
	  });
	  $('#catscrollup').click(function(){
	    xx--;
	    $('#catscrollcontent').animate({scrollTop:'-='+sstep}, 'slow');
	    if(xx<=0){$('#catscrollup').css({'opacity':paleopacity}); xx=0;}
	    if(xx<=xxmax){$('#catscrolldown').css({'opacity':1}); }
	  });
	})();	
	
});





function bind_zoominout(){
      var dy = 79;
      var ff = false;
      if (/firefox/i.test(navigator.userAgent)) { ff = true; }
    
      $("#dec").click(function() {
          if(!$(this).hasClass('active'))return;
	        if (ff) {
	            if ($("#box").innerWidth() > 640) {
	                $("#main").width($("#main").width() - 100);
	                $("#content").width($("#content").width() - 100);
	            }
	            $("#box").width($("#box").width() - 100).height($("#box").height() - dy);
	            if ($("#box").innerWidth() <= 440) {
	                $("#dec").removeClass("active");
	            }
	            $("#inc").addClass("active");
	        } else {
	            if ($("#box").innerWidth() > 640) {
	                $("#main").animate({width:"-=100px"});
	                $("#content").animate({width:"-=100px"});
	            }
	            $("#box").animate({width:"-=100px",height:"-="+dy+"px"}).each(function() {
	                if ($("#box").innerWidth() <= 440) {
	                    $("#dec").removeClass("active");
	                }
	                $("#inc").addClass("active");
	            });
	        }
	    });
	    $("#inc").click( function() {
          if(!$(this).hasClass('active'))return;
	        if (ff) {
	            if ($("#box").innerWidth() >= 640) {
	                $("#main").width($("#main").width() + 100);
	                $("#content").width($("#content").width() + 100);
	            }
	            $("#box").width($("#box").width() + 100).height($("#box").height() + dy);
	            if ($("#box").innerWidth() >= 1040) {
	                $("#inc").removeClass("active");
	            }
	            $("#dec").addClass("active");
	        } else {
	            if ($("#box").innerWidth() >= 640) {
	                $("#main").animate({width:"+=100px"});
	                $("#content").animate({width:"+=100px"});
	            }
	            $("#box").animate({width:"+=100px",height:"+="+dy+"px"}).each(function() {
	                if ($("#box").innerWidth() >= 1040) {
	                    $("#inc").removeClass("active");
	                }
	                $("#dec").addClass("active");
	            });
	        }
	    });
}

