$(function(){
	
})

function chTypeSistem(){
	if($("#type").val() == 'c1'){
		$("#model").removeAttr("disabled");
		$("#model option").removeAttr("selected");
		$("#model option").hide();
		$("#model .c1").show();
	}
	if($("#type").val() == 'c2'){
		$("#model").removeAttr("disabled");
		$("#model option").removeAttr("selected");
		$("#model option").hide();
		$("#model .c2").show();
	}
	if($("#type").val() == ''){
		$("#model option").removeAttr("selected");
		$("#model")[0].disabled = true;
	}
}

function valid(obj){
	var a = Number($(obj).val());
	if(!a || a<=0){
		$(obj).val(1);
	}
}

function is_email(){
	var re = /^(?:[-a-z\d\+\*\/\?!{}`~_%&'=^$#]+(?:\.[-a-z\d\+\*\/\?!{}`~_%&'=^$#]+)*)@(?:[-a-z\d_]+\.){1,60}[a-z]{2,6}$/i;
	if(!re.test($('#email').val())){
		$('#errorBox').removeClass('none');
		$('#errorBox').html('Пожалуйста, введите корректный адрес электронной почты!');
		return false
	}else{
		return true
	};
}

function selectCity(){
	var a=$('#city').val();
	var b=$('#city option[value='+a+']').attr('url');
	location.href = b; 
}

hs.graphicsDir = '/_com/highslide/graphics/';
hs.align = 'center';
hs.transitions = ['expand', 'crossfade'];
hs.fadeInOut = true;
hs.dimmingOpacity = 0.8;
hs.outlineType = 'rounded-white';
hs.captionEval = 'this.thumb.alt';
hs.marginBottom = 105; // make room for the thumbstrip and the controls
hs.numberPosition = 'caption';

// Add the slideshow providing the controlbar and the thumbstrip
hs.addSlideshow({
	//slideshowGroup: 'group1',
	interval: 5000,
	repeat: false,
	useControls: true,
	overlayOptions: {
		className: 'text-controls',
		position: 'bottom center',
		relativeTo: 'viewport',
		offsetY: -60
	},
	thumbstrip: {
		position: 'bottom center',
		mode: 'horizontal',
		relativeTo: 'viewport'
	}
});
