// JavaScript Document
var titrepardef = "sappro.ch"; //SI aucun titre n'est spécifié
var fenetre;
var cont=0;

function agImg(img,titre)
{
if(cont==1){fenetre.close();fenetre=null}
if(titre==null){titre=titrepardef}
fenetre=window.open('','fenetre','resizable=no,scrollbars=no,width=640,height=480,') 
fenetre.document.write('<html><head><title>' + titre + '</title><meta http-equiv="imagetoolbar" content="no"></head><body onclick="window.close()" style="overflow:hidden" marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" scroll="no" onUnload="opener.cont=0" ><img src="' + img + '" onLoad="opener.redimensioner(this.width, this.height)">');
fenetre.document.close();
cont++;
}
function redimensioner(longueur, hauteur)
{
fenetre.resizeTo(longueur,hauteur+30); // 10x50 con resizable=yes
// fenetre.moveTo((screen.width-longueur)/2,(screen.height-hauteur)/2); 
}


function popupcentree(page,largeur,hauteur,options)
{
	var top=(((screen.height-hauteur)/2)+16);     var left=(((screen.width-largeur)/2)-12);
	window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
}

function popupFlash(url, nom, largeur, hauteur, autreparam) 
{
  monPopup=window.open(url, nom, autreparam);
  monPopup.resizeTo( largeur, hauteur );
  monPopup.focus();
}

function home_Page()
	{
	if (document.all && document.getElementById)
		{
		document.write('<A HREF="#" onClick="HomePage(this);return(false);"></A><BR>');
		}
	}
function HomePage(obj)
	{
	obj.style.behavior='url(#default#homepage)';
	obj.setHomePage('http://www.sappro.ch');
	}
	
		
function popupFlashPdf(url, nom, largeur, hauteur) 
{
  monPopup=window.open(url, nom, conf='toolbar=0, scrollbars=0, location=0, statusbar=0, menubar=0, resizable=0');
  monPopup.resizeTo( largeur, hauteur );
  monPopup.focus();
}

function openDetail(url) {
  var oWindow = window.open(url, "detail", "width=600,height=500,top=20,left=20,scrollbars=yes");
}

function openDetail2(url) {
  var oWindow = window.open(url, "detail", "width=400,height=500,scrollbars=yes");
}

// -- Vide le champ
function clearText(thefield){
	if (thefield.defaultValue == thefield.value)
	thefield.value = "";
	}

// -- Réinitialise le champ si vide
function initText(thefield){
	if (thefield.value == "" || thefield.value == " ")
	thefield.value = thefield.defaultValue;
	}