/* -------------------------------------------------
	BASE JAVASCRIPT
	(c)2007    www.elitemediacompany.com
	Created:   06.12.2008
	Author:    ELITE MEDIA COMPANY LLC
------------------------------------------------- */

$().ready(function()
{
	/* Display a user Flash message */
	$("#FlashNotice").hide().fadeIn();

	$("#FlashNotice a.close").click( function(e){
		e.preventDefault();
		$("#FlashNotice").hide("normal", function() {
			$("#FlashNotice").remove();
		});
	});

	// Open all links with class .oulink in a new window
	$('.outlink').attr('target', '_blank');

	// Scroll to the errors if there are
	$(".error").each(function(){
		$.scrollTo('.error');
	});

	/* JS Calendar settings */
	$.datepicker.setDefaults({
		showOn: 'both',
		buttonImageOnly: true,
		buttonImage: 'public/images/calendar.gif',
		closeAtTop: false
	});

	$.datepicker.regional['fr'] = {clearText: 'Effacer', clearStatus: '',
		closeText: 'Fermer', closeStatus: '',
		prevText: '&lt;Préc', prevStatus: '',
		nextText: 'Proch&gt;', nextStatus: '',
		currentText: 'En cours', currentStatus: '',
		monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin',
		'Juillet','Août','Septembre','Octobre','Novembre','Décembre'],
		monthNamesShort: ['Jan','Fév','Mar','Avr','Mai','Jun',
		'Jul','Aoû','Sep','Oct','Nov','Déc'],
		monthStatus: '', yearStatus: '',
		weekHeader: 'Sm', weekStatus: '',
		dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'],
		dayNamesShort: ['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'],
		dayNamesMin: ['Di','Lu','Ma','Me','Je','Ve','Sa'],
		dayStatus: 'DD', dateStatus: 'D, M d',
		dateFormat: 'dd/mm/yy', firstDay: 0,
		initStatus: '', isRTL: false};
	$.datepicker.setDefaults($.datepicker.regional['fr']);

});

function showHide(elementToHide, elementToShow)
{
	$(elementToHide).toggle();
	$(elementToShow).toggle();
}

/* FLV Player */
function createplayer(publicpath, width, height, movie, divID)
{
    var divID = (!divID || divID=='' || divID==null) ? 'player' : divID;

    var s = new SWFObject(publicpath+'js/flvplayer/flvplayer.swf',"FLVplayer",width,height,"7");
    s.addParam("allowfullscreen","true");
    s.addVariable("image",publicpath+"images/playvideo.jpg");
    s.addVariable("file",movie);
    s.addVariable("overstretch","fit");
    s.write(divID);
}
