function showRequest(formData, jqForm, options) {
    var queryString = $.param(formData); 
    alert('About to submit: \n\n' + queryString); 
    return true; 
} 
function showLoader ()
{
	$("#viewbrand_container").html('<center><img src="/imgs/design2/loading.gif"></center>');
}
$(document).ready(function(){
				   
// Input load
 $('#podborForm').append('<input type=hidden name=no_design value=true>');
// Табы
$('#tabs div').hide(); 
$('#tabs div:first').show(); 
$('#tabs ul li:first').addClass('active'); 
$('#tabs ul li a').click(function(){ 
$('#tabs ul li').removeClass('active'); 
$(this).parent().addClass('active'); 
var currentTab = $(this).attr('href'); 
$('#tabs div').hide(); 
$(currentTab).show(); 
return false;
});
// Checkbox
	$(".selectbrand .checkbox-select").click(
		function(event) {
			event.preventDefault();
			$(this).parent().addClass("selected");
			$(this).parent().find(":checkbox").attr("checked","checked");
		}
	);
	$(".selectbrand .checkbox-deselect").click(
		function(event) {
			event.preventDefault();
			$(this).parent().removeClass("selected");
			$(this).parent().find(":checkbox").removeAttr("checked");
		}
	);
	$(".selectall").click(function(event){
			event.preventDefault();
			selectAll = $(this).attr('href');
			$(selectAll).find(':li').addClass("selected");					  
			$(selectAll).find(':input').attr("checked","checked");
		}
	);
	$(".deselectall").click(function(){
			event.preventDefault();
			selectAll = $(this).attr('href');
			$(selectAll).find(':li').removeClass("selected");		  
			$(selectAll).find(':input').removeAttr("checked");
		}
	);

// AHAH
/*
	$(".brand_baloon .ahah").click(function(){

	$(".active").removeClass('active');
	$(this).addClass('active');
	var viewBy = $(this).attr('name');
	var liNk = $(this).attr('href');
	$("#view_by").attr({value : viewBy});
//	if (viewBy == 'by_collection') $('.podborselect').attr('disabled','disabled');
//	else $('.podborselect').attr('disabled', '');
	if (viewBy == 'by_man') {	$("#sexselect option").find('selected').removeAttr('selected');
								$("#sexselect option").attr('disabled', 'disabled');
								$("#sexselect option:contains('Мужские')").attr({selected : 'selected',disabled : "false"});}
	if (viewBy == 'by_woman') {	$("#sexselect option").find('selected').removeAttr('selected');
								$("#sexselect option").attr('disabled', 'disabled');
								$("#sexselect option:contains('Женские')").attr({selected : 'selected',disabled : "false"});}
	if (viewBy == 'by_child') {	$("#sexselect option").find('selected').removeAttr('selected');
								$("#sexselect option").attr('disabled', 'disabled');
								$("#sexselect option:contains('Детские')").attr({selected : 'selected',disabled : "false"});}
	if (viewBy == 'by_unisex') {$("#sexselect option").find('selected').removeAttr('selected');
								$("#sexselect option").attr('disabled', 'disabled');
								$("#sexselect option:contains('Унисекс')").attr({selected : 'selected',disabled : "false"});}
	if (viewBy == 'by_fast' || viewBy == 'by_descr') $("#sexselect option").attr('disabled', '');


	$("#viewbrand_container").html('<center><img src="/imgs/design2/loading.gif"></center>');
	var options = {target:  '#viewbrand_container',	beforeSend: showLoader};
	$('#podborForm').ajaxSubmit(options);
	return false;
	});

	$(".uhah").live('click',function(){
	var liNk = $(this).attr('href');
	$("#viewbrand_container").html('<center><img src="/imgs/design2/loading.gif"></center>');
	$("#viewbrand_container").load(liNk);
	elementClick = $("#cut");
	destination = $(elementClick).offset().top;
//	$("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination}, 100 );
	$("body").animate({ scrollTop: 130 }, "slow");
	return false;
	});

*/
 // CASIO toggle
    $("#casio_toggle_action").click(function(){
       $("#casio_toggle").toggle("slow");
       $("body").animate({ scrollTop: 700 }, "slow");
       return false;
    });
// Purchase
	$(".purchase").live('click',function(){
	var liDk = $(this).attr('href');
	$.get(liDk,function(data){alert('Товар успешно добавлен в корзину !')});
	$("#cartcheck").load('/cartcheck?no_design=true');
	return false;
	});
// FORM
	var options = {target:  '#viewbrand_container',  beforeSend: showLoader};
    $('#podborForm').submit(function() {
		$(this).ajaxSubmit(options); 
        return false; 
    }); 
// Изменение размеров баннеров
	var html = document.documentElement;
	bodyWidth = html.clientWidth;
	bodyHeight = html.clientHeight;
	if ($.browser.msie) 
	{
		bodyWidth = document.body.clientWidth;
		bodyHeight = document.body.clientHeight;
	}
	if (bodyWidth >1250)
	{
		bannerWidth = 330;
		bannerHeight = 100;
		bannerHeight2 = 135;
		bannerWidth3 = 168;
		bannerHeight3 = 236;
		tabsHeight = 232;
		pHeight = 1.5;
	}
	if (bodyWidth >=1000 && bodyWidth <=1250)
	{
		bannerWidth = 258;
		bannerHeight = 79;
		bannerHeight2 = 110;
		bannerWidth3 = 138;
		bannerHeight3 = 187;
		tabsHeight = 187;
		pHeight = 0.9;
	}
	$(".banner_podarok object").attr({ width : bannerWidth + "px", height : bannerHeight + "px"});  
	$(".banner_jewelry object").attr({ width : bannerWidth + "px", height : bannerHeight2 + "px"}); 
	$(".banner_chasi object").attr({ width : bannerWidth3 + "px", height : bannerHeight3 + "px"}); 
	$("#tabs").css('height', tabsHeight + "px");
	$('#tabs p').css({lineHeight: pHeight+'em'});
	// Изменение размеров Блоко коллекций
	if (bodyWidth >1250) {	$("#gallery li").css({ width : "200px"}); }
// Изменение шрифта
function fontSize() {
  var width = 1000; // ширина, от которой идет отсчет
  var fontSize = 10; // минимальный размер шрифта
  var menuFontSize = 8;
  var bodyWidth = $('html').width();
  var multiplier = bodyWidth / width;
  if ($('html').width() >= width)
  {
	  if ($('html').width() <= 1300)
          {
           fontSize = Math.floor(fontSize * multiplier);
           menuFontSize = Math.floor(menuFontSize * multiplier);
          }
	  else
          {
           multiplier = 1.3;
           fontSize = Math.floor(fontSize * multiplier);
           menuFontSize = Math.floor(menuFontSize * multiplier);
          }

  }
  $('#tabs p').css({fontSize: fontSize+'px'});
  $('#tabs ul li a').css({fontSize: menuFontSize+'px'}); 
}
$(function() { fontSize(); });
$(window).resize(function() { fontSize(); });
/*model images*/
	var defaultpath = $("#largeImg").attr("src");
	$(".thumbs a").hover(function(){
		var largePath = $(this).attr("href");
		var largeAlt = $(this).attr("title");
		$("#largeImg").attr({ src: largePath, alt: largeAlt });},
		function(){
			$("#largeImg").attr({src: defaultpath});
			});
         $(".thumbs a").click(function(){return false;});

});
