//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function show_prop( obj) {
//----------------------------------------------------------
// Fonction permettant l'affichage des propriétés d'un objet en alerte
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
i=0;
st=""
for( o in obj)
{
	st += o+"="+obj[o]+ "\n";
	if ( ++i > 9)
	{
		alert( st);
		i=0;
		st="";
	}
}
if ( st != "") alert( st);

}
                                                            
                                                            
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function swap_image( obj)
//----------------------------------------------------------
// Change l'image lorsque la souris passe sur un bouton image_F.ext <=> image_N.ext
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
{
	src = obj.src;
	ext = src.substring( src.lastIndexOf( ".") + 1);
	img = src.substring( 0, src.lastIndexOf( "_") + 1);
	eta = src.substring( src.lastIndexOf( "_") + 1, src.lastIndexOf( "_") + 2);
	eta = ( eta == "N" ? "F" : "N");
	obj.src = img+eta+"."+ext;
}


//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function str_replace( rech, rempl, str)
//----------------------------------------------------------
// renvoi la chaine 'str' avec les 'rech' remplacé par 'rempl'
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
{
	if ( rech != rempl)
		while( str.indexOf( rech) != -1){
			str1 = str.substring(0, str.indexOf( rech));
			str2 = str.substring( str.indexOf( rech) + rech.length);
			
			str = str1+rempl+str2;
		}
	return str;
}


//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function format_mnt( st)
//----------------------------------------------------------
// Renvoi 'n' formaté comme un montant
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
{
	ret = "";
	if ( !isNaN( st)){
		st = String( st);
		pt	= st.lastIndexOf( ".") + 1;
		st = ( pt ? (st+"00").substring( 0, pt+2) : st+".00");
		lg = 6;
		st2 = "";
		for( i1 = st.length; i1 >= 0; i1--) {
			if ( lg < 0) {
				st2 += " ";
				lg = 2;
			}
			lg--;
			st2 += st.charAt(i1);
		}
		ret = "";
		for( i1 = st2.length; i1 >= 0; i1--)
			ret += st2.charAt(i1);
	}
	return ret; 
}


//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function parse_mnt( st)
//----------------------------------------------------------
// Revoi un float de la valeur de la chaine de char
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
{
	st = str_replace( " ", "", st);
	return parseFloat( st);
}


//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function parse_string( st, sep)
//----------------------------------------------------------
// Renvoi un tableau conteant "st" découpée suivant "sep"
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
{
	val = [];
	i_parse_string = 0;
	
	while( st.indexOf( sep) != -1){
		val[i_parse_string] = st.substring(0, st.indexOf( sep));
		st  = st.substring( st.indexOf( sep) + sep.length)
		i_parse_string++;
	}
	val[i_parse_string] = st;
	
	return val;
}


//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function select_option( mod,opt)
//----------------------------------------------------------
// Sélectionne l'option du T-Shirt
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
{
	o_opt_1 = document.getElementById( "option_"+mod+"_1");
	o_opt_2 = document.getElementById( "option_"+mod+"_2");
	o_opt_3 = document.getElementById( "option_"+mod+"_3");
	o_opt	  = document.getElementById( "option_"+mod+"_"+opt);
	o_img 	= document.getElementById( "img_opt_"+mod);
	o_opt_1.style.display = "none";
	o_opt_2.style.display = "none";
	o_opt_3.style.display = "none";
	o_opt.style.display 	= "";
	o_img.src="images/option_"+opt+".gif";
}


//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function open_popup( fileName)
//----------------------------------------------------------
// Ouvre une fenetre modla contenant le fichier fileName
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
{
	//alert( fileName);
	window.open( fileName, "_blank", "width=800,height=600,toolbar=no,location=no,menubar=no,directories=no,status=no,resizable=yes,scrollbars=yes");
}


//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function open_model( fac, nom)
//----------------------------------------------------------
// Ouvre une fenetre popup contenant le detail du T-Shirt
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
{
	window.open( "skik_detail.popup.php?fac="+fac+"&nom="+nom,"_blank", "width=600,height=600,left=50,top=50,toolbar=no,location=no,menubar=no,directories=no,status=no,resizable=yes,scrollbars=yes");
	//alert( fileName);
}


//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
