var URLBalise = 'http://balise.oxylane.com/';
var URLB2C = 'http://www.oxylaneclub.com/';
var URLBaliseStatique = 'http://balise.oxylane.com/';
var nbBlocOffre = 10;
var indefini;

/*Pour corriger l'erreur du code de la sélection dans l'intégration LBU*/
if(TypeAppel == indefini) var TypeAppel = oxy_TypeAppel;
if(idPartenaire == indefini) var idPartenaire = oxy_idPartenaire;
if(oxy_CodeHtmlOnglet == indefini) var oxy_CodeHtmlOnglet = '';
if(oxy_HauteurDisponible == indefini) var oxy_HauteurDisponible = '400';
if(oxy_LargeurDisponible == indefini) var oxy_LargeurDisponible = '250';
if(oxy_IdUnivers == indefini) var oxy_IdUnivers = '';
if(oxy_IdRayon == indefini) var oxy_IdRayon = '';
if(oxy_IdSousRayon == indefini) var oxy_IdSousRayon = '';
if(oxy_IdFamille == indefini) var oxy_IdFamille = '';
if(oxyCodeProduit == indefini) var oxyCodeProduit = '';
if(oxyIsClub == indefini) var oxyIsClub = '0';
if(isOxyCallWithSwitch==indefini) var isOxyCallWithSwitch='false';
/*fin correction*/

if( TypeAppel != -1 )
{
	document.write('<style type="text/css"><!--');
	document.write('#oxylaneServices {position: relative;z-index:1;width:100%;height:100%;margin:0px 0px 0px 0px;padding:10px 0px 0px 0px;display:none;}');
	document.write('img.png{behavior: url('+URLBalise+'/Charte/png.htc);}');
	document.write('--></style>');	
}
if(TypeAppel!=2)
{
	var fPage = null;
}
if(TypeAppel==0) {
	try {
		fPage=window.parent.document.location.href;
		fPage=escape(fPage);
	} catch (ex) {
		fPage=window.document.location.href;
		fPage=escape(fPage);
	}
}
if(TypeAppel==2)
{
	if(oxy_idPartenaire==347)
		fPage = fPage.replace(/&amp;/g,'&');		
	fPage=escape(fPage);
}

function oxy_AfficherServices() {
	//Est-ce que ce n'est pas la première fois que l'on charge
	if (! (document.getElementById("oxylaneServices").innerHTML != null && document.getElementById("oxylaneServices").innerHTML.length > 0)) {
		document.getElementById("oxylaneServices").innerHTML = '<div style="position:relative;z-index:5000;width:'+oxy_LargeurDisponible+'px;height:'+oxy_HauteurDisponible+'px;border:#000000 0px solid;"><iframe id="oxyIframeServices" name="oxyIframeServices" ALLOWTRANSPARENCY="true" src="'+URLBalise+'Services.aspx?hauteur='+oxy_HauteurDisponible+'&largeur='+oxy_LargeurDisponible+'&bloc='+nbBlocOffre+'&fPage='+fPage+'&idPartenaire='+idPartenaire+'&CodeProduit='+oxyCodeProduit+'&idUnivers='+oxy_IdUnivers+'&idRayon='+oxy_IdRayon+'&idSousRayon='+oxy_IdSousRayon+'&idFamille='+oxy_IdFamille+'&isClubMarque='+oxyIsClub+'" width="'+oxy_LargeurDisponible+'" height="'+oxy_HauteurDisponible+'" valign="top" align="top" Frameborder="0" Scrolling="no" framespacing="0" marginheight="0" border="0" marginwidth="0" HSPACE="0" vspace="0"></iframe></div>';
	}
}
function RemplirOnglet()
{
	if(! (document.getElementById("ongletOxylaneService").innerHTML != null && document.getElementById("ongletOxylaneService").innerHTML.length > 0))
	{
		if(oxyCodeProduit.length > 0 && oxyCodeProduit.indexOf('_')<0)
			oxyCodeProduit = '27_' + oxyCodeProduit;
		if(oxy_CodeHtmlOnglet.length > 0)
		{
			oxy_CodeHtmlOnglet = oxy_CodeHtmlOnglet.replace(/#oxyTexteOnglet#/g,'<div style="position:relative;width:0px;border:#000000 0px solid;"><div style="position:absolute;top:5px;left:-5px;width:22px;height:16px;"><img src="'+URLBalise+'Charte/images/Onglet/xypoinconpetit.png" width="22" height="16" style="width:22px;height:16px;" border="0"></div></div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Les + sportifs&nbsp;');
			oxy_CodeHtmlOnglet = oxy_CodeHtmlOnglet.replace(/#FonctionOxylane#/g,'oxy_AfficherServices();');
			document.getElementById("ongletOxylaneService").innerHTML = oxy_CodeHtmlOnglet;
		}
		else
			document.getElementById("ongletOxylaneService").innerHTML = '<A title="Tout pour votre sport" alt="Tout pour votre sport" onClick="javascript:oxy_AfficherServices();" href="javascript:;"><div style="position:relative;width:0px;border:#000000 0px solid;"><div style="position:absolute;top:5px;left:-5px;width:22px;height:16px;"><img src="'+URLBalise+'/Charte/images/Onglet/xypoinconpetit.png" width="22" height="16" style="width:22px;height:16px;" border="0"></div></div>Les + sportifs</a>';
		CorrectPNGOxylaneService();
	}	
}
if(isOxyCallWithSwitch=='false')
{
	loadOxylaneServices(true)
}
function loadOxylaneServices(isAffiche)
{
	if(isAffiche)
	{	
		if(document.getElementById('ongletOxylaneService') && document.getElementById('oxylaneServices'))
		{
			RemplirOnglet();	
		}
	}
}
//Corrige la transparence des png sous IE6
function CorrectPNGOxylaneService()
{
   var arVersion = navigator.appVersion.split("MSIE")
   var version = parseFloat(arVersion[1])
   if ((version >= 5.5) && (document.body.filters)) 
   {
      for(var i=0; i<document.images.length; i++)
      {
         var img = document.images[i]
         var imgName = img.src.toUpperCase()
         if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
         {
            var imgID = (img.id) ? "id='" + img.id + "' " : "";
            var imgClass = (img.className) ? "class='" + img.className + "' " : "";
            var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";
            var imgStyle = "display:inline-block;" + img.style.cssText 
            if (img.align == "left") imgStyle = "float:left;" + imgStyle;
            if (img.align == "right") imgStyle = "float:right;" + imgStyle;
            if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle;
            var strNewHTML = "<span " + imgID + imgClass + imgTitle
            + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
            + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
            + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>";
            img.outerHTML = strNewHTML;
            i = i-1;
         }
      }
   }    
}