var noFlash = false;
$(document).ready(function() {
	// fancybox
	var FancyBase = {
			'overlayColor'  : '#000',
			'overlayOpacity': '0.8',
			'transitionIn'  : 'elastic',
			'transitionOut'  : 'elastic'
		};
	$('a[target="_fancybox"]').fancybox($.extend(FancyBase,{
		'titlePosition' : 'inside'
	}));
	$('a[target="_popup"]').fancybox($.extend(FancyBase,{
		'type' : 'iframe'
	}));
	
	if($('.mainMedia .slider img').length>1) {
	    $('.mainMedia .slider').cycle({
			  fx: 'fade',
			  pager:  '.mainMedia-pager',
			  speed : 2000
			 });
	}
	// form
	if($('.Ierror')[0]) {
		$('html, body').animate({scrollTop:$('.Ierror:eq(0)').offset().top}, 'fast',
			function() {
					$.fancybox(
					'<h2>'+$('h1').text()+'</h2><p style="color:red">'+$('legend').text()+'</p>',
					{
			        		'autoDimensions'	: false,
						'width'         		: 350,
						'height'        		: 'auto',
						'transitionIn'		: 'none',
						'transitionOut'		: 'none'
					}
					);	
			}
		
		);
			
	}
	
});


