﻿$(document).ready(function() {
    $('#adv_on').click(function(){
        $('#form_search').hide();
        $('#form_advsearch').show();

        return(false);
    });

    $('#adv_off').click(function(){
        $('#form_search').show();
        $('#form_advsearch').hide();

        return(false);
    });

    $('#clear_scolor').click(function(){
        $('#stitle').attr('value', '');
	$('#scolor').attr('value', '');
	$('#metallic_id').attr('value', '');
	$('#metallic_id').attr('checked', '');
	$('#smetallic').attr('value', '');

        return(false);
    });

    $('#clear_sbody').click(function(){
        $('#stitle2').attr('value', '');
	$('#sphoto').attr('value', '');

        return(false);
    });

    $('body').click(function(){
	$('#allcolorselementsscolor').hide();
	$('#allcolorselementssphoto').hide();
    });

    $('#allcolorselementsscolor').click(function(){
	return(false);
    });

    $('#vin_opt').change(function(){
	if($(this).attr('value') == 1) $('#vin').attr('disabled', false);
        else $('#vin').attr('disabled', true);

        return(true);
    });

    $('#overlim').click(function() {
	$(this).css('color', '#ff0000');
	$(this).html('Превышен лимит авто!');
	$(this).unbind();
    });

    if(jQuery.browser.msie) {
	$("input[type='text'], input[type='password'], input[type='file']").addClass('inputs');
    }

});

