//tipus: tipus de tag a incloure (IFR-->IFRAME,JSC-->JavaScript,PRO-->Propi)
//identificador: 
//  IFR/JSC id de la unitat de contingut 
//  PRO link (http://www......)
//amplada i alcada: tamanys del banner
//objectiu: a on s'ha d'obrir al fer click en el banner (_top, _blank,...)
//magic: tipus de banner 
// IFR/JSC	1	468x60
// IFR/JSC	16	popup
// IFR/JSC	24	90x90
// IFR/JSC	47	86x58
// IFR/JSC	86	140x60
// IFR/JSC	220	140x400
// IFR/JSC	313	180x190
// IFR/JSC	314	180x90
// PRO		url de l'imatge (http://www.....)

var addsrv = new Array();


function openOnLoad(){

	for(i=0;i<addsrv.length;i++)	document.getElementById("addsrv"+i).src=addsrv[i];
	
}

onload=openOnLoad;

function pinta(tipus,identificador,amplada,alcada,magic,objectiu){
  var rndURL = 10000000000000000*Math.random(); 
 
 	switch (tipus) {
 	 
 	 	case "IFR" :
 	 	
			addsrv[addsrv.length]=	'http://adserver.adtech.de/?adiframe|2.0|39|'+identificador+'|1|'+magic+'|target='+objectiu+'&rndURL='+rndURL+';';
	   		txt = 	'<IFRAME id="addsrv'+(addsrv.length - 1)+'" WIDTH='+amplada+' HEIGHT='+alcada+' NORESIZE SCROLLING=No FRAMEBORDER=0 MARGINHEIGHT=0 MARGINWIDTH=0 SRC=""></IFRAME>';
 	 	  	break;
 	 	case "JSC" :
 	 	  	txt	='<scr'+'ipt language=javascript src="http://adserver.adtech.de/?addyn|2.0|39|'+identificador+'|1|'+magic+'|target='+objectiu+'&rndURL='+rndURL+';loc=100;"><a href="http://adserver.adtech.de/?adlink|2.0|39|'+identificador+'|1|'+magic+'|target='+objectiu+'&rndURL='+rndURL+';loc=200;" target='+objectiu+'><img src="http://adserver.adtech.de/?adserv|2.0|39|'+identificador+'|1|'+magic+'|target='+objectiu+'&rndURL='+rndURL+';loc=200;"  border=0 width='+amplada+' height='+alcada+'></a></scr'+'ipt>';
 	 	 	break;
 	 	case "PRO" :
 	 		addsrv[addsrv.length]=magic;
 	 		txt	='<a href="'+identificador+'" target='+objectiu+'><img id="addsrv'+(addsrv.length - 1)+'" src="http://www.telenoticies.com/imatges/pix_trans.gif" border=0 width='+amplada+' height='+alcada+'></a>';
 	 	 	break
 	 	default :
 	 	 	txt	= '';
 	 	 return;
	}

	document.write(txt);
}

function nopinta()
{
//no hi ha tag definit
document.write('');
}

function posicio(website,seccio,tipus,localitzacio)
{

	var tipusCreativitat = "PRO";
	var identificador = "http://www.tv3.cat";
	var objectiu = "_blank";

 switch (website)
 {
  case "alexandria" :
   switch (seccio)
   {
    case "home" :
     switch (tipus)
     {
      case "roba" :
       //pinta("IFR","99267","180","190","313","_blank"); 
       pinta(tipusCreativitat,identificador,"180","190","http://www.tv3.cat/banner/creativitats/180x190.gif",objectiu); 
       return;
     } 
    case "internes" :
     switch (tipus)
     {
     case "roba" :
       //pinta("IFR","99268","180","190","313","_blank"); 
       pinta(tipusCreativitat,identificador,"180","190","http://www.tv3.cat/banner/creativitats/180x190.gif",objectiu); 
       return;
       case "sky" :
       //pinta("IFR","99269","140","400","220","_blank");
       pinta(tipusCreativitat,identificador,"140","400","http://www.tv3.cat/banner/creativitats/140x400.gif",objectiu);
       return;
      default :
       nopinta();
       return;
     }
     return;

     return;
    default :
     nopinta();
     return;
   } 
   return;
  default :
   nopinta();
   return; 
 }
}

