// **************************************************************
// Classes / Objets
// **************************************************************
function lib_bwcheck(){ //Browsercheck (needed)
	this.ver=navigator.appVersion
	this.agent=navigator.userAgent
	this.dom=document.getElementById?1:0
	this.opera5=this.agent.indexOf("Opera 5")>-1
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6
	this.mac=this.agent.indexOf("Mac")>-1
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
	return this
}

// **************************************************************
// Initialisation sur chaque page de la version du browser
// **************************************************************
var bw=new lib_bwcheck()

// **************************************************************
// Fonction pour imprimer
// **************************************************************
function Imprimer() {
	if (bw.ie4) {
		var WebBrowser = '<OBJECT ID="wbp" WIDTH="0" HEIGHT="0" CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
		document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
		document.all.wbp.ExecWB(6, 2);
	} else {
		window.print();
	}
}

// **************************************************************
// Méthodes pour ouvrir des popups
// **************************************************************
function popdescprod(strprod, strclasse) {
	var strurl = 'descproduit.asp?prod='+strprod+'&class='+strclasse
	var fenprod = window.open(strurl,'Produit','width=598,height=400,resizable,scrollbars');
	fenprod.moveTo((screen.availWidth-598)/2, (screen.availHeight-400)/2);
	fenprod.focus(); 
}

function popmesureprod(strtab) {
	if (strtab!="") {
		var strurl = 'tableau-mensur-'+strtab+'.asp';
	} else {
		var strurl = 'tableau-mensur.asp';
	}
	
	var fenprod = window.open(strurl,'MensurationsProduit','width=650,height=350,resizable=no,scrollbars=yes');
	fenprod.moveTo((screen.availWidth-650)/2, (screen.availHeight-350)/2);
	fenprod.focus(); 
}

function popmesureillustr() {
	var strurl = 'illustr-mensur.asp'
	var fenprod = window.open(strurl,'MensurationsProduit','width=578,height=410,resizable=no,scrollbars=no');
	fenprod.moveTo((screen.availWidth-578)/2, (screen.availHeight-410)/2);
	fenprod.focus(); 
}

function popaita() {
	var fenaita = window.open('http://www.a2icom.fr', 'winpib', 'height=500,width=800,resizable,scrollbars')
}