//////////////////////////////////////////////////////
// popup centered window 
//////////////////////////////////////////////////////
function PopUpWin(filename,cMyWidth,cMyHeight) {

iMyWidth = (window.screen.width/2) - (parseInt((cMyWidth/2)) + 10);
iMyHeight = (window.screen.height/2) - (parseInt((cMyHeight/2)) + 10);
//Open the window.
win2 = window.open(filename,null,"status=no,height="+cMyHeight+",width="+cMyWidth+",resizable=no,left=" + iMyWidth + ",top=" + iMyHeight + ",screenX=" + iMyWidth + ",screenY=" + iMyHeight + ",toolbar=no,menubar=no,scrollbars=yes,location=no,directories=no");
win2.focus();
}

//////////////////////////////////////////////////////
// is digit function
//////////////////////////////////////////////////////
function IsDigit()
{return ((event.keyCode >= 48) && (event.keyCode <= 57))}

//////////////////////////////////////////////////////
// admin rec delete confirmation
//////////////////////////////////////////////////////

function confirmDelete(url)
{
 conf=window.confirm("êtes vous sur de vouloir supprimer l'enregistrement ?");
 if (conf) 
 { location.href=url;} 
 else
 { return;  }
}

//////////////////////////////////////////////////////
// goidx ( go to key related selection )
//////////////////////////////////////////////////////
function goidx(idx,theLink)
{ 
var idxl = idx.length ;
if (idx=='-1' ) {return ;}
 if (idx.substr(0,1)=='+') 
 { document.location.href = theLink +'?ro=true&frmidxid='+idx.substr(1); }
 else
 { document.location.href = theLink +'?frmidxid='+idx ; }
}

//////////////////////////////////////////////////////
// goidx0 ( go to key0 related selection )
//////////////////////////////////////////////////////
function goidx0(idx,theLink)
{ 
if (idx==-1 ) {return ;}
document.location.href = theLink +'?frmidx0id='+idx 
}

//////////////////////////////////////////////////////
// goidxS ( go to keyS related selection ( srubs only )
//////////////////////////////////////////////////////
function goidxS(idx,theLink)
{ 
if (idx==-1 ) {return ;}
document.location.href = theLink +'?ro=true&frmidxSid='+idx 
}

//////////////////////////////////////////////////////
// FM file delete confirmation
//////////////////////////////////////////////////////

function confirmFileDelete(url)
{
 conf=window.confirm("êtes vous sur de vouloir supprimer cet élément ?");
 if (conf)
 { location.href=url;}
 else
 { return;  }
}

//////////////////////////////////////////////////////
// FM acceptmkdir
//////////////////////////////////////////////////////

function acceptmkdir()
{
//alert ('test')
if (document.formfm.dirname.value=='')
  { alert ('Nom du dossier manquant !') ; document.formfm.dirname.focus() ;return}
document.formfm.mkdir.value='makedir';
document.formfm.submit();
}
//////////////////////////////////////////////////////
// FM accept upload
//////////////////////////////////////////////////////

function acceptupload()
{
//if (document.formfm.dirname.value=='')
//  { alert ('Nom du dossier manquant !') ; document.formfm.dirname.focus() ;return}
document.formfm.upload.value='upload';
document.formfm.submit();
}

//////////////////////////////////////////////////////
// FM accept rename
//////////////////////////////////////////////////////

function acceptren()
{
if (document.formfm.targetname.value=='')
  { alert ('Nom incorrect !') ; document.formfm.changename.focus() ;return}
document.formfm.changename.value='Rename';
document.formfm.submit();
}

//////////////////////////////////////////////////////
// FM accept move/copy
//////////////////////////////////////////////////////

function acceptcm()
{
//if (document.formfm.targetname.value=='')
//  { alert ('Nom incorrect !') ; document.formfm.changename.focus() ;return}
document.formfm.cmtcpmv.value='Commit';
document.formfm.submit();
}


