// *** PACKAGES OF CONFIGS ***
// * In the following function you can edit your own configurations for each brand! *
// setting "alwaysopened:true" will cause pmbrand to appear as always opened when loading the page (with or without cookiename).
// setting "cookiename:xyz" will create a cookie named "xyz" the first time the user goes to the page AND pmbrand will appear as opened. Next times pmbrand will appear as closed (except when 'alwaysopened:true' is setted). 
// if cookiename is not setted, no cookie will be created and pmbrand will always appear as closed when the user goes to the page (except when 'alwaysopened:true' is setted).  

function configFromPackage(id) {
  switch(id) {
    case "piemme":
      pmbrandparams = {
        src : pmbrandurl+"/piemme/20081016_mondodirhett/index.html",
        height : "82",                                   
        position : "top",
        //btnlogourl : pmbrandurl+"",
        btnlogohref : "http://www.edizpiemme.it",
        btnopenurl : pmbrandurl+"/piemme/20081016_mondodirhett/open.jpg",
        btncloseurl :pmbrandurl+"/piemme/20081016_mondodirhett/close.jpg",
        alwaysopened : false, 
        cookiename : "mondodirhett",
      dummycomma:null} 
    break;

	case "hosseini":
	  pmbrandparams = {
	     src : pmbrandurl+"/piemme/20111110_graphic_novel/index.html",
	     height : "80",                                   
	     position : "bottom",
	     //btnlogourl : pmbrandurl+"",
	     btnlogohref : "http://www.edizpiemme.it",
	     btnopenurl : pmbrandurl+"/default/open-bottom.gif",
	     btncloseurl :pmbrandurl+"/default/close-bottom.gif",
	     alwaysopened : true, 
	     cookiename : "hosseini",
	     dummycomma:null} 
	 break;
	
	case "bav-insegnanti":
      pmbrandparams = {
        src : pmbrandurl+"/bav-insegnanti/20081120_lel/index.html",
        height : "90",                                   
        position : "bottom",
        btnlogourl : pmbrandurl+"/bav-insegnanti/logo_lel.gif",
        btnlogohref : "http://www.leggendoeleggendo.it",
        btnopenurl : pmbrandurl+"/bav-insegnanti/open_bav.gif",
        btncloseurl :pmbrandurl+"/bav-insegnanti/close_bav.gif",
        alwaysopened : false, 
        cookiename : "leggendoeleggendo",
      dummycomma:null} 
    break;

	case "bav-ragazzi":
      pmbrandparams = {
        src : pmbrandurl+"/bav-ragazzi/20081016_gol/index.html",
        height : "90",                                   
        position : "bottom",
        btnlogourl : pmbrandurl+"/bav-ragazzi/logo_gol.gif",
        btnlogohref : "http://www.lecipolline.it",
        btnopenurl : pmbrandurl+"/bav-ragazzi/open_bav.gif",
        btncloseurl :pmbrandurl+"/bav-ragazzi/close_bav.gif",
        alwaysopened : false, 
        cookiename : "gol",
      dummycomma:null} 
    break;
    
    case "simileapiemme":
      configFromPackage("piemme");
    break;
    
    case "default":
      pmbrandparams = {
        src : pmbrandurl+"/default/index.html",                      
        height : "35",                                                                                     
        position : "top",                                                                                     
        btnlogourl : pmbrandurl+"/default/logo.gif",                                                                                     
        btnlogohref : "http://www.edizpiemme.it",                  
        btnopenurl : pmbrandurl+"/default/open.gif",                 
        btncloseurl : pmbrandurl+"/default/close.gif",                 
        alwaysopened : true,                                                                               
        cookiename : "defaultcookie",                                                                             
      dummycomma:null}
    break;
    
    default:
      pmbrandparams = null;
    break;
  }     
}       
        
        
//DO NOT TOUCH! retrieves the desired package of configs for pmbrand (the name of the package is inside the 'pmbrand:id' attribute that is placed inside the 'script' tag in the calling page). 
var pmbrand_id = "default";
var allscripts = document.getElementsByTagName("script");
for (var i = 0; i < allscripts.length; i++) {
  if(allscripts[i].id == "pmbrand_identifier" && allscripts[i].getAttribute("pmbrand:id") != "" && allscripts[i].getAttribute("pmbrand:id") != null) {
    pmbrand_id = allscripts[i].getAttribute("pmbrand:id");
    break;
  }
}
var pmbrandparams;
//var pmbrandurl = "http://edizionipiemme.bluestudio.it/static/pmbrand";
var pmbrandurl = "http://www.edizpiemme.it/static/pmbrand";
configFromPackage(pmbrand_id);


