function CheckForm () {
	if (document.frmSiteSearch.search.value==""){
		alert("Aucune saisie !");
		document.frmSiteSearch.search.focus();
		return false;
	}
	return true
}

function envoi_form()
{
	//if ( document.form1.search.value == '' || document.form1.search.value == null )
	//{
	//	alert("The following error(s) occurred:\nThe search value is required");
	//	return false;
	//}
	if (document.formSearch.search.value==""){
	alert("Aucune saisie !");
	document.formSearch.search.focus();
	//return false;
	}
	//return true
	else
	document.formSearch.submit();	
}

function getObj(name){
  if (document.getElementById){
  	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all){
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
}
function getTop(objectId){
	var x = (new getObj(objectId)).obj;
	xTop = x.offsetTop;
	while(x.offsetParent!=null) {
		xParent = x.offsetParent;
		xTop += xParent.offsetTop;
		x = xParent;
	}
	return xTop;
}
function getAbsoluteTop(objectId){
	var x = objectId;
	xTop = x.offsetTop;
	while(x.offsetParent!=null) {
		xParent = x.offsetParent;
		xTop += xParent.offsetTop;
		x = xParent;
	}
	return xTop;
}
function getAbsoluteLeft(objectId){
	var x = objectId;
	xLeft = x.offsetLeft;
	while(x.offsetParent!=null){
		xParent = x.offsetParent;
		xLeft += xParent.offsetLeft;
		x = xParent;
	}
	return xLeft;
}
function getWidth(objectId){
	var x = (new getObj(objectId)).obj;
	return x.offsetWidth;
}

function getHeight(objectId){
	var x = (new getObj(objectId)).obj;
	return x.offsetHeight;
}
function openPop(f,l,h,op)
{
	longueur=l;
	hauteur=h;
	haut = screen.height/2 - hauteur/2;
	dim = screen.width/2 - longueur/2;
	window.open(f,'','width='+longueur+',height='+hauteur+',left='+dim+',top='+haut+',resizable=no,'+op+'');
}

function swapImgin(obj){
	var ch=""+obj.src;
	var finfin=ch.substring(ch.length-3,ch.length);
	var fin=ch.substring(ch.length-5,ch.length-4);
	ch=ch.substring(0,ch.length-5);
	if(fin == "0")
	   obj.src=ch+"1."+finfin;
	else
	   obj.src=ch+"0."+finfin;
}
function changeSelect(obj){
	document.location.href=obj.options[obj.selectedIndex].value;
}

function envoyer_ami() {
 var url = document.location;
 location.href = "mailto:?subject=Un ami vous recommande cette page du site www.materis-peintures.fr&body=Bonjour,%0a%0aCette page est intéressante : "+url+"%0a%0aBonne journée !"
}

function openFicheFDS(fiche) {
	window.open(fiche,"fiche","width=700,height=550,scrollbars=auto");
}
