$(document).ready(function(){

    $('#menu').flash({
        src: URL + 'img/menu.swf',
		width: 967,
		height: 398,
		wmode: 'transparent',
		flashvars: {'url':URL, 'p': page}
    });
	$('#home').flash({
        src: URL + 'img/home.swf',
		width: 967,
		height: 835,
		wmode: 'transparent',
		flashvars: {'url':URL, 'p': page}
    });
	$('.facesflash').flash({
        src: URL + 'img/faces.swf',
		width: 900,
		height: 215,
		wmode: 'transparent',
		flashvars: {'link':URL + 'xml/faces/' + $('.facesflash').attr('id')}
    });
	
	$('.news-gallery a').lightBox({fixedNavigation:true});
	$('.gallery .item a.open').lightBox({fixedNavigation:true});
	$('.face-gallery a').lightBox({fixedNavigation:true});
	$(".csbm").click(function(){ $("#csbm-form").submit(); });
	
	if ($('#player').length > 0)
	{
		initPlayer(false);
	}
	$('.video-btn').click(function(){
		$('#player').attr('href', $(this).attr('rel'));
		initPlayer(true);
	});

	$('.contact-sbm').click(function(){
		$('.cform').submit();
	});
	
});

function initPlayer(play)
{
	flowplayer("player", URL + "templates/flowplayer/flowplayer-3.2.5.swf", { clip: { autoPlay: play } });
}
function LightboxDelegate(url,caption) 
{
	 var objLink = document.createElement('a');
	 objLink.setAttribute('href', url);
	 objLink.setAttribute('rel', 'lightbox');
	 objLink.setAttribute('title', caption);
	 $(objLink).lightBox({fixedNavigation:true});
	 $(objLink).click();		 
}
