//function noError(){return true;}
//window.onerror = noError;

Event.onDOMReady( function(){ 

	
	$$('.catalog-item').each(function(obj){
		Event.observe(obj, 'click', function(){ 
			num = this.id.split('-');
			hideAll();
			$('catalog' + num[1]).style.display = 'block';

			$('catalogs-image').innerHTML = '<img src="../../cms/classes/phpThumb/phpThumb.php?src=../../../images/catalogs/catalogs_' + num[1] + '.jpg&amp;w=272&amp;h=289" alt=""/>';
			
		} );
	});

	if($('send-form-btn') && $('send-form'))
		Event.observe($('send-form-btn'), 'click', function(){ $('send-form').submit(); } );

	if($('player'))
		flowplayer("player", "../../flowplayer/flowplayer-3.1.1.swf", {canvas: {backgroundColor: "#000000"}, 
																		plugins: { 
																			controls: { 
																				bufferColor: '#050014', 
																				timeColor: '#d5d5e2', 
																				volumeSliderColor: '#000000', 
																				volumeSliderGradient: 'none', 
																				durationColor: '#d9d9e3', 
																				sliderColor: '#000000', 
																				borderRadius: '0px', 
																				sliderGradient: 'none', 
																				backgroundColor: '#000000', 
																				tooltipColor: '#5F747C', 
																				backgroundGradient: [0.6,0.3,0,0,0], 
																				buttonColor: '#474757', buttonOverColor: '#728B94', tooltipTextColor: '#ffffff', 
																				bufferGradient: 'none', progressColor: '#c0c0d3', timeBgColor: '#555555', progressGradient: 'medium', height: 24, opacity: 1.0
																			  } 
																		 }, 
																		 clip: { autoPlay: false }  
																		} );
		
} );

function hideAll()
{
	
	$$('.catalog-hidden').each(function(obj){
		obj.style.display = 'none';
	});

}
