﻿with(my_prototype = new Function)
{
	prototype.var1 = 0;
	prototype.var2 = 0;
	prototype.var3 = 0;
	prototype.Init = function(){
	
	}
	prototype.Vars = function(){
	
	}	
}
var my_var = new my_prototype;

$(document).ready(function(){
	$('input.book-search,textarea').placeholder();
	
	$('.search-trigger-btn').click(function(){
	
		$('input[name=search_area]').val( $(this).attr('id') );
		if( $(this).attr('id') == "books" ){
			$('#first-search-form').hide();
			$('#second-search-form').show();
		}
		if( $(this).attr('id') == "site" ){
			$('#first-search-form').show();
			$('#second-search-form').hide();
		}
		return false;
	});
	
	$('.search-block input[type=text]').keydown(function(event) {
		if (event.keyCode == '13') {
			if( $(this).hasClass('site-search') ){
				$('#first-search-form').show();
				$('#second-search-form').hide();
			}
			$(this).after('<input type="hidden" name="set_filter" value="Найти" />');
			$(this).parent().parent().submit();
			return false;
		}
	});
				
	$('.page-num.current').click(false);
	
	$('.more_books_button').click(function(){
		$(this).next().slideToggle();
		if($(this).text()!='Свернуть'){
			$(this).text('Свернуть');
		}else{
			$(this).text('Подробнее');
		}
		return false;
	});

});
