﻿function chb_check(el, max){		chb = $(el).parent().find('input');		if(chb.attr('checked')==false)		{			if($(".searchform_ext_right").find("input[checked=true]").length < max)			{				el.src='/../img/chb_on.png';				chb.attr('checked', true);			}			else alert("Вы можете выбрать не более "+max+"-х стилей.");		}		else		{			el.src='/../img/chb_off.png';			chb.attr('checked', false);			}}function m_check(el){	el.src='/../img/search_checked.png';	document.getElementById('typem').checked=true;	document.getElementById('typewimg').src='/../img/search_unchecked.png';	document.getElementById('typew').checked=false;}function w_check(el){	el.src='/../img/search_checked.png';	document.getElementById('typew').checked=true;	document.getElementById('typemimg').src='/../img/search_unchecked.png';	document.getElementById('typem').checked=false;}function m_check_r(el){	el.src='/../img/search_checked.png';	document.getElementById('pol1').checked=true;	document.getElementById('typewimg_r').src='/../img/search_unchecked.png';	document.getElementById('pol2').checked=false;}function w_check_r(el){	el.src='/../img/search_checked.png';	document.getElementById('pol2').checked=true;	document.getElementById('typemimg_r').src='/../img/search_unchecked.png';	document.getElementById('pol1').checked=false;}$(document).ready(function() {	chbs = $(".custom_chb");	chbs_img = $(".custom_chb_img");	for(i=0;i<chbs.length;i++)	{		if($(chbs[i]).attr('checked')==true) $(chbs_img[i]).attr('src', '/../img/chb_on.png');	}	if ($("#typew").attr('checked')==true) $("#typewimg_r").attr('src', '/../img/search_checked.png');	else $("#typewimg").attr('src', '/../img/search_unchecked.png');	if ($("#typem").attr('checked')==true) $("#typemimg_r").attr('src', '/../img/search_checked.png');	else $("#typemimg").attr('src', '/../img/search_unchecked.png');		if ($("#pol2").attr('checked')==true) $("#typewimg_r").attr('src', '/../img/search_checked.png');	else $("#typewimg_r").attr('src', '/../img/search_unchecked.png');	if ($("#pol1").attr('checked')==true) $("#typemimg_r").attr('src', '/../img/search_checked.png');	else $("#typemimg_r").attr('src', '/../img/search_unchecked.png');		if ($("#typemp3").attr('checked')==true) {$("#typemp3img").attr('src', '/../img/search_checked.png'); $('#searchform').attr('action', '/searchmp3');}	else $("#typemp3img").attr('src', '/../img/search_unchecked.png');	if ($("#typedj").attr('checked')==true) $("#typedjimg").attr('src', '/../img/search_checked.png');	else $("#typedjimg").attr('src', '/../img/search_unchecked.png');	if ($("#typem").attr('checked')==true) $("#typemimg").attr('src', '/../img/search_checked.png');	else $("#typemimg").attr('src', '/../img/search_unchecked.png');	if ($("#typew").attr('checked')==true) $("#typewimg").attr('src', '/../img/search_checked.png');	else $("#typewimg").attr('src', '/../img/search_unchecked.png');	});/* select init */var params = {		changedEl: "#search_country, #search_year, #extra_style, #country, #mainstyle",		visRows: 10,		scrollArrows: true	}//cuSel(params);$(document).ready(function() {	//$('#search_ext_field').hide(); /* display:none cusel error fix */		//guestbook	$('#name').focus(function() {		if($('#name').val() == 'Ваше имя')			$('#name').val('');	});	$('#email').focus(function() {		if($('#email').val() == 'Email')			$('#email').val('');	});	$('#city').focus(function() {		if($('#city').val() == 'Город')			$('#city').val('');	});		$('#msgarea').focus(function() {		if($('#msgarea').val() == 'Ваш комментарий')			$('#msgarea').val('');	});	$('#name').blur(function() {		if($('#name').val() == '')			$('#name').val('Ваше имя');	});	$('#email').blur(function() {		if($('#email').val() == '')			$('#email').val('Email');	});	$('#city').blur(function() {		if($('#city').val() == '')			$('#city').val('Город');	});		$('#msgarea').blur(function() {		if($('#msgarea').val() == '')			$('#msgarea').val('Ваш комментарий');	});			//quick search	$('#ext_keyword').focus(function() {		if($('#ext_keyword').val() == 'Введите ключевое слово')			$('#ext_keyword').val('');	});	$('#ext_keyword').blur(function() {		if($('#ext_keyword').val() == '')			$('#ext_keyword').val('Введите ключевое слово');	});	$('#search').focus(function() {		if($('#search').val() == 'Введите ключевое слово')			$('#search').val('');	});	$('#search').blur(function() {		if($('#search').val() == '')			$('#search').val('Введите ключевое слово');	});		$('#search_city_world').focus(function() {		if($('#search_city_world').val() == 'Введите город')			$('#search_city_world').val('');	});	$('#search_city_world').blur(function() {		if($('#search_city_world').val() == '')			$('#search_city_world').val('Введите город');	});	//comment	$('#comment_form_name').focus(function() {		if($('#comment_form_name').val() == 'Ваше имя')			$('#comment_form_name').val('');	});	$('#comment_form_name').blur(function() {		if($('#comment_form_name').val() == '')			$('#comment_form_name').val('Ваше имя');	});	$('#comment_form_city').focus(function() {		if($('#comment_form_city').val() == 'Ваш город')			$('#comment_form_city').val('');	});	$('#comment_form_city').blur(function() {		if($('#comment_form_city').val() == '')			$('#comment_form_city').val('Ваш город');	});	$('#comment_form_text').focus(function() {		if($('#comment_form_text').val() == 'Ваш комментарий')			$('#comment_form_text').val('');	});	$('#comment_form_text').blur(function() {		if($('#comment_form_text').val() == '')			$('#comment_form_text').val('Ваш комментарий');	});	$('#reg_bio').focus(function() {		if($('#reg_bio').val() == 'не менее '+bio_minlength+' символов')			$('#reg_bio').val('');	});	$('#reg_bio').blur(function() {		if($('#reg_bio').val() == '')			$('#reg_bio').val('не менее '+bio_minlength+' символов');	});	//menu	$(".morelink").click(function(){		$(this).parent().children(".moreitem").show(300);		return false;	});	$(".moreitem").mouseleave(function(){		$(this).hide(300);		return false;	});			$("#login").val('');	$("#login").blur();	$("#password").blur();		$("#password_text").click(function(){		$(this).hide();		$("#password").focus();	});		$("#password").focus(function(){		$("#password_text").hide();	});		$("#password").blur(function(){		if($(this).val()=='') $("#password_text").show();	});		$("#login_text").click(function(){		$(this).hide();		$("#login").focus();	});		$("#login").blur(function(){		if($(this).val()=='') $("#login_text").show();	});			$("#password").focus(function(){		$("#password_text").hide();	});	$("#login").focus(function(){		$("#login_text").hide();	});	});	function toggle_search(){	if($('#search_ext_field').css('display')=='none') {$('#search_field').hide(500); $('#search_ext_field').show(500);}	if($('#search_field').css('display')=='none') {$('#search_ext_field').hide(500); $('#search_field').show(500);}	return false;}
