/**
 * @author rgaumond
 */
function verouillee_button()
{
	function_initiated("verouilles_button");
	
	new Buttons.create({
		id: "verouille",
		enabled: true,
		onclick_actions: function(){
			return false;
		},
		positionning: {
			cssFloat: 'right'
		},
		child_of: "button_container",
		tip:null,
		image:"verrouillee.gif",
		imageOn:"verrouillee.gif",
		type: "image"
	});
	function_completed("verouilles_button");
}

function complet_button()
{
	function_initiated("complet_button");
	
	new Buttons.create({
		id: "verouille",
		enabled: true,
		onclick_actions: function(){
			return false;
		},
		positionning: {
			cssFloat: 'right'
		},
		child_of: "button_container",
		tip:null,
		image:"complete.gif",
		imageOn:"complete.gif",
		type: "image"
	});
	function_completed("complet_button");
}

function annule_inscription_button()
{
	function_initiated("annule_inscription_button");
	new Buttons.create({
		id: "annuler_mon_inscription",
		enabled: true,
		onclick_actions: function(){
			show_alert('annul_inscription');
		},
		positionning: {
			cssFloat: 'right'
		},
		child_of: "button_container",
		tip:null,
		image:"annuler.gif",
		imageOn:"annulerOn.gif",
		type: "image"
	});
	function_completed("annule_inscription_button");
}

function bougex_inscription()
{
	function_initiated("bougex_inscription");
	new Buttons.create({
		id: "bougex_inscription",
		enabled: true,
		onclick_actions: function(){
			window.open('http://www.cclacc.ca');
		},
		positionning: {
			cssFloat: 'right'
		},
		child_of: "button_container",
		tip:null,
		image:"cclacc.gif",
		imageOn:"cclaccOn.gif",
		type: "image"
	});
	function_completed("bougex_inscription");
}

function anonymous_inscription(){
	function_initiated("anonymous_inscrit");
if(current_activity.paypal){	new Buttons.create({
		id: "inscrire",
		enabled: true,
		onclick_actions: function(){
			show_alert("login_inscription");
		},
		positionning: {
			left: 220
		},
		tip: null,
		image: "paypal_button.gif",
		imageOn: "paypal_buttonOn.gif",
		type: "image"
	});
}
else
{
	new Buttons.create({
		id: "inscrire",
		enabled: true,
		onclick_actions: function(){
			show_alert("login_inscription");
		},
		positionning: {left:220
		},
		tip:null,
		image:"inscription.gif",
		imageOn:"inscriptionOn.gif",
		type: "image"
	});
}
	function_completed("anonymous_inscrit");
}

function paypal_inscription(){
	function_initiated("paypal_inscrit");

	new Buttons.create({
		id: "inscrire",
		enabled: true,
		onclick_actions: function(){
			show_alert("paypal_init",'_large');
		},
		positionning: {left:220
		},
		tip:null,
		image:"paypal_button.gif",
		imageOn:"paypal_buttonOn.gif",
		type: "image"
	});
	
	function_completed("paypal_inscrit");
}

function logged_inscription(){
	function_initiated("logged_inscription");
	
	new Buttons.create({
		id: "inscrire",
		enabled: true,
		onclick_actions: function(){
			inscription();
		},
		positionning: {left:220	},
		child_of: "button_container",
		tip:null,
		image:"inscription.gif",
		imageOn:"inscriptionOn.gif",
		type: "image"
	});
	
	function_completed("logged_inscription");
}

function create_list_button()
{
	function_initiated("create_list_button");
	var the_button = document.createElement("img");
	the_button.src = pathToButtons+"/liste_act.gif";
	the_button.className = "activity_advance_buttons";
	the_button.onclick =  function(){
		window.open("activity_member_print_list.aspx?activityID=" + current_activity.id+"&title="
		+current_activity.title+"&the_date="+current_activity.date_text);
	};
	$("advance_activity_buttons").appendChild(the_button);
	function_completed("create_list_button");
}

function create_mod_button()
{
	function_initiated("create_mod_button");
	var the_button = document.createElement("img");
	the_button.src = pathToButtons+"/modifier_act.gif";
	the_button.className = "activity_advance_buttons";
	the_button.onclick =  function(){
		selected_user = currentUser;
		show_activity_update(current_activity.id);
	};
	$("advance_activity_buttons").appendChild(the_button);
	function_completed("create_mod_button");
}

function create_complet_button()
{
	function_initiated("create_complet_button");
	var the_button = document.createElement("img");
	the_button.src = pathToButtons+"/complet_act.gif";
	the_button.className = "activity_advance_buttons";
	the_button.onclick =  function(){
				selected_user = currentUser;
				show_alert('complete_confirm');
	};
	$("advance_activity_buttons").appendChild(the_button);
	function_completed("create_complet_button");
}

function create_canceller_button()
{
	function_initiated("create_canceller_button");
	var the_button = document.createElement("img");
	the_button.src = pathToButtons+"/cancel_act.gif";
	the_button.className = "activity_advance_buttons";
	the_button.onclick =  function(){
				selected_user = currentUser;
				show_alert("cancel_activite");
				$('raison').focus();
	};
	$("advance_activity_buttons").appendChild(the_button);
	function_completed("create_canceller_button");
}

function create_supprimer_button()
{
	function_initiated("create_supprimer_button");
	var the_button = document.createElement("img");
	the_button.src = pathToButtons+"/supprimer_act.gif";
	the_button.className = "activity_advance_buttons";
	the_button.onclick =  function(){
				selected_user = currentUser;
				show_alert("supprimer_activite");
	};
	$("advance_activity_buttons").appendChild(the_button);
	function_completed("create_supprimer_button");
}

function create_fiche_button()
{
	function_initiated("create_fiche_button");
	var the_button = document.createElement("img");
	the_button.src = pathToButtons+"/fiches_act.gif";
	the_button.className = "activity_advance_buttons";
	the_button.onclick =  function(){
				selected_user = currentUser;
				fiches(current_activity.id);
	};
	$("advance_activity_buttons").appendChild(the_button);
	function_completed("create_fiche_button");
}

function create_factures_button()
{
	function_initiated("create_factures_button");
	var the_button = document.createElement("img");
	the_button.src = pathToButtons+"/factures_act.gif";
	the_button.className = "activity_advance_buttons";
	the_button.onclick =  function(){
				selected_user = currentUser;
				factures(current_activity.id);//in navigation.js
	};
	$("advance_activity_buttons").appendChild(the_button);
	function_completed("create_factures_button");
}



function annule_transport(detailed_caption){
	function_initiated("annule_transport");
	new Buttons.create({
		id: "transport_annule" + detailed_caption,
		theCaption: "Annuler co-voiturage" + detailed_caption,
		enabled: true,
		onclick_actions: function(){
			show_alert('transport_cancel');
		},
		positionning: {
			cssFloat: 'right'
		},
		child_of: "button_container",
		class_Prefix: "footer",
		tip:null,
		type: "custom"
	});
	function_completed("annule_transport");
}

function modifier_transport(detailed_caption){
	function_initiated("modifier_transport");
	new Buttons.create({
		id: "transport_mod",
		theCaption: "Modifier co-voiturage" + detailed_caption,
		enabled: true,
		onclick_actions: function(){
			inscription();
		},
		positionning: {
			cssFloat: 'right'
		},
		child_of: "button_container",
		class_Prefix: "footer",
		tip:null,
		type: "custom"
	});
	function_completed("modifier_transport");
}

function equipe_inscription(detailed_caption){
	function_initiated("equipe_inscription");
	new Buttons.create({
		id: "inscrire",
		theCaption: "Je m'inscris" + detailed_caption,
		enabled: true,
		onclick_actions: function(){
			inscription();
		},
		positionning: {
		},
		child_of: "info_box_button_container",
		class_Prefix: "footer",
		tip:null,
		image:"inscription.gif",
		imageOn:"inscriptionOn.gif",
		type: "image"
	});
	function_completed("equipe_inscription");
}




function activity_update_button(){
	function_initiated("activity_update_button");
	$("button_container").innerHTML="";
	new Buttons.create({
		id: "activity_update_button",
		theCaption: "Modifier",
		enabled: true,
		onclick_actions: function(){
			modifier_activite();
		},
		positionning: {
			cssFloat:'right'
		},
		child_of: "button_container",
		tip:null,
		image:"modifier.gif",
		imageOn:"modifierOn.gif",
		type:"image"});
	function_completed("activity_update_button");
}

function activity_add_button()
{
function_initiated("activity_add_button");
			
			new Buttons.create({id:"activity_update_button",
							   theCaption:"Sauvegarder",
							   enabled:true,
							   onclick_actions:function(){ajouter_activite()},
							   positionning:{cssFloat:'right'},
					   		   child_of:"button_container",
							   class_Prefix:"footer",
							   tip:null,
							   image:"sauvegarder.gif",
							   imageOn:"sauvegarderOn.gif",
							   type:"image"});
function_completed("activity_add_button");
}

