function toggleLayer(whichLayer, view)
{
	//visible
	//
	// this is the way nn4 works
	var styleObject = getStyleObject(whichLayer);
	if(styleObject) {
		styleObject.visibility = view;
		//return true;
	} else {
		// we couldn't find the object, so we can't change its visibility
		//return false;
	}
}

function getStyleObject(objectId) {
    // cross-browser function to get an object's style object given its id
    if(document.getElementById && document.getElementById(objectId)) {
		// W3C DOM
		return document.getElementById(objectId).style;
    } else if (document.all && document.all(objectId)) {
		// MSIE 4 DOM
		return document.all(objectId).style;
    } else if (document.layers && document.layers[objectId]) {
		// NN 4 DOM.. note: this won't find nested layers
		return document.layers[objectId];
    } else {
		return false;
    }
} // getStyleObject

function validate()
{
	var doc;
	if (document.layers && document.layers['commentform'])
	{
		doc=document.layers['commentform'].document;
    } else {
		doc=document;
    }
	if (document.entryform.radiolivraison[0].checked==true)
	{
		document.entryform.client2.value = document.entryform.client1.value;
		document.entryform.email2.value = document.entryform.email1.value;
		document.entryform.contact2.value = document.entryform.contact1.value;
		document.entryform.adresse2.value = document.entryform.adresse1.value;
		document.entryform.code_postal2.value = document.entryform.code_postal1.value;
		document.entryform.ville2.value = document.entryform.ville1.value;
		document.entryform.pays2.value = document.entryform.pays1.value;
	}
	else
	{
		document.entryform.client2.value = doc.entryform1.client2.value;
		document.entryform.email2.value = doc.entryform1.email2.value;
		document.entryform.contact2.value = doc.entryform1.contact2.value;
		document.entryform.adresse2.value = doc.entryform1.adresse2.value;
		document.entryform.code_postal2.value = doc.entryform1.code_postal2.value;
		document.entryform.ville2.value = doc.entryform1.ville2.value;
		document.entryform.pays2.value = doc.entryform1.pays2.value;
	}
	document.entryform.submit();
	//alert (document.entryform.client2.value)
}

function switch_product_images(new_main, new_main_zoom, vignette_id){
    var current_main = document.getElementById('mainProductImage').src;
    var current_main_zoom = document.getElementById('zoom1').href;
    document.getElementById(vignette_id).innerHTML = '<a href="javascript:switch_product_images(\''+current_main+'\', \''+current_main_zoom+'\', \''+vignette_id+'\')"><img src="'+current_main+'" name="'+vignette_id+'" width="100" border="0" /></a>';
    document.getElementById('mainProductImage').src = new_main;
    document.getElementById('zoom1').href = new_main_zoom;
}
