/***** ENVOYER A UN AMI ****************************************************************/
function mailpage()
{
 chaine_mail = "mailto:?subject=" + document.title;
 /*
 chaine_mail += "&body=Cher%20%5Bnom%5D%2C%0D%0A%0D%0A";
 chaine_mail += "Je%20recommande%20cette%20page%3A%20%22" + document.title;
 chaine_mail += "%22.%0D%0AConsultable%20%E0%20l%27adresse%3A%20" + window.location.href;
 chaine_mail += ".%0D%0A%0D%0ACordialement%2C%0D%0AXXX";
 */
 
 window.location.href = chaine_mail;
}

/***** VERSION IMPRIMABLE **************************************************************/
function printer_friendly() {
  var hauteur=550;
  var largeur=750;
  var top=(screen.height-hauteur)/2;
  var left=(screen.width-largeur)/2;
  window.open(document.location ,"printable","top="+top+",left="+left+",width="+largeur+",height="+hauteur+",toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=0");
}

if (window.name=="printable") {
	document.write("<style>body{background-color:#fff}.printHide{display:none}.printShow{display:block}.show_inline{display:inline}</style>");
}





//POPUP

// Link example:
//<a href="../../scripts/js/my-pop-up-window.htm" onclick="popUp(this.href,'console',600,600,'windowName');return false;" target="_blank">This is my link</a>
var newWin = null;
function popUp(strURL, strType, strHeight, strWidth, strName) {
if (newWin != null && !newWin.closed)
	newWin.close();  
	var strOptions="";
	if (strType=="console")    
	strOptions="resizable,scrollbars,height="+
		strHeight+",width="+strWidth;  
	if (strType=="fixed")
		strOptions="height="+      
			strHeight+",width="+strWidth;  
	if (strType=="elastic")
		strOptions="toolbar,menubar,scrollbars,"+
			"resizable,location,height="+      
			strHeight+",width="+strWidth;
	newWin = window.open(strURL, strName, strOptions);  
	newWin.focus();
}

function openPopupWin(URLtoOpen, windowName, hauteurPopup, largeurPopup, scrollOrNot) { 
  var hauteurPopup;
  var largeurPopup;
  var H = (screen.height - hauteurPopup) / 2;
  var L = (screen.width - largeurPopup) / 2;
  document.open(URLtoOpen,windowName,'height='+hauteurPopup+',width='+largeurPopup+',top='+H+',left='+L+',toolbar=no,scrollbars='+scrollOrNot+',resizable=no');
}


//PAGE MANAGER

function goToNxtPg(frm) {
  if (parseInt(frm.pNL.value)+1 < parseInt(frm.totP.value)) {	
	 frm.pNL.value = parseInt(frm.pNL.value) + 1;
	 frm.PgNo.value = "";
	 frm.submit();
  }
}
function goToPrvPg(frm) {
  if (parseInt(frm.pNL.value)> 0) {
	frm.pNL.value = parseInt(frm.pNL.value) - 1;
	 frm.PgNo.value = "";
    frm.submit();
  }
}
function goToPgX(frm) {
  if (parseInt(frm.PgNo.value) > 0) { 
	if (parseInt(frm.PgNo.value) <= parseInt(frm.totP.value)) {
	  frm.pNL.value = parseInt(frm.PgNo.value) - 1 ;
	  frm.PgNo.value = "";
	  frm.submit();
	}
  }
}


// ...
function search_word(frm) { 
  frm.PgNo.value = "";
  frm.pNL.value = "";
  frm.pMX.value = "";
  frm.pOL.value = "";
  frm.tRL.value = "";
  frm.submit(); 
}
function Confirm_ref( newhref) {
   if (!confirm("<?= confirm_delete ?>")){ 
      this.location = this.location;  
   } else { 
     this.location = newhref ;
   } 
}


//SCREEN
/*
function test_scr(OptW, OptH, mess) {
 if (screen.width < OptW || screen.height < OptH ) alert(mess + " " + screen.width + "x" + screen.height);
}
*/

function do_max(){
window.moveTo(0,0);
window.resizeTo(screen.width,(screen.height-25))
}

/*
do_max();
*/
/*
test_scr('1024','768', 'Site optimised for this screen resolution:');
*/
