/*
	Rollovers functions for the products list
*/
function product_over(aTr){
	aTr.getElementsByTagName("td")[0].getElementsByTagName("a")[0].getElementsByTagName("img")[0].style.borderColor = '#66ccff';
	aTr.getElementsByTagName("td")[1].getElementsByTagName("a")[0].style.color = '#66ccff';
}
function product_out(aTr){
	aTr.getElementsByTagName("td")[0].getElementsByTagName("a")[0].getElementsByTagName("img")[0].style.borderColor = '#d4d8d7';
	aTr.getElementsByTagName("td")[1].getElementsByTagName("a")[0].style.color = '#666666';
}
/*
	Rollovers functions for the cart button
*/
function cart_over(aDiv){
	aDiv.style.backgroundColor = '#66ccff';
	aDiv.getElementsByTagName("a")[0].style.color = '#ffffff';
}
function cart_out(aDiv){
	aDiv.style.backgroundColor = '#ffffff';
	aDiv.getElementsByTagName("a")[0].style.color = '#666666';
}
/*
	Rollovers functions for the cart page
*/
function cart_page_over(aDiv){
	aDiv.style.backgroundColor = '#66ccff';
}
function cart_page_out(aDiv){
	aDiv.style.backgroundColor = '#666666';
}
/*
	Rollovers functions for the cart / checkout breadcrumbs
*/
function cart_steps_over(aHref, aImgNb){
	aHref.getElementsByTagName("span")[0].style.color = '#66ccff';
	aHref.getElementsByTagName("img")[0].src = "/images/"+aImgNb+"_on.gif";
}
function cart_steps_out(aHref, aImgNb){
	aHref.getElementsByTagName("span")[0].style.color = '#666666';
	aHref.getElementsByTagName("img")[0].src = "/images/"+aImgNb+"_lnk.gif";
}
// maxlengh observer for textareas (warranty, contact)
function CheckMaxLength(Object, MaxLen) {
    if(Object.value.length > MaxLen){
          Object.value = Object.value.substring(0, MaxLen);
    }
}



// gestion de l'affichage du tableau [prix + cart][pdf][print]
// en fonction du tab selected
$(document).ready(function(){
	
	$('ul#navbar a').click(function(){
		if (this.id == "tab_link_demo"){ 
			$('#tab-footer').css('display', 'none');
		} else {
			$('#tab-footer').css('display','block');
		}
});

});

function resetFlash(){
	if(visiteFlash==1){
		document.getElementById('xxx').innerHTML = '';
	}
}
function reloadFlash(){
	visiteFlash = 1;
	if(document.getElementById('xxx').innerHTML==''){
		var newURL = location.href;
		if(location.hash!="#tabs-4"){
			newURL = location.href+"#tabs-4";
		}
		location.href = newURL;
		window.location.reload();
	}
}
