﻿// variable gbolal produit

var produit;

var uriBase = document.getElementById('urlIdentifier').content;

function is_all_ws( nod ){
  return !(/[^\t\n\r ]/.test(nod.data));
}

function enfants(nod){
	r=new Array();
	c=nod.childNodes;
	for(i=0; i<c.length; i++){
		if(!is_all_ws(c[i])){
			r.push(c[i]);
		}
	}
	return r;
}

function precedent(nod){
	p=nod.previousSibling;
	while((p!=null)&&((p.tagName==null)||(is_all_ws(p)))){
		//alert((p!=null)+" "+(p.tagName==null)+" "+(is_all_ws(p)));
		p=p.previousSibling;
	}
	return p;
}


function getStyles(){
	styles=Array();
	for(i=0; i< document.styleSheets[0].cssRules.length; i++){
		c=document.styleSheets[0].cssRules[i].cssText.match(/#content \.(\w)+/);
		if (c!=null){
			styles.push(c[0].substring(10));
		}
	}
	return styles;
}

/*
function news_popup(id_news,w,h){
	
url = './news.php?id_news='+id_news;

var winl = (screen.width)/4;
var wint = (screen.height)/2;

Fenetre=window.open(url,'Fenetre', 
'top='+wint+',left='+winl+',scrollbars=yes,toolbar=no,location=no,resizable=yes,directories=no,status=no,menubar=no,copyhistory=no,width='+w+',height='+h);
if (parseInt(navigator.appVersion) >= 4) {
	Fenetre.window.focus(); 
	}

}

function newsletter_popup(id_langue,w,h){
	
url = './newsletter.php?id_langue='+id_langue;

var winl = (screen.width)/4;
var wint = (screen.height)/2;

Fenetre=window.open(url,'Fenetre', 
'top='+wint+',left='+winl+',scrollbars=yes,toolbar=no,location=no,resizable=yes,directories=no,status=no,menubar=no,copyhistory=no,width='+w+',height='+h);
if (parseInt(navigator.appVersion) >= 4) {
	Fenetre.window.focus(); 
	}

}
*/

function sCSR (t) { 	
	//$('indR').style.display = 'none';
}

function eCSR (t) { 
	//$('indR').style.display = 'none';
}

function chargerRegionsFormulaire(id_pays){
	
	new Ajax.Updater('region', 
	uriBase+'/chargerRegionsFormulaire.php', 
	{ method : 'post', asynchronous : true, parameters : "id_pays="+id_pays, onSuccess : sCSR, onFailure : eCSR }
	);
	

}


function chargerVillesFormulaire(id_pays,id_region){
	
	new Ajax.Updater('ville', 
	uriBase+'/chargerVillesFormulaire.php', 
	{ method : 'post', asynchronous : true, parameters : "id_pays="+id_pays+'&id_region='+ id_region, onSuccess : sCSR, onFailure : eCSR }
	);
	
		
}

/*
function chargerRegionsList(id_pays){
	
	new Ajax.Updater('region', 
	uriBase+'/chargerRegionsList.php', 
	{ method : 'post', asynchronous : true, parameters : 'id_pays='+id_pays, onSuccess : sCSR, onFailure : eCSR }
	);

	document.forms['frm_affinage_pays'].id_pays.value = id_pays;
	document.forms['frm_affinage_pays'].submit();
	
}

function chargerVillesList(id_pays,id_region){
	
	new Ajax.Updater('ville', 
	uriBase+'/chargerVillesList.php', 
	{ method : 'post', asynchronous : true, parameters : "id_pays="+id_pays+'&id_region='+ id_region, onSuccess : sCSR, onFailure : eCSR }
	);
	

}

*/
function popup(url,w,h){
	
var winl = (screen.width)/4;
var wint = (screen.height)/2;

Fenetre=window.open(url,'Fenetre', 
'top='+wint+',left='+winl+',scrollbars=yes,toolbar=no,location=no,resizable=yes,directories=no,status=no,menubar=no,copyhistory=no,width='+w+',height='+h);
if (parseInt(navigator.appVersion) >= 4) {
	Fenetre.window.focus(); 
	}

}









