function callDialog( dtitle, dcontent )
{
	$("#dialog").attr('title',dtitle).html(dcontent);
	$("#dialog").dialog({
		bgiframe: true,
		modal: true,
		width: 350,
		buttons: {
			Ok: function() {
				$(this).dialog('close');
			}
		}
	});
	$('#fill_dialog').html('<div id="dialog" title=""></div>');		
}

function checkValue( el )
{
	if ( el.val() == "votre email" )
		el.val('');
	else if ( el.val() == "" )
		el.val('votre email');
}

function checkValueMessage( el )
{
	if ( el.val() == "Votre message..." )
		el.val('');
	else if ( el.val() == "" )
		el.val('Votre message...');	
}

// var state = 0;
// function showHideMenu( pos )
// {
	// state = pos;
	// setTimeout( "actionMenu()", 200 );
// }

// function actionMenu()
// {
	// if ( state )
	// {
		// $('#menu_occasions').show();
	// }
	// else
	// {
		// $('#menu_occasions').hide();
	// }	
// }

$(document).ready( function() {
	var d = new Date();
	var curr_year = d.getFullYear();
	
	$('input[name=test_date]').datepicker({showOn: 'both', buttonImage: webpath + 'files/images/calendar.gif', dateFormat:'dd/mm/yy', buttonImageOnly: true, changeYear: true, yearRange: '1990:' + curr_year, changeMonth: true});
	$('img.ui-datepicker-trigger').css('margin','3px 0 0 3px').css('cursor','pointer');
	
	//Examples of how to assign the ColorBox event to elements
	// $(".form_plus").colorbox( {
		// width:"600px",
		// height:"350px",
		// inline:true,
		// opacity: 0.5,
		// href:"#new_cars_form_plus"
	// });
	
	// $(".form_essai").colorbox( {
		// width:"600px", 
		// height:"300px", 
		// inline:true,
		// opacity: 0.5,
		// href:"#new_cars_form_essai"
	// });
	$(".form_plus").fancybox( {
		width:600,
		height:350,
		autoDimensions:false,
		centerOnScroll:true,
		opacity: 0.5
	});
	
	$(".form_essai").fancybox( {
		width:600, 
		height:300,
		autoDimensions:false,
		centerOnScroll:true,
		opacity: 0.5
	});
	
	$('select[name^="statut"]').change(function(){
		//var demande_id = $(this).attr("title");
		//var statut = $(this).val();
		//alert(statut);
		//alert(demande_id);
		$(this).parent("form").submit();
		//window.location.reload();
	});
	
	/*
	$("a[rel='example1']").colorbox();
	$("a[rel='example2']").colorbox({transition:"fade"});
	$("a[rel='example3']").colorbox({transition:"none", width:"75%", height:"75%"});
	$("a[rel='example4']").colorbox({slideshow:true});
	$(".example5").colorbox();
	$(".example6").colorbox({iframe:true, innerWidth:425, innerHeight:344});
	$(".example7").colorbox({width:"80%", height:"80%", iframe:true});
	
	$(".example9").colorbox({
		onOpen:function(){ alert('onOpen: colorbox is about to open'); },
		onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); },
		onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); },
		onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); },
		onClosed:function(){ alert('onClosed: colorbox has completely closed'); }
	});
	
	//Example of preserving a JavaScript event for inline calls.
	$("#click").click(function(){ 
		$('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
		return false;
	});
	*/
});







