// ****************************************************************
// **** Gestion des DIV compatible Netscape/ Internet Explorer ****
// ****************************************************************

function afficheDiv(nomDiv)
{
	if (document.layers) 
	{
		//  Navigator 4.x code 
		myDiv = document.layers[nomDiv];	 
		myDiv.visibility = 'show';
	}
	else if (document.getElementById && document.body.style) 
   	{
		// Autre version + IE
		myDiv = document.getElementById(nomDiv);
		myDiv.style.display = '';
	}

	
}

function cacheDiv(nomDiv)
{
	if (document.layers) 
	{
		// Navigator 4.x code 
		document.layers[nomDiv].visibility = 'hide';
	}
	else if (document.getElementById && document.body.style) 
	{
		// Autre version + IE
		document.getElementById(nomDiv).style.display = 'none';
	}
	
}

function divEstVisible(nomDiv)
{
	if (document.layers) 
	{
		// Navigator 4.x code 
		return (document.layers[nomDiv].visibility == 'show');
	}
	else if (document.getElementById && document.body.style) 
	{
		// Autre version + IE
		return (document.getElementById(nomDiv).style.display == '');
	}
	return false;
}

function divEstCachee(nomDiv)
{
	if (document.layers) 
	{
		// Navigator 4.x code 
		return (document.layers[nomDiv].visibility == 'hide');
	}
	else if (document.getElementById && document.body.style) 
	{
		// Autre version + IE
		return (document.getElementById(nomDiv).style.display == 'none');
	}
	return false;
}

function changeImage(conteneurImg,newImg)
{
	if (document.layers) 
	{
		// Navigator 4.x code 
		document.layers[conteneurImg].src = newImg;
	}
	else if (document.getElementById && document.body.style) 
	{
		// Autre version + IE
		document.getElementById(conteneurImg).src = newImg;
	}
	
}

function changeLien(conteneurLien,newLien)
{
	if (document.layers) 
	{
		// Navigator 4.x code 
		document.layers[conteneurLien].href = newLien;
	}
	else if (document.getElementById && document.body.style) 
	{
		// Autre version + IE
		document.getElementById(conteneurLien).href = newLien;
	}
	
}

function changeValue(input,newValue)
{
	if (document.layers) 
	{
		// Navigator 4.x code 
		document.layers[input].value = newValue;
	}
	else if (document.getElementById && document.body.style) 
	{
		// Autre version + IE
		document.getElementById(input).value = newValue;
	}
	
}

function decore()
{
	var elements = $$('.image_presentation');
	for(i=0;i<elements.length;i++)
	{
		var element=elements[i];
		var td = element.wrap('td');
		td.addClassName('coeur');
		var tr= td.wrap('tr');
		td.insert({before : '<td class="bord_gauche"></td>'});
		td.insert({after : '<td class="bord_droit"></td>'});
		var tbody = tr.wrap('tbody');
		tbody.addClassName('tbody_cadre');
		var tab=tbody.wrap('table');
		tab.addClassName('table_cadre');
		
		tr.insert({before : '<tr><td class="coin_haut_gauche"></td><td class="bord_haut"></td><td class="coin_haut_droit"></td></tr>'});
		tr.insert({after : '<tr><td class="coin_bas_gauche"></td><td class="bord_bas"></td><td class="coin_bas_droit"></td></tr>'});
	}
}

function cacheDivCommencantPar(baseNom)
{
	var elements = $$("div");
	for(i=0;i<elements.length;i++)
	{
		nomDiv=elements[i].id;
		if(nomDiv.startsWith(baseNom))
			cacheDiv(nomDiv);
	}
}

function boutonRadioSelected(zoneRadio,message)
{
	for(i = 0; i < zoneRadio.length; i++)
	{
		if(zoneRadio[i].checked) 
			return true;
	}
	alert(message);
	return false;
}


function OuvrirPopup(page,nom,option) 
{
      window.open(page,nom,option);
}

function ChampNonVide(inputText,message)
{
	if(inputText.value=="")
	{
		alert(message);
		return false;
	}
	return true;
}

function checkEmail(inputText,message){
	if(inputText.value!="")
	{
		if(inputText.value.indexOf("@")<0)
		{
			alert(message);
			return false;
		}
		if(inputText.value.indexOf("@")==0)
		{
			alert(message);
			return false;
		}
		if(inputText.value.indexOf("@")!=inputText.value.lastIndexOf("@"))
		{
			alert(message);
			return false;
		}
		if(inputText.value.lastIndexOf(".")<inputText.value.indexOf("@"))
		{
			alert(message);
			return false;
		}
		
		if(inputText.value.indexOf(" ")>=0)
		{
			alert(message);
			return false;
		}
	}
	else
	{
		alert(message);
		return false;
	}
	return true;
}

function submitIfOk(formulaire,conditions)
{
	if(conditions)
		document.forms[formulaire].submit();
}
function EJEJC_lc(th) { return false; }

function EJEJC_config() {
EJEJC_INITCSS = false; EJEJC_POSTCALL=true;
EJEJC_OPACITY = 60; 
EJEJC_BRDRCOLOR = "#fd5c01";
EJEJC_CPOP = false; 
}

function EJEJC_shown() {
jQuery("#imgHeader").attr("src", "http://www.bundeskanzler09.de/img/banniere_buy_e-junkie_bk.jpg");
jQuery("#btnPP").attr("src", "http://www.bundeskanzler09.de/img/checkout_ej_de.jpg");

jQuery("#country1").attr("innerHTML", "Land");
jQuery("#state1").attr("innerHTML", "PLZ");
jQuery("#state2").attr("innerHTML", "(Aktualisieren)");
jQuery("#dscnt_cd").attr("innerHTML", " Rabatt Code");
jQuery("#discount2").attr("innerHTML", "(Update Cart after entering)");
jQuery("#btnContShop").attr("value", "Weiter Einkaufen");
jQuery("#btnUpdtCart").attr("value", "Aktualisieren");
jQuery("#tdPmnt").attr("innerHTML", "<b>Zum Ausgang:</b>");
jQuery("#EJEJC_closeWindowButton").attr("innerHTML", "<b>Schliessen</b>");

}


