$(document).ready(
	function() {
		//if($.browser.safari) $('input[@type=text]').attr('type','search').addClass('safari');
				
		formpageinit();
	
	}
);

function formpageinit(){
	
	
	$('input[type=text], select, option').focus(
		function(){$(this).parent('dd').prev('dt').addClass('focus');}
	).blur(
		function(){$(this).parent('dd').prev('dt').removeClass('focus');}
		);
	
	$('.auto-submit select').change(function(){
		$(this).parents('form:first').submit();
	}).parents('form').find('.submit-fieldset').addClass('hidden-fieldset');
	
	
	
	$('#tv-manufact-required').change(function(){
		$(this).fadeTo('fast', '0.3', function(){
			var $tv_select = $(this);
			var form_serialized_data = $tv_select.parents('form:first').serialize();
			$.get('/'+langcode+'/products/tv-finder', form_serialized_data, function(response){
				if($('#mount-finder-footer').length) $('#mount-finder-footer').html(response);
				else if($('#search-mount-finder').length) $('#search-mount-finder').replaceWith(response);
				formpageinit();
				$('#tv-manufact-required').fadeTo('fast', '1');
			});
		});
		
	}).parents('form:first').find('.submit-fieldset').addClass('hidden-fieldset');
	
	
	
}