/**
 * @author rgaumond
 */
 
 
  /*
    PAGE
 */
function accueil()
{
	
	window.location.href = "accueil.aspx";
	veil();
}

function updateMember()
{
	document.forms['member_form'].submit();
	veil();
}

function faq()
{
    var theForm = $("nav_form");
	theForm.action = "faq_container.aspx";
	theForm.submit();
	veil();
}


function photoVideo()
{
    var theForm = $("nav_form");
	theForm.action = "photo_container.aspx";
	theForm.submit();
	veil();
}


 /*
    MEMBRE
 */

function showMembers()
{
	
	window.location.href = "members_container.aspx";
	veil();
}

function showMemberAdd()
{
    var theForm = $("nav_form");
    theForm.execute.value = "view_add";
	theForm.selected_member.value = "0";
	theForm.action = "membre_update_container.aspx";
	theForm.submit();
	veil();
}

function showMemberUpdate()
{
    var theForm = $("nav_form");
    theForm.execute.value = "";
	theForm.action = "membre_update_container.aspx";
	theForm.submit();
	veil();
}

function updateMember()
{
	document.forms['member_form'].submit();
	veil();
}

function showProfil(memberID)
{
    var theForm = $("nav_form");
    theForm.execute.value = "show";
	theForm.selected_member.value = memberID;
	theForm.action = "profil_container.aspx";
	theForm.submit();
	veil();
}

function usurper(memberID)
{
    var theForm = $("nav_form");
    theForm.execute.value = "usurper";
	theForm.selected_member.value = memberID;
	theForm.action = "profil_container.aspx";
	theForm.submit();
	veil();
}

function quitter_usurpation()
{
    var theForm = $("nav_form");
    theForm.execute.value = "quitter_usurpation";
	theForm.action = "accueil.aspx";
	theForm.submit();
	veil();
}

 /*
    ACTIVITY
 */
 
function activityAnnule(raison)
{
	if(raison=="")
	    $("raison_alert").style.display="block";
	else
	{
	    var theForm = $("nav_form");	
	    theForm.execute.value = "annule";
	    theForm.action = "activite.aspx";
	    theForm.nav_info.value = raison;
	    theForm.submit();
	    veil();
    }
}

function activityComplete()
{
	var theForm = $("nav_form");	
	theForm.execute.value = "complete";
	theForm.action = "activite.aspx";
	theForm.submit();
	veil();
}

function activityDelete()
{
	var theForm = $("nav_form");	
	theForm.execute.value = "delete";
	theForm.action = "activite.aspx";
	theForm.submit();
	veil();
}


function activityDispatch(activity_id)
{
	var theForm = $("nav_form");	
	theForm.execute.value = "show";
	theForm.selected_activity.value = activity_id;
	theForm.action = "activite.aspx";
	theForm.submit();
	veil();
}

function activityList()
{
	var theForm = $("nav_form");

	theForm.action = "activites.aspx";
	theForm.submit();
}

function activityViewUpdate(activity_id)
{
	var theForm = $("nav_form");
	
	theForm.execute.value = "view";
	theForm.selected_activity.value = activity_id;
	theForm.action = "activity_update_container.aspx";
	theForm.submit();
	veil();
}

function activityUpdate()
{
	var theForm = $("activity_update_form");
	theForm.action = "activity_update_container.aspx";
	theForm.submit();
	veil();
}

function activityViewAdd()
{
	
	var theForm = $("nav_form");
	
	theForm.execute.value = "view_add";
	theForm.action = "activity_update_container.aspx";
	theForm.submit();
	veil();
}

function cancelInscription(activity_id)
{
	var theForm = $("nav_form");
	
	theForm.execute.value = "cancel_inscription";
	theForm.selected_activity.value = activity_id;
	theForm.action = "activite.aspx";
	theForm.submit();
}

function cancelTransport(transport_id)
{
	var theForm = $("nav_form");
	
	theForm.execute.value = "delete_transport";
	theForm.transport_id.value = transport_id;
	theForm.action = "activite.aspx";
	theForm.submit();
	veil();
}

function paypalInscription()
{
	var theForm = $("activite_inscription");
	theForm.statusID.value = "2";
	theForm.execute.value = "inscriptionPaypal";
	theForm.action = "activite.aspx";
	theForm.submit();
	veil();
}

function paypalResumeInscription()
{
	var theForm = $("paypal_inscription");
	theForm.submit();
	veil();
}

function chequeInscription()
{
	var theForm = $("activite_inscription");
	theForm.statusID.value = "2";
	theForm.execute.value = "inscription";
	theForm.action = "activite.aspx";
	theForm.submit();
	veil();
}

function factures()
{
	var theForm = $("nav_form");
	theForm.execute.value = "factures";
	theForm.action = "activite.aspx";
	theForm.submit();
	veil();
}

function openFacture(activite_id)
{
    window.open(base_URL+"PDF/facture.pdf");
}

function openFiche(activite_id)
{
    window.open(base_URL+"PDF/fiche.pdf");
}


function fiches()
{
	var theForm = $("nav_form");
	theForm.execute.value = "fiches";
	theForm.action = "activite.aspx";
	theForm.submit();
	veil();
}

function fiche(member_id)
{
	var theForm = $("nav_form");
	theForm.execute.value = "fiche";
	theForm.selected_member.value = member_id;
	theForm.action = "profil_container.aspx";
	theForm.submit();
	veil();
}
/*    LOGIN  */

function logout()
{
	var theForm = $("nav_form");
	theForm.execute.value = "logout";
	theForm.action = "accueil.aspx";
	theForm.submit();
	veil();
}

function goToCyclo()
{
    window.location.href = "accueil.aspx?site=cyclo";
	veil();
}

function goToRoue()
{
    window.location.href = "accueil.aspx?site=roue";
	veil();
}
