function viewH (sender, id)
{
	eventTarget 	= getDocument(sender).getElementById (EVENTTARGET) ;
	eventArgument   = getDocument(sender).getElementById (EVENTARGUMENT) ;
	
	eventTarget.value = "VIEW_HOUR";
	eventArgument.value = id;
	
	submitForm ();
}
function viewS (sender, id)
{
	eventTarget 	= getDocument(sender).getElementById (EVENTTARGET) ;
	eventArgument   = getDocument(sender).getElementById (EVENTARGUMENT) ;
	
	eventTarget.value = "VIEW_SLICE";
	eventArgument.value = id;
	
	submitForm ();
}

function consult (sender, id)
{
	eventTarget 	= getDocument(sender).getElementById (EVENTTARGET) ;
	eventArgument   = getDocument(sender).getElementById (EVENTARGUMENT) ;
	
	eventTarget.value = "CONSU";
	eventArgument.value = id;
	
	
	submitForm ();
}


function suppReservation (sender, hdfId, id)
{
	hdf	= getDocument(sender).getElementById (hdfId) ;
	if ( hdf != null )
	{
	    hdf.value = id;
	}
	else
	{
	    alert("Supp reservation error, call ppr administrator");
	}
}


function removeDate (sender)
{

}

// ********************************** //
// -> SlotTable TO SlotReservation <- //
// ********************************** //

var G_HDF_SUB_ID = "G_HDF_SUB_ID";
var G_HDF_SUB_CODE = "G_HDF_SUB_CODE";
var G_HDF_SUB_NBSLOT = "G_HDF_SUB_NBSLOT";
var G_HDF_SUB_PISTON_ENGINE = "G_HDF_PISTON";

function subscribe(sender, prefix, id, code, slot)
{
	hdf 	= getDocument(sender).getElementById (prefix + G_HDF_SUB_CODE) ;	
	if ( hdf != null )
	{
	    hdf.value = code;
	    hdf 	  = getDocument(sender).getElementById (prefix + G_HDF_SUB_ID) ;	
	    if ( hdf != null )
	    {
	        hdf.value = id;	        
	        hdf 	  = getDocument(sender).getElementById (prefix + G_HDF_SUB_NBSLOT) ;
	        if (hdf != null) { hdf.value = slot; }
	        
	        submitForm ();
	    }
	    else
	    {
	        alert ("Subscribe error in javascript, call administrator");
	    }
	}
	else
	{
	    alert ("Subscribe error in javascript, call administrator");
	}
}

// ********************************** //
// -> SlotReservation behavior     <- //
// ********************************** //

function ShowHide (sender, showId, hideId)
{
   eltH = getDocument(sender).getElementById (hideId) ;
   eltS = getDocument(sender).getElementById (showId) ;
   if ( eltH != null && eltS != null )
   {
        eltH.style.display = 'block';
        eltS.style.display = 'none';
   }
   else
   {
        alert ("ShowHide identifer wrong, call administrator");
   }
}

