// JavaScript Document
// OBJ

function getOb(ob) { return (document.all)?eval('document.all.'+ob):(document.getElementById)?eval('document.getElementById("'+ob+'")'):null }
function getHt(ob) { return ob.offsetHeight }
function getLg(ob) { return ob.offsetWidth }
function show(ob) { ob.style.visibility = "visible" }
function hide(ob) { ob.style.visibility = "hidden" }
function enx(ob,px) { if (document.all) ob.style.pixelLeft = px; else ob.style.left = px }
function eny(ob,px) {if (document.all) {ob.style.pixelTop = px} else {ob.style.top = px; } }
function getx(ob) { return (document.all)?ob.style.pixelLeft:parseInt(ob.style.left) }
function gety(ob) { return (document.all)?ob.style.pixelTop:parseInt(ob.style.top) }
function laht(ob,px) { ob.style.height = px }
function lalg(ob,px) { ob.style.width = px }
function clp(ob,htm,lgd,htp,lgg) { ob.style.clip = eval("'rect("+htm+"px, "+lgd+"px, "+htp+"px, "+lgg+"px)'");}
function prop(binf,ind,bsup,min,max) { return parseInt((ind*(max-min)/(bsup-binf))+min) }
function inner(idob,contenu){getOb(idob).innerHTML=contenu;}
// IMG
function swimg(im, sc) { eval( 'document.'+im+'.src = "'+sc+'"' ) }
function iht(im,px) { eval('document.'+im+'.style.height = '+px) }
function ilg(im,px) { eval('document.'+im+'.style.width = '+px) }

/*--------------------------- /commande --------------------------------------*/

nb_article_commande = 0;

//conserve la valeur du nombre de commande
function conserveValeurCommande(ob)
{
		ob.select();
		nb_article_commande = ob.value;
}

//permet de vérifier si le valeur du champ est un nombre entre 0 et 99
function retourneValeurCommande(ob,nb_qte)
{
	if (nb_qte==2){chiffre=99}else{chiffre=999}
	if(!(ob.value>0 && ob.value<=chiffre)){ob.value=nb_article_commande}
	if(ob.value>0 && ob.value<=9 && ob.value.length==nb_qte){ob.value=(ob.value).substring(1,nb_qte)}
}

/*print*/
function onclickprint(rubrique)
{
 var page = '/public/carla/html/fr/transversal/print_'+rubrique+'.php'
 var height = screen.height-100+'px';
 var width = screen.width-20+'px';
 fenetre_print=window.open(page,'print','height='+height+',width='+width+',left=0,top=0,toolbar=no,directories=0,status=0,menubar=0,scrollbars=1,resize=0,resizable=0')
}

/*--------------------------- /commande --------------------------------------*/


/* roll over */
chemin_tt_footer = 'modele/fr/tt_footer/';

function chang_src(obj,chemin,source) {
// indiquez l'emplacement des images a appeler
rep = '/public/carla/html/toolkit/img/';
obj.src = rep + chemin + source;
}

/* popup infoslegales */

function infoslegales() {
window.open('/public/carla/html/fr/transversal/infoslegales.php','infoslegales','width=490,height=370,scrollbars=yes');
}

function popup(url)
{
	var height = 300;
 	var width = 400;
	var top = (screen.height - height-50)/2;
	var left = (screen.width - width)/2;
 	fenetre_print=window.open(url,'','height='+height+'px,width='+width+'px,left='+left+'px,top='+top+'px,toolbar=no,directories=0,status=0,menubar=0,scrollbars=0,resize=0,resizable=0')
	fenetre_print.focus();
}

function popup_pharmacie(url)
{
	var height = 370;
 	var width = 490;
	var top = (screen.height - height-50)/2;
	var left = (screen.width - width)/2;
 	fenetre_print=window.open(url,'pharmacies','height='+height+'px,width='+width+'px,left='+left+'px,top='+top+'px,toolbar=no,directories=0,status=0,menubar=0,scrollbars=1,resize=0,resizable=0')
	fenetre_print.focus();
}
