
if(OxCompName=="SCCatalog" && OxPageName=="Eboutique Scholl" && OxCatName==""){

var newOption = document.createElement('OPTION');
var firstOption = document.MForm["PDTOPTVALUEID0"].options[0];
document.MForm["PDTOPTVALUEID0"].insertBefore(newOption, firstOption);
var url = window.location.href.split("/");
var page = url.length-1;
if(url[page] != "PBSCProduct.asp") { document.MForm["PDTOPTVALUEID0"].options[0].selected = true; }

document.getElementsByTagName("SELECT")[0].style.display = "none";
document.getElementsByTagName("FONT")[0].innerHTML = "";
document.getElementsByTagName("FONT")[0].className = "";
document.getElementsByTagName("FONT")[0].parentNode.style.paddingTop = "0px";

//alert(window.navigator.userAgent);

function creerTabTailles() {
	


	var tagFont = document.getElementsByTagName("FONT")[0];
	var tagOption = document.getElementsByTagName("OPTION");
	var is_chrome = window.navigator.userAgent.indexOf('Chrome') > -1;
	var is_safari = window.navigator.userAgent.indexOf('Safari') > -1;
	var is_ff4    = window.navigator.userAgent.indexOf('Firefox/4') > -1;
	var is_ff5    = window.navigator.userAgent.indexOf('Firefox/5') > -1;
	var is_ff6    = window.navigator.userAgent.indexOf('Firefox/6') > -1;
	var is_ff7    = window.navigator.userAgent.indexOf('Firefox/7') > -1;
	var is_ff8    = window.navigator.userAgent.indexOf('Firefox/8') > -1;
	var is_ff9    = window.navigator.userAgent.indexOf('Firefox/9') > -1;
	var is_ff10   = window.navigator.userAgent.indexOf('Firefox/10') > -1;
	var is_ff11   = window.navigator.userAgent.indexOf('Firefox/11') > -1;
	var is_ff12   = window.navigator.userAgent.indexOf('Firefox/12') > -1;
	var is_ie = window.navigator.userAgent.toLowerCase().indexOf('msie') > -1;
	
	if(is_chrome == true || is_safari == true || is_ff4 == true || is_ff5 == true || is_ff6 == true || is_ff7 == true || is_ff8 == true || is_ff9 == true || is_ff10 == true || is_ff11 == true || is_ff12 == true){
		tagFont.innerHTML = '<div style="margin-top:10px;float:left;font-size:11px;"><b>Tailles disponibles :</b></div><div style="float:left;"><table cellpadding="0" cellspacing="6" style="font-size:11px;"><tr id="chrome"></tr></table></div>';
	} else {
		if (is_ie == true){ 
			tagFont.innerHTML = '<div style="margin-top:25px;float:left;font-size:11px;"><b>Tailles disponibles :</b></div><div style="float:left;"><table cellpadding="0" cellspacing="5" style="font-size:11px;"><tr>'+ajouterTailles(tagFont, tagOption)+'</tr></table></div>';
		} else {
			tagFont.innerHTML = '<div style="margin-top:10px;float:left;font-size:11px;"><b>Tailles disponibles :</b></div><div style="float:left;"><table cellpadding="0" cellspacing="5" style="font-size:11px;"><tr>'+ajouterTailles(tagFont, tagOption)+'</tr></table></div>';
		}
	}

}

function ajouterTailles(tagFont, tagOption) {
	
	var is_ie = window.navigator.userAgent.toLowerCase().indexOf('msie') > -1;
	if (is_ie == true){ tagFont.innerHTML = '<td>&nbsp;</td>'; } else { tagFont.innerHTML = ''; }
	
	for(i = 0; i < tagOption.length; i++) {
		if (is_ie == true){
		tagFont.innerHTML += '<td width="30" id="celltaille'+i+'" align="center" style="border:1px #666 solid;cursor:pointer;padding:2px;" onclick=document.MForm["PDTOPTVALUEID0"].value='+tagOption[i].value+';OnChangeOption(); onmouseover=over(this); onmouseout=out(this);>'+tagOption[i].innerHTML+'</td>';
		document.getElementById('celltaille0').style.display = "none";
		} else {
		tagFont.innerHTML += '<td id="celltaille'+i+'" align="center" style="border:1px #666 solid;cursor:pointer;padding:5px;" onclick=document.MForm["PDTOPTVALUEID0"].value='+tagOption[i].value+';OnChangeOption(); onmouseover=over(this); onmouseout=out(this);>'+tagOption[i].innerHTML+'</td>';
		document.getElementById('celltaille0').style.display = "none";
		}
	}
	return tagFont.innerHTML; 
}

function changeTDStyle() {
	var option = document.getElementsByTagName("OPTION");
	for(j = 0; j < option.length; j++) {
		if(document.MForm["PDTOPTVALUEID0"].value == option[j].value) { 
		document.getElementById("celltaille"+j).style.backgroundColor="#404040";
		document.getElementById("celltaille"+j).style.color="#FFFFFF";
		document.getElementById("celltaille"+j).style.fontWeight="bold";
		}
	}
}

function over(id) {
		var sel = document.MForm["PDTOPTVALUEID0"];
		var opt = sel.options[sel.selectedIndex];
		if(id.innerHTML != opt.text) {
		id.style.backgroundColor="#404040";
		id.style.color="#FFFFFF";
		id.style.fontWeight="bold";
		}
}

function out(id) {
		var sel = document.MForm["PDTOPTVALUEID0"];
		var opt = sel.options[sel.selectedIndex];
		if(id.innerHTML != opt.text) {
		id.style.backgroundColor="#FFFFFF";
		id.style.color="#000000";
		id.style.fontWeight="normal";
		}
}

function checkPointure() {
		if(document.MForm["PDTOPTVALUEID0"].value == "" || url[page] != "PBSCProduct.asp"){
			alert("Vous devez d'abord choisir une pointure avant d'ajouter ce mod\350le au panier");
			return false;
		}
}

document.getElementById('btnaddtocart').onclick = checkPointure;

creerTabTailles();
changeTDStyle();

}
