OpenMyDocument = function (DropDownId, urlToRedirect)
{
    var DocName = document.getElementById(DropDownId).value   
    if (DocName.indexOf('http://')!=-1 || DocName.indexOf('https://')!=-1)
        window.open(DocName);    
    else
        window.open(urlToRedirect+DocName);
    return true;
}


/***********************************************/
/*  Les favoris             */
/***********************************************/
function AddFavorites(link, favoriteName)
{
	if (link == null || link.length == 0)
		link = window.location
		 
	link = escape(link);
	CenterWindowAndOpen(SitePath+ "popup/MembersAddFavorite.aspx?Link=" + link + '&Name=' + favoriteName, "AddFavorites", 550, 340, ",menubar=no, status=no, scrollbars=no, menubar=no");	
}


function UpdateFavorites(id)
{
    CenterWindowAndOpen(SitePath+ "popup/MembersAddFavorite.aspx?Id=" + id, "UpdateFavorites", 550, 340, ",menubar=no, status=no, scrollbars=no, menubar=no");	
}

function UpdateFolder(id)
{
    CenterWindowAndOpen(SitePath+ "popup/MembersAddFavoriteFolder.aspx?Id=" + id, "UpdateFolder", 550, 340, ",menubar=no, status=no, scrollbars=no");	
}

/***********************************************/


/********************************************/
/*                  members              */
function submitTraite(elt) {
	if (document.getElementById(elt.id + "_0").checked) {
		document.getElementById("_tdWarrants").style.display = ''; 
	} else {
		document.getElementById("_tdWarrants").style.display = 'none';
	}
}

function AllEmission(eltp, elt1, elt2, elt3, elt4)
{
//	Ipt = document.getElementsByName("emis");
//	for(i=0; i<Ipt.length; i++) {
//	    inp = Ipt[i].getElementsByTagName("input");
//	    alert(document.getElementById(elt).checked)
//		if(inp[0].type == "checkbox") {
//			inp[0].checked = document.getElementById(elt).checked;
//		}
//	}
    document.getElementById(elt1).checked = document.getElementById(eltp).checked;
    document.getElementById(elt2).checked = document.getElementById(eltp).checked;
    document.getElementById(elt3).checked = document.getElementById(eltp).checked;
    document.getElementById(elt4).checked = document.getElementById(eltp).checked;

}
/***********************************************/


function ExportExcel(CategoryId) {
    var wind = SitePath + 'popup/ProductExportExcel.aspx?CategoryId='+CategoryId;
    window.location = wind;
}

//function pour hebdo
function OpenDocument(lstName)
{
	window.open(document.forms[0].elements[lstName].options[document.forms[0].elements[lstName].selectedIndex].value ,null,'')
}


function Fr_UnderlyingData_changeUnderlying(Prefix, underlyingId, underlyingName, folder, data_spot, data_perf, data_open, data_close, data_high, data_low, data_volume, website) 
{
		//changement du graphe
	    ChangeGraphWithWebsiteId(Prefix, '_tdIntraday', folder, 'intraday', underlyingId, underlyingName, website)
		ChangeUnderlying(Prefix, folder, underlyingId, underlyingName)
		
		//changement des données
		document.getElementById(Prefix + "_Name").innerHTML = underlyingName.replace("+", " ");
		document.getElementById(Prefix + "_Spot").innerHTML = '&nbsp;'+data_spot;
		
		data_perf = data_perf.replace(",", ".").replace(" ", "");
		if (parseFloat(data_perf) > 0) {
			data_perf = "+" + data_perf;
			document.getElementById(Prefix + "_Perf").className = "size11 bold Green";
		} else if (parseFloat(data_perf) == 0) {
			document.getElementById(Prefix + "_Perf").className = "size11 bold Blue";	
		} else {
			document.getElementById(Prefix + "_Perf").className = "size11 bold Red";
		}
		document.getElementById(Prefix + "_Perf").innerHTML = data_perf.replace(".", ",") + "%";
		document.getElementById(Prefix + "_Open").innerHTML = '&nbsp;'+data_open;
		document.getElementById(Prefix + "_Close").innerHTML = '&nbsp;'+data_close;
		document.getElementById(Prefix + "_High").innerHTML = '&nbsp;'+data_high;
		document.getElementById(Prefix + "_Low").innerHTML = '&nbsp;'+data_low;
		document.getElementById(Prefix + "_Volume").innerHTML = '&nbsp;'+data_volume;

		document.getElementById(Prefix + "_Data").style.visibility='visible';
		
}

var website_id;

function ChangeGraphWithWebsiteId(Prefix, itemId, folder, itemName, underlyingId, underlyingName, website) {
    website_id = website;
    ChangeGraph(Prefix, itemId, folder, itemName, underlyingId, underlyingName);
}

function ChangeGraph(Prefix, itemId, folder, itemName, underlyingId, underlyingName) {

	//on retire la selection à tous les onglets
	if (document.getElementById(Prefix + '_tdIntraday') != null) {
        document.getElementById(Prefix + '_tdIntraday').className = 'unselected';
	    document.getElementById(Prefix + '_td1M').className = 'unselected';
	    document.getElementById(Prefix + '_td6M').className = 'unselected';
        //on met la selection à l'onglet concerné	
        document.getElementById(Prefix + itemId).className = 'selected';
    }
	
	//on change le graphique
	if (underlyingId != "") 
	{
	    /*
	    var img = document.images[Prefix + '_imgGraph'];
		img.src = "?Download=" + folder + "/"+ itemName +"_"+ underlyingId + ".gif";
		img.alt= underlyingName + " " + itemName;
		img.style.visibility = 'visible';
		*/
		//ajout nouveau graphique
		var img = document.images[Prefix + '_imgGraphGenerator'];
		var graphType;
		switch (itemName)
		{
		    case "intraday" : 
		        graphType = "FR_Intraday";
		        break;
		    case "1M" :
		        graphType = "FR_History1mois";
		        break;
		    case "6M" :
		        graphType = "FR_History6mois";
		        break;
		}
		img.src = "GraphGeneratorHandler.ashx?mode=" + graphType + "&id=" + underlyingId + "&title=" + underlyingName + "&website_id=" + website_id;
		img.alt= underlyingName + " " + itemName;
		img.style.visibility = 'visible';
	}
}


function ChangeUnderlying(Prefix, folder, underlyingId, underlyingName)
{
    var lnkNameIntraday = Prefix + '_lnkIntraday';
    var lnkName1M = Prefix + '_lnk1M';
    var lnkName6M = Prefix + '_lnk6M';
    var linkIntraday, link1M, link6M;
     
    if (document.getElementsByName && document.getElementsByName(lnkNameIntraday)) {
        linkIntraday = document.getElementsByName(lnkNameIntraday)[0];
        link1M = document.getElementsByName(lnkName1M)[0];
        link6M = document.getElementsByName(lnkName6M)[0];
        
    } else if (document.all && document.all[lnkNameIntraday]) {
        linkIntraday = document.all[lnkNameIntraday];
        link1M = document.all[lnkName1M];
        link6M = document.all[lnkName6M];
        
    } else if ( document.layers && document.layers[lnkNameIntraday] ) {
        linkIntraday = document.layers[lnkNameIntraday];
        link1M = document.layers[lnkName1M];
        link6M = document.layers[lnkName6M];
    }
    
    if (linkIntraday != null) {
	    linkIntraday.href = "javascript:ChangeGraph('"+Prefix+"','_tdIntraday', '"+folder+"','intraday',"+underlyingId+", '"+underlyingName+"');";
	    link1M.href = "javascript:ChangeGraph('"+Prefix+"','_td1M', '"+folder.replace('intraday', '1M')+"','1M',"+underlyingId+", '"+underlyingName+"');";;
	    link6M.href =  "javascript:ChangeGraph('"+Prefix+"','_td6M', '"+folder.replace('intraday', '6M')+"','6M',"+underlyingId+", '"+underlyingName+"');";;
	}
}

function OpenConfig(CategoryId)
{
	CenterWindowAndOpen(SitePath+ "popup/ConfigTableau.aspx?CategoryId="+CategoryId, "ConfigTableau", 550, 450, ",scrollbars=yes,resizable=no,status=no");	
}

function OpenTabByDef(CategoryId)
{
	CenterWindowAndOpen(SitePath+ "popup/ConfigTabByDef.aspx?CategoryId="+CategoryId, "ConfigTabBydef", 420, 70, ",titlebar=no,menubar=no,toolbar=no,scrollbars=no,status=no,resizable=no");
}

function OpenConfigIndic()
{
	CenterWindowAndOpen(SitePath+ "popup/MembersUnderlyingSelect.aspx", "ConfigIndic", 550, 450, ",scrollbars=yes,resizable=no,status=no");	
}

function SearchProduct(field, withPopup)
{
    valeur = document.getElementById(field).value;
    if (valeur.length < 3)
        alert('Veuillez saisir au moins 3 caractères')
    else if (withPopup == 1)
        CenterWindowAndOpen(SitePath+ "popup/ProductSearch.aspx?code="+valeur, "search", 930, 750, ",scrollbars=yes,resizable=no,status=no");	
    else
        location.href=SitePath+ "popup/ProductSearch.aspx?code="+valeur;
        
    return false;    
}

function forceSearchProduct(val,withPopup)
{
    if (withPopup == 1)
        CenterWindowAndOpen(SitePath+ "popup/ProductSearch.aspx?code="+val, "search", 930, 750, ",scrollbars=yes,resizable=no,status=no");	
    else
        location.href=SitePath+ "popup/ProductSearch.aspx?code="+val;
        
//    return false;    
}

function OpenProduct(CategoryId, ProductId)
{
	CenterWindowAndOpen(SitePath+ "popup/ProductDetail.aspx?CategoryId="+CategoryId+"&ProductId=" + ProductId, "product_" + ProductId, 930, 750, ",scrollbars=yes,resizable=no,status=no");	
}

function OpenPresent(CategoryId, type)
{
	CenterWindowAndOpen(SitePath+ "popup/CategoryDocument.aspx?CategoryId="+CategoryId+"&type="+type, "Documents", 550, 450, ",scrollbars=yes,resizable=no,status=no");	
}

function OpenTA(UnderlyingId, TechAId,TechAnalTypeId)
{
	CenterWindowAndOpen(SitePath+ "popup/TechnicalAnalysis.aspx?TechAnalTypeId="+TechAnalTypeId+"&UnderlyingId="+UnderlyingId+"&TechAnalId=" + TechAId, "TA", 900, 700, ",scrollbars=yes,resizable=no,status=no");	
}

function OpenTAHome(UnderlyingId, TechAId,TechAnalTypeId)
{
	CenterWindowAndOpen(SitePath+ "popup/TechnicalAnalysis.aspx?showProductCat=1&TechAnalTypeId="+TechAnalTypeId+"&UnderlyingId="+UnderlyingId+"&TechAnalId=" + TechAId, "TA", 900, 700, ",scrollbars=yes,resizable=no,status=no");	
}

function OpenTAWithProductCat(UnderlyingId, TechAId,TechAnalTypeId)
{
	CenterWindowAndOpen(SitePath+ "popup/TechnicalAnalysis.aspx?showProductCat=1&TechAnalTypeId="+TechAnalTypeId+"&UnderlyingId="+UnderlyingId+"&TechAnalId=" + TechAId +"#partProductCat", "TA", 900, 700, ",scrollbars=yes,resizable=no,status=no");	
}

function OpenTAWithProductCatAndShow(UnderlyingId, TechAId,TechAnalTypeId,prodId)
{
	CenterWindowAndOpen(SitePath+ "popup/TechnicalAnalysis.aspx?showProductCat=1&TechAnalTypeId="+TechAnalTypeId+"&UnderlyingId="+UnderlyingId+"&TechAnalId=" + TechAId+"&ProdId=" + prodId+"#partProductCat", "TA", 900, 700, ",scrollbars=yes,resizable=no,status=no");	
}

function OpenReco(TechAId,TechAnalTypeId)
{
	CenterWindowAndOpen(SitePath+ "popup/TechnicalAnalysisReco.aspx?TechAnalTypeId="+TechAnalTypeId+"&TechAnalId=" + TechAId, "Reco", 900, 700, ",scrollbars=yes,resizable=no,status=no");	
}

function OpenTurbos(status)
{
	CenterWindowAndOpen(SitePath+ "popup/TurbosStatus.aspx?status="+status, "TurbosState", 550, 400, ",scrollbars=yes,resizable=no,status=no");	
}

function WatchListAddProducts()
{
    list = ListProductChecked();
    if (list.length == 0)
        alert("Veuillez selectionner au moins un produit dans la liste");    
    else
    	CenterWindowAndOpen(SitePath+ "popup/MembersAddList.aspx?ProductId="+list, "AddList", 550, 340, ",scrollbars=yes,resizable=no,status=no");	
}
function WatchListAddProduct(ProductId)
{
    CenterWindowAndOpen(SitePath+ "popup/MembersAddList.aspx?ProductId="+ProductId, "AddList", 550, 340, ",scrollbars=yes,resizable=no,status=no");	
}

function AlertAddProducts()
{
    list = ListProductChecked();
    if (list.length == 0)
        alert("Veuillez selectionner au moins un produit dans la liste");    
    else
    	CenterWindowAndOpen(SitePath + "popup/MembersAlertAddList.aspx?ProductId="+list, "AddList", 550, 400, ",scrollbars=yes,resizable=no,status=no");	
}
function AlertAddProduct(ProductId)
{
    CenterWindowAndOpen(SitePath + "popup/MembersAlertAddList.aspx?ProductId="+ProductId, "AddList", 550, 400, ",scrollbars=yes,resizable=no,status=no");	
}

function AlertAddProduct(ProductId)
{
   	CenterWindowAndOpen(SitePath + "popup/MembersAlertAdd.aspx?ProductId="+ProductId, "AddList", 550, 340, ",scrollbars=no,resizable=no,status=no");	
}

function AlertAddDesac()
{
    list = ListProductChecked();
    if (list.length == 0)
        alert("Veuillez selectionner au moins un produit dans la liste");    
    else
    	CenterWindowAndOpen(SitePath + "popup/MembersAlertTurboAdd.aspx?ProductId="+list, "AddList", 550, 400, ",scrollbars=yes,resizable=no,status=no");	
}



function AlertUpdate(ProductId, Id)
{
   	CenterWindowAndOpen(SitePath + "popup/MembersAlertAdd.aspx?ProductId="+ProductId+"&Id="+Id, "AddList", 550, 340, ",scrollbars=no,resizable=no,status=no");	
}

function WatchListAddUnderlying(underlyingId)
{
   	CenterWindowAndOpen(SitePath+ "popup/MembersAddList.aspx?UnderlyingId="+underlyingId, "AddList", 550, 340, ",scrollbars=no,resizable=no,status=no");	
}

function ConferencesInscription(ConfId)
{
   	CenterWindowAndOpen(SitePath+ "popup/ConferencesInscription.aspx?ConfId="+ConfId, "Conferences", 550, 340, ",scrollbars=no,resizable=no,status=no");	
}

function disclaimer() {
	CenterWindowAndOpen(SitePath+ "popup/disclaimer.aspx", "disclaimer", 920, 600, ",scrollbars=yes,status=no,resizable=no");
}
function disclaimerfortuneo() {
	CenterWindowAndOpen(SitePath+ "popup/disclaimerfortuneo.aspx", "disclaimerfortuneo", 400, 320, ",scrollbars=no,status=no,resizable=no");
}

function mentions_legales() {
	CenterWindowAndOpen(SitePath+ "popup/MentionsLegales.aspx", "MentionsLegales", 900, 600, ",scrollbars=yes,status=no,resizable=no");
}

function gestion_conflits() {
	CenterWindowAndOpen('https://eqd.bnpparibas.com/box_disclosure.asp?language=FR', 'box_disclosure', 590, 395, ',scrollbars=no,status=no,resizable=no')
}

function infos_perso() {
	CenterWindowAndOpen(SitePath+ "popup/infosperso.aspx", 'infosperso', 925, 460, ',scrollbars=no,status=no,resizable=no')
}

function contact_us() {
	CenterWindowAndOpen(SitePath+ "popup/contactus.aspx", "contact", 795, 595, ",scrollbars=no,status=no,resizable=no");
}

function partners() {
	CenterWindowAndOpen(SitePath+ "popup/partners.aspx", "partenaires", 660, 530, ",scrollbars=no,status=no,resizable=no");
}

function apropos() {
	CenterWindowAndOpen(SitePath+ "popup/apropos.aspx", "apropos", 650, 570, ",scrollbars=no,status=no,resizable=no");
}

function faq() {
	CenterWindowAndOpen(SitePath+ "popup/faq.aspx", "faq", 800, 600, ",scrollbars=yes,status=no,resizable=no");
}

function help() {
	CenterWindowAndOpen(SitePath+ "popup/Help.aspx", "help", 910, 700, ",scrollbars=yes,status=no,resizable=no");
}

function news(StoryId) {
	CenterWindowAndOpen(SitePath+ "popup/NewsDetail.aspx?StoryId=" + StoryId, "NewsDetail", 900, 600, ",scrollbars=yes,status=no,resizable=no");
}

function newsDetails(NewsId) {
	CenterWindowAndOpen(SitePath+ "popup/NewsDetail.aspx?NewsId="+NewsId, "NewsDetail", 900, 600, ",scrollbars=yes,resizable=no,status=no");	
}

function indice(Tri) {
	CenterWindowAndOpen(SitePath+ "popup/IndiceCompo.aspx?Tri="+Tri, "indice", 1100, 850, ",scrollbars=yes,status=no,resizable=no");
}

function OpenCompo(underlyingId) {
	CenterWindowAndOpen(SitePath+ "popup/TrackersCompo.aspx?UnderlyingId=" + underlyingId, "trackers", 400, 600, ",scrollbars=yes,status=no,resizable=no");
}


function OpenLiquidation()
{
	CenterWindowAndOpen(SitePath+ "popup/Liquidation.aspx", "liquidation", 900, 400, ",scrollbars=yes,status=no,resizable=no");
}
function OpenCloture()
{
	CenterWindowAndOpen(SitePath+ "popup/Cloture.aspx", "cloture", 900, 400, ",scrollbars=yes,status=no,resizable=no");
}

function CoinSpecialiste(arg)
{
    if (arg == 0)
    {
    CenterWindowAndOpen(SitePath + "popup/CoinSpecialisteMainPage.aspx", "specialiste", 900, 800, ",scrollbars=yes,status=no,resizable=no");
    }
    else if (arg == 1)
    {
        CenterWindowAndOpen(SitePath + "popup/CoinSpecialisteRendement.aspx", "specialiste", 900, 800, ",scrollbars=yes,status=no,resizable=no");

    }
}

function GuideAT()
{
    CenterWindowAndOpen(SitePath + "popup/AnalyseTech/Sommaire.aspx", "guideAT", 900, 800, ",scrollbars=yes,status=no,resizable=no");
}


function ForgetPassword(email)
{
    var chaine = '';
    
    if (email != null && email.length > 0)
        chaine = "?email=" + email

    CenterWindowAndOpen(SitePath + "popup/PasswordSend.aspx" + chaine, "motdepasse", 540, 250, ",scrollbars=no,resizable=no,status=no");
}

function AccesMembre()
{
    window.opener.location.href= SitePath + "Members.aspx?new=1";
    window.close();
}

function AccesMembreExt()
{
    CenterWindowAndOpen(SitePath + "Members.aspx?new=1" , "newMember", 1024, 780, ",titlebar=yes,menubar=yes,toolbar=yes,scrollbars=yes,status=yes,resizable=yes");
    window.close();
}

function OpenNews(underlyingId)
{
    window.opener.location.href = SitePath + "NewsList.aspx?UnderlyingId=" + underlyingId;
}

function IndicatorDetails(indicator_id) {
	if (!isNaN(indicator_id))
		CenterWindowAndOpen(SitePath + "popup/Indicator.aspx?indicatorId=" + indicator_id, "indicator_" + indicator_id, 430, 380, ",scrollbars=yes,status=no,resizable=no");
}

function DisplayPanelSearch(panel_id) {
    eval("document.getElementById('" + panel_id + "').style.display = ''");
    fSwapSelect(panel_id);
}
function HidePanelSearch(panel_id) {
    eval("document.getElementById('" + panel_id + "').style.display = 'none'");
    fSwapSelect(panel_id);
}

function OpenBasketComposition(indice_id) {
    CenterWindowAndOpen(SitePath+ "popup/BasketComposition.aspx?Id="+indice_id, "BasketComposition", 900, 775, ",scrollbars=yes,status=no,resizable=no");
}
function OpenBasketCompoWithUnderlying(underlyingId) {
    CenterWindowAndOpen(SitePath+ "popup/BasketComposition.aspx?underlyingId="+underlyingId, "BasketComposition", 900, 775, ",scrollbars=yes,status=no,resizable=no");
}

function OpenUnderlyingAnalysis(underlying_id) {
    CenterWindowAndOpen(SitePath+ "popup/UnderlyingAnalysis.aspx?UnderlyingId="+underlying_id, "UnderlyingAnalysis", 910, 740, ",scrollbars=yes,status=no,resizable=no");
}


/**function pour les produits*/
function ChangeCarac(divcomment, divmore, field)
{
    if (document.getElementById(divcomment).style.display == 'none')
    {
        document.getElementById(divcomment).style.display = 'block'
        document.getElementById(divmore).style.display = 'none'
        document.getElementById('link'+divcomment).style.display = 'block'
        document.getElementById('link'+divmore).style.display = 'none'
        document.getElementById(field).value = 0;
    }
    else
    {
        document.getElementById(divcomment).style.display = 'none'
        document.getElementById(divmore).style.display = 'block'
        document.getElementById('link'+divcomment).style.display = 'none'
        document.getElementById('link'+divmore).style.display = 'block'
        document.getElementById(field).value = 1;
    }
}
/***/


function ShowCalendar()
{
    if (document.getElementById("calendar").style.visibility == "visible")
        document.getElementById("calendar").style.visibility = "hidden";
    else
        document.getElementById("calendar").style.visibility = "visible"
}


/*verification pour le formulaire */
function VerifSearchMore(underlying,category)
{
	if (document.getElementById(underlying).selectedIndex == 0
	    && document.getElementById(category).selectedIndex == 0
	    )
	{
		alert('Veuillez saisir un sous-jacent ou une categorie');
		return false;
	}
	return true;
}


/* probleme des dropdown et des select*/

fDomOffset = function( oObj, sProp )
{
 var iVal = 0;
 while (oObj && oObj.tagName != 'BODY') {
 eval('iVal += oObj.' + sProp + ';');
 oObj = oObj.offsetParent;
 }
 return iVal;
}
fSwapSelect = function( sId )
{
 oObj = document.getElementById(sId);
 if (oObj != null)
 {
     Top_Element = fDomOffset(oObj, 'offsetTop');
     Left_Element = fDomOffset(oObj, 'offsetLeft');
     Largeur_Element = oObj.offsetWidth;
     Hauteur_Element = oObj.offsetHeight;
     oSelects = document.getElementsByTagName('SELECT');
     if (oSelects.length > 0) 
     {
        for (i = 0; i < oSelects.length; i++) 
         {
             oSlt = oSelects[i];
             Top_Select = fDomOffset(oSlt, 'offsetTop');
             Left_Select = fDomOffset(oSlt, 'offsetLeft');
             Largeur_Select = oSlt.offsetWidth;
             Hauteur_Select = oSlt.offsetHeight;
             isLeft = false;
             if ((Left_Element > (Left_Select - Largeur_Element)) && (Left_Element < (Left_Select + Largeur_Select))) 
             {
                isLeft = true;
             }
             isTop = false;
             if ((Top_Element > (Top_Select - Hauteur_Element)) && (Top_Element < (Top_Select + Hauteur_Select))) 
             {
                isTop = true;
             }
            if (isLeft && isTop) 
            {
                sVis = (oObj.style.visibility == 'hidden') ? 'visible' : 'hidden';
                if (oSlt.style.visibility != sVis) 
                {
                    oSlt.style.visibility = sVis;}
                } 
                else 
                {
                    if (oSlt.style.visibility != 'visible') 
                    {
                        oSlt.style.visibility = 'visible';
                    }
                }
               }
            }
        }

 else
 {
     oSelects = document.getElementsByTagName('SELECT');
     if (oSelects.length > 0) 
     {
         for (i = 0; i < oSelects.length; i++) 
         {
            oSlt = oSelects[i];
            if (oSlt.style.visibility == 'hidden') 
            {
                oSlt.style.visibility = 'visible';
            }
          }
       }
 }
} 

var updatePanelSearchClientId;
function SelectTricks(divId)
{
Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(pageLoaded);
updatePanelSearchClientId = divId;
}

 function pageLoaded(sender, args) 
 {
    fSwapSelect(updatePanelSearchClientId);
}


/* small graph */
function ChangeSmallGraph(underlying_id, underlying_name, website_id) {
    /*
    document.getElementById("ImgSmallGraph").src = "?Download=" + graph_path + "intraday_small/intraday_" + underlying_id + ".gif";
    document.getElementById("ImgSmallGraph").alt = "Intraday " + underlying_name;
    */
    /*var img = document.getElementById("Underlying_imgGraphGenerator");
    if (img == null) {
        var imgs = document.getElementsByName("Underlying_imgGraphGenerator");
        img = imgs[0];
    }
    */
    var img = document.images['Underlying_imgGraphGenerator'];
    img.src = "GraphGeneratorHandler.ashx?mode=FR_Intraday_Small&id=" + underlying_id + "&title=" + underlying_name + "&website_id=" + website_id;
	img.alt = "Intraday " + underlying_name;
}

function contact_us()
{
 CenterWindowAndOpen("popup/contact.aspx", "contact", 640, 545, ",scrollbars=no,status=no,resizable=no");
}

function faq()
{
 CenterWindowAndOpen("popup/faq.aspx", "contact", 800, 600, ",scrollbars=yes,status=no,resizable=yes");
}

function dessin_anime_warrant() {
	CenterWindowAndOpen(SitePath+ "popup/DessinAnime.aspx?version=guide1", "dessin_anime_warrant", 575, 420, ",scrollbars=no,status=no,resizable=no");
}

function dessin_anime_expert() {
	CenterWindowAndOpen(SitePath+ "popup/DessinAnime.aspx?version=guide2", "dessin_anime_expert", 575, 420, ",scrollbars=no,status=no,resizable=no");
}

function goMultipricer(underlying) {
 if (window.opener) 
 {
     window.opener.location.href= SitePath +"MultiPricer.aspx?from=detail&underlying_id=" + underlying
     window.opener.focus();
     self.close();
 } 
}

function OpenWelcome()
{
    CenterWindowAndOpen(SitePath+ "popup/Welcome.aspx", "WelcomePopup", 500, 350, ",menubar=no,status=no,scrollbars=no,menubar=no");
}

function OpenWelcomeDemo()
{
    CenterWindowAndOpen(SitePath+ "popup/PopupDemo.aspx", "WelcomeDemoPopup", 300, 193, ",menubar=no,status=no,scrollbars=no,menubar=no");
}

function OpenListe()
{
    CenterWindowAndOpen(SitePath+ 'popup/ListPerso.aspx', 'MaListe', 350, 370, ',scrollbars=yes,resizable=yes,status=no');
}

function openPopupDemo()
{
    //alert('A renseigner');
     CenterWindowAndOpen(SitePath+ "popup/DemoWebSite.aspx", "DemoPopup", 1026, 766, ",menubar=no,status=no,scrollbars=no,menubar=no");

}

function ShowHelpNotation(elmtId)
{
    var helpToShow = document.getElementById(elmtId);
    if(helpToShow)
        helpToShow.style.display = 'block';
    
}

function HideHelpNotation(elmtId)
{
    var helpToShow = document.getElementById(elmtId);
    if(helpToShow)
        helpToShow.style.display = 'none';
    
}

function showIndicatorDetails(websiteId, indicatorId)
{
    CenterWindowAndOpen(SitePath+ "popup/IndicatorDetails.aspx?websiteId=" + websiteId+"&indicatorId="+indicatorId, "IndicatoDetails", 500, 250, ",menubar=no, status=no, scrollbars=yes, menubar=no");	
}


function PackDecouverte()
{
    CenterWindowAndOpen(SitePath + "partners/PackDecouverte.aspx", "PackDecouverte", 600, 690, ",menubar=no, status=no, scrollbars=yes, menubar=no");	
}

function OpenFullNewPage(url)
{
    CenterWindowAndOpen( url , "newPage", 1024, 780, ",titlebar=yes,menubar=yes,location=yes,toolbar=yes,scrollbars=yes,status=yes,resizable=yes");
}

function CheckAll(elt)
{
			Ipt = getElementsByClassName(document, "table", "war_tab")[0].getElementsByTagName("input");
			for(i=0; i<Ipt.length; i++) {
				if(Ipt[i].type == "checkbox" && Ipt[i].id != elt.id) {
					Ipt[i].checked = elt.checked;
				}
			}
}

function HebdoChangeChapter (chapter,nbchap) 
{
    switch (chapter)
    {
        case 1 : WReportcontent="Macro-economie"; break;
        case 2 : WReportcontent="Micro-economie"; break;
        case 3 : WReportcontent="Semaine des Warrants"; break;
        case 4 : WReportcontent="Les indicateurs a suivre cette semaine"; break;
        case 5 : WReportcontent="Analyse technique"; break;
        case 6 : WReportcontent="Point volatilite"; break;
        case 7 : WReportcontent="Selection des Warrants"; break;
        case 8 : WReportcontent="Selection de Certificats"; break;
    }
  
   WReportcontent= "Hebdo Journal - " +WReportcontent;
    wreport("Publications", "Hebdo Journal", "390713", "", WReportcontent, "");
    
    //$j.get("services/WReportAsyncCall.aspx", {Section:"Publications", SubSection:"Hebdo Journal", Content:WReportcontent});
    
	var i;
	for (i=1;i<=nbchap;i++) {
		eval("document.getElementById('chapter" + i + "').style.display='none'")
	}
	eval("document.getElementById('chapter" + chapter + "').style.display='block'")
}

function HebdoDisplayNoChapter (nbchap) {
	var i;
	for (i=1;i<=nbchap;i++) {
		eval("document.getElementById('chapter" + i + "').style.display='none'")
	}
	eval("document.getElementById('chapter1').style.display='block'")
	
}

function MarketInfosChangeCategory (category, productType) 
{
    $j.get("services/WReportAsyncCall.aspx", {Section:"Market Infos", SubSection:"Home Market Infos", Content:"Home Market Infos - Stats " + category + " - " + productType});
}
