//var serverName = "";
//searchServerName();

if ((location.href.indexOf("ccpb17.org") != -1)||(location.href.indexOf("81.1.45.81") != -1)) {    
	document.writeln("<script language='JavaScript' src='/script/public_org.js'></script>");
} else if ((location.href.indexOf("ccpb17.com.fr") != -1)||(location.href.indexOf("81.1.46.85") != -1)) {    
	document.writeln("<script language='JavaScript' src='/script/public_comfr.js'></script>");
} else if ((location.href.indexOf("webdev") != -1)||(location.href.indexOf("10.0.1.5") != -1)) {

	document.writeln("<script language='JavaScript' src='/script/public_dev.js'></script>");
} else {    
	document.writeln("<script language='JavaScript' src='/script/public_local.js'></script>");
}

// click droit inoperant
document.oncontextmenu = new Function("return false");


// Add by Y.LAFARGE (UNILOG) : fonction qui permet d'obtenir le nom du serveur
function searchServerName()
{
  protocolString = "http://";
  url = top.location.href;
  index_debut = protocolString.length;
  index_fin = url.lastIndexOf("/");
 
  for (var i = index_debut; i < index_fin; i++)
  {    
    serverName = serverName + url.charAt(i);
  }
}

function go_home()
{
  url_home = "http://" + window.location.host;
  window.location = url_home;
  //window.location.reload();
}

//#deb# PJH 19/09/07 - SAL - Ajout du parametre sConnect
function espres(sConnect)
{
  if (sConnect=="SAL")
  {
    popup = window.open('https://' + window.location.host + '/espres/','espresal','height='+window.screen.availHeight+', width='+(window.screen.availWidth-10)+', directory=0,status=1,scrollbars=1,toolbar=0,location=0,menubar=0,top=0,left=0,screenX=0,screenY=0,resizable=1');
  }else if (sConnect=="ORGA") 
  {
      popup = window.open('https://' + window.location.host + '/espres/','espreorga','height='+window.screen.availHeight+', width='+(window.screen.availWidth-10)+', directory=0,status=1,scrollbars=1,toolbar=0,location=0,menubar=0,top=0,left=0,screenX=0,screenY=0,resizable=1');
  }else
  {
    popup = window.open('https://' + window.location.host + '/espres/','espres','height='+window.screen.availHeight+', width='+(window.screen.availWidth-10)+',directory=0,status=1,scrollbars=1,toolbar=0,location=0,menubar=0,top=0,left=0,screenX=0,screenY=0,resizable=1');
  }
}  
//#fin# PJH 19/09/07 - SAL -

function adhesion() 
{
  popup = window.open('https://' + window.location.host + '/servlet/fr.ccpb17.enet.free.adhesion.FormJurServlet','espres','directory=0,status=1,scrollbars=1,toolbar=0,location=0,menubar=0,top=0,left=0,screenX=0,screenY=0,resizable=1');
}

function envoi_message()
{  
  window.location = "https://" + window.location.host + "/public/mailer/premailer.jsp";
}

// Add by Y.LAFARGE (UNILOG) : fonction permettant de faire clignoter du texte
function clignotement(message)
{ 	
	if (document.getElementById(message).style.visibility=="visible") 
		document.getElementById(message).style.visibility="hidden";	 
	else 
		document.getElementById(message).style.visibility="visible"; 	
}

// Add by Y.LAFARGE (UNILOG) : Fonction permettant d'ouvrir un document PDF
function ouvrir_document_pdf(url)
{
  // on ouvre une fenetre en le nommant 'open_document'
  popup = window.open(url,'open_document','');                      
}
