// Example:
// var b = new BrowserInfo();
// alert(b.version); 
function BrowserInfo()
{
  this.name = navigator.appName;
  this.codename = navigator.appCodeName;
  this.version = navigator.appVersion.substring(0,4);
  this.platform = navigator.platform;
  this.javaEnabled = navigator.javaEnabled();
  this.screenWidth = screen.width;
  this.screenHeight = screen.height;
}

// * Dependencies * 
// this function requires the following snippets:
// JavaScript/readable_MM_functions/findObj
//
// Accepts a variable number of arguments, in triplets as follows:
// arg 1: simple name of a layer object, such as "Layer1"
// arg 2: ignored (for backward compatibility)
// arg 3: 'hide' or 'show'
// repeat...
//
// Example: showHideLayers(Layer1,'','show',Layer2,'','hide');
function showHideLayers()
{ 
  var i, visStr, obj, args = showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3)
  {
    if ((obj = findObj(args[i])) != null)
    {
      visStr = args[i+2];
      if (obj.style)
      {
        obj = obj.style;
        if(visStr == 'show') visStr = 'visible';
        else if(visStr == 'hide') visStr = 'hidden';
      }
      obj.visibility = visStr;
    }
  }
}

// Example: obj = findObj("image1");
function findObj(theObj, theDoc)
{
  var p, i, foundObj;
  
  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  {
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++) 
    foundObj = theDoc.forms[i][theObj];
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
    foundObj = findObj(theObj,theDoc.layers[i].document);
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  
  return foundObj;
}
// JavaScript Document
<!--
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}


function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->  ouverture popup
function MM_openBrWindow(theURL,winName,features) { //v2.0
popup=window.open(theURL,winName,features);
popup.focus();
}
<!--
function PopupPoster(theURL,winName)
{
	popup=window.open(theURL,winName,"width=510,height=603,left=700,top=300,screenX=0,screenY=0,scrollbars=no,resizable=yes,location=no,directories=no")
	popup.focus();
}
function PopupPetite(theURL,winName)
{
	popup=window.open(theURL,winName,"width=700,height=300,left=700,top=300,screenX=0,screenY=0,scrollbars=no,resizable=yes,location=no,directories=no")
	popup.focus();
}
function PopupMoyenne(theURL,winName)
{
	popup=window.open(theURL,winName,"width=850,height=600,left=700,top=200,screenX=0,screenY=0,scrollbars=yes,resizable=yes,location=no,directories=no")
	popup.focus();
}
function PopupGrande(theURL,winName)
{
	popup=window.open(theURL,winName,"width=650,height=750,left=700,top=200,screenX=0,screenY=0,scrollbars=yes,resizable=yes,location=no,directories=no")
}
function PopupExterne(theURL,winName)
{popup=window.open(theURL,winName,"width=650,height=750,left=700,top=200,screenX=0,screenY=0,scrollbars=no,resizable=yes,location=no,directories=yes")
popup.focus();
}
function temporisateur(seconde,fonction) {
setTimeout(fonction,seconde*8000);
}
function FermerFenetre(NomFenetre){
if (NomFenetre.document) {  NomFenetre.close(); }
}

function FermerRetourOpener(URL)
{
	opener.location.replace(URL);
	window.close();
//	opener.location.refresh();
}
//-->;
<!-- Empeche la sélection de l'image - script trouvé sur phortail.org
function roadster(evt) 
{
 if (navigator.appName != 'Microsoft Internet Explorer')
 {
   if (evt.which != 3) 
     return true;
 };
 return false;
}
function trap() 
{
 if(document.images)
 {
   if(navigator.appName != 'Microsoft Internet Explorer')
   {
     for(i=0;i<document.images.length;i++)
       document.images[i].onmousedown = roadster;
   }
   else
   {
     for(i=0;i<document.images.length;i++)
       document.images[i].oncontextmenu = roadster;
   }
 }
}

function retourCaddie(nref,ncat)
{
var urlPage;
urlPage=document.location.href;
//alert("urlPage = " +urlPage);
var urlDecoupe=urlPage.split("/");
for (i=0;i<urlDecoupe.length;i++)
	{ if (urlDecoupe[i].indexOf(".")>0)
		{ //alert("page = " + urlDecoupe[i]);
	 		pageDecoupe = urlDecoupe[i].split(".");
	 		nomPage = pageDecoupe[0];
	 	//	alert("nom page = " + nomPage);
		}
	}
// activation/désactivation des onglets
//alert("nom page = " + nomPage);

	switch(nomPage) {
	
		case "chercher-liste":
			window.location = "caddie-add.asp?numref="+nref+"&nomcat="+ncat;
			break;
		case "produits-detail":
			FermerRetourOpener("caddie-add.asp?numref="+nref+"&nomcat="+ncat);
			break;
		case "pc-preced":
			window.location = "caddie-add.asp?numref="+nref+"&nomcat="+ncat;
			break;
		default:
		 window.location = "caddie-add.asp?numref="+nref+"&nomcat="+ncat;
	
	}
}


// End -->


