/*
   LIBRERIA:  "bunner.js"
   CANALE:    "ALL SITE"
   VERSIONE:  2.0.02
   AGG. DATA: 31/10/2001
*/

var PageID = 0;

/*
  Funzione: getBrowser
  Descrizione: Inizialize function
*/
function getBrowser()
{
  var now = new Date();
  PageID  = now.getTime();
}

/*
  Funzione: buildBanner
  Parametri: size      = formato banner
             spacedesc = posizione del banner
             site      = sezione del sito
             subsite   = sotto sezione
             ch        = canale
  Descrizione: Spara banner
*/
function buildBanner(size, spacedesc, site, subsite, ch)
{
  var now      = new Date();
  var random   = now.getTime();
  var siteADS  = "http://ebismedia.adbureau.net";
  var target   = "";
  var sitename = "";
  var sitecode = "";
  var SizeID   = "";
  var Tag      = "";
  var geometry = "";

  switch(ch)
  {
  	 case 1:
      sitename = "ILNUOVO";
      sitecode = "IN";
  	   break; 

  	 case 2:
      sitename = "NEXOS";
      sitecode = "NX";
  	   break; 

  	 case 3:
      sitename = "YESMILANO";
      sitecode = "MI";
  	   break; 

  	 case 4:
      sitename = "TECHTRENDS";
      sitecode = "TT";
  	   break; 

  	 case 5:
      sitename = "GAMEON";
      sitecode = "GO";
  	   break; 

  	 case 6:
      sitename = "EMIK";
      sitecode = "MK";
  	   break; 

  	 case 7:
      sitename = "GIB";
      sitecode = "GB";
  	   break; 

  	 case 8:
      sitename = "EVOCI";
      sitecode = "EV";
  	   break; 

  	 case 9:
      sitename = "EVOCINEG";
      sitecode = "EN";
  	   break; 

  	 case 10:
      sitename = "DINOPARK";
      sitecode = "DP";
  	   break; 

  	 case 11:
      sitename = "OLTRETUTTO";
      sitecode = "OT";
  	   break; 

  	 case 12:
      sitename = "RAICLICK";
      sitecode = "RC";
  	   break; 

  	 case 13:
      sitename = "ODIGO";
      sitecode = "OD";
  	   break; 

  	 case 14:
      sitename = "TVTB";
      sitecode = "TV";
  	   break; 

  	 case 100:
      sitename = "SPECIALI";
      sitecode = "SP";
  	   break; 
  }

  switch(size.toLowerCase())
  {
	case "full":
	  SizeID = "468x60";
	  geometry = "WIDTH=468 HEIGHT=60";
	  break;
	  
	case "half":
	  SizeID = "234x60";
	  geometry = "WIDTH=234 HEIGHT=60";
	  break;
	  
	case "bottone":
	  SizeID = "120x60";
	  geometry = "WIDTH=120 HEIGHT=60";
	  break;
	  
	case "bcs120x90":
	  SizeID = "120x90";
	  geometry = "WIDTH=120 HEIGHT=90";
	  break;
	  
	case "tvbfs":
	  SizeID = "468x60";
	  geometry = "WIDTH=468 HEIGHT=60";
	  break;
	  	  
	case "popup":
	  SizeID = "180x100";
	  geometry = "WIDTH=180 HEIGHT=100";
	  break;

   case "skyscrapers":
	  SizeID = "120x600";
	  geometry = "WIDTH=120 HEIGHT=600";
	  break;

	default: // se size non standard il default bottone 
	  SizeID = "468x60";
	  geometry = "WIDTH=468 HEIGHT=60";
	  break;
  }

  target = "/SITE=" + sitename + "/AREA=" + sitecode + "." + site.toUpperCase() + "." + subsite.toUpperCase() + "/POS=" + spacedesc + "/AAMSZ=" + SizeID + '/acc_random=' + random + "/PAGEID=" + PageID;

// Modify to reflect site specifics

  document.write('<IFRAME SRC="' + siteADS + '/hserver' + target + '"');
  document.write(' NORESIZE SCROLLING=NO HSPACE=0 VSPACE=0 FRAMEBORDER=0 MARGINHEIGHT=0 MARGINWIDTH=0 ' + geometry + '>');
  document.write('<SCR');
  document.write('IPT SRC="' + siteADS + '/jnserver' + target + '">');
  document.write('</SCR');
  document.write('IPT>');
  document.write('</IFRAME>');

  document.write('<NOSCRIPT>');

  document.write('<A HREF="' + siteADS + '/accipiter/adclick' + target + '">');   
  document.write('<IMG SRC="' + siteADS + '/accipiter/nserver' + target + '">');   
  document.write('</A>');
  document.write('</NOSCRIPT>');
}

