/* 2005 Kahiloa Solutions et Communication - http://www.kahiloa.com */
/* www.images-photo.com */
/* SCRIPT DE LA HOMEPAGE */

/* Chargement du script global */
__loadScript("/js/metier/global/script.js");


/* Chargement d'une page javascript */
function __loadScript(pUrl){
	vUrl="\<"+"script language='javascript' src='"+pUrl+"'"+"\>"+"\</script\>";
	document.write(vUrl);
}




/* Initialisation avant le body */
function __initPageAvantBody(){
	
}

/* Initialisation avant l'affichage de la page */
function __initPageAvantAffichage(){
	
}

function afficheDonneesVille(wVille, wTitre) {
    $(".titre-lien-image").show();

       // alert(wVille);
	document.getElementById('ville').innerHTML = "";
	document.getElementById('titre').innerHTML = "";
	document.getElementById('urlVille').innerHTML = "";
	document.getElementById('urlVille').href = "";
	document.getElementById('msg_dispo').innerHTML = "";
        var founded = false;
        for(i=0;i<KaBoxFunJSONResult.magasins.length;i++)
            {
                if (wVille == KaBoxFunJSONResult.magasins[i]["WEB_ID"])
                    {
                        //alert('OK !!!!!!!!');
                        document.getElementById('ville').innerHTML = KaBoxFunJSONResult.magasins[i]["WEB_NAME"];
                        document.getElementById('titre').innerHTML = KaBoxFunJSONResult.magasins[i]["WEB_TITLE"];
                        document.getElementById('urlVille').innerHTML = KaBoxFunJSONResult.magasins[i]["WEB_URL"];
                        document.getElementById('urlVille').href = KaBoxFunJSONResult.magasins[i]["FINAL_URL"];
                    }
            }
            for(i=0;i<KaBoxFunJSONResult.magasins_dispo.length;i++)
            {
                if (wVille == KaBoxFunJSONResult.magasins_dispo[i]["WEB_ID"])
                    {
                        document.getElementById('urlVille').href = KaBoxFunJSONResult.magasins_dispo[i]["FINAL_URL"];
                        founded = true;
                    }

            }

            if (!founded)
                {
                    document.getElementById('msg_dispo').innerHTML = "Attention, cette boutique ne propose actuellement pas le produit pour lequel vous souhaitez obtenir plus d'informations.";
                }
}
																		