//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
// PRO		url de l'imatge (http://www.....)

function pinta(tipus,identificador,amplada,alcada,magic,objectiu)
{
 var rndURL = 10000000000000000*Math.random();
 switch (tipus)
 {
  case "IFR" :
   document.write('<IFRAME WIDTH='+amplada+' HEIGHT='+alcada+' NORESIZE SCROLLING=No FRAMEBORDER=0 MARGINHEIGHT=0 MARGINWIDTH=0 SRC="http://adserver.adtech.de/?adiframe|2.0|39|'+identificador+'|1|'+magic+'|target='+objectiu+'&rndURL='+rndURL+';">');
   document.write('<script language=javascript src="http://adserver.adtech.de/?addyn|2.0|39|'+identificador+'|1|'+magic+'|target='+objectiu+'&rndURL='+rndURL+';loc=700;"></script>');
   document.write('<noscript><a href="http://adserver.adtech.de/?adlink|2.0|39|'+identificador+'|1|'+magic+'|ADTECH&rndURL='+rndURL+';loc=300;" target='+objectiu+'><img src="http://adserver.adtech.de/?adserv|2.0|39|'+identificador+'|1|'+magic+'|ADTECH&rndURL='+rndURL+';loc=300;" border=0 width='+amplada+' height='+alcada+'></a></noscript></IFRAME>');
   return;
  case "JSC" :
    cadena1="<";
    cadena20="script";
    cadena21="/script";
    cadena3=">";
    document.write(''+cadena1+''+cadena20+' language=javascript src="http://adserver.adtech.de/?addyn|2.0|39|'+identificador+'|1|'+magic+'|target='+objectiu+'&rndURL='+rndURL+';loc=100;"><!--');
    document.write('var a ="|2.0|39|'+identificador+'|1|'+magic+'|target='+objectiu+'&rndURL='+rndURL+';loc=200;"; var h = "http://adserver.adtech.de/?"; var u = navigator.userAgent; ');
    document.write('if (u.indexOf("Mozilla/2.") != 0 || u.indexOf("MSIE") >= 0) document.write("<a href=\""+h+"adlink"+a+"\" target='+objectiu+'><img src=\""+ h+"adserv"+a+"\" border=0 width='+amplada+' height='+alcada+'></a>"); ');
    document.write('//-->'+cadena1+''+cadena21+''+cadena3+'');
    document.write('<noscript><a href="http://adserver.adtech.de/?adlink|2.0|39|'+identificador+'|1|'+magic+'|ADTECH;loc=300;" target='+objectiu+'><img src="http://adserver.adtech.de/?adserv|2.0|39|'+identificador+'|1|'+magic+'|ADTECH;loc=300;" border=0 width='+amplada+' height='+alcada+'></a></noscript>');
   return;
  case "PRO" :
   document.write('<a href="'+identificador+'" target='+objectiu+'><img src="'+magic+'" border=0 width='+amplada+' height='+alcada+'></a>');
   return;
  default :
   document.write('');
   return;

 }

}

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

function posicio(website,seccio,tipus,localitzacio)
{
 switch (website)
 {
  case "LAMARATO" :
   switch (seccio)
   {
    case "home" :
     switch (tipus)
     {
       	case "sbanner" :     
              pinta("JSC","1446767","728","90","225","_blank"); 
        return;
     
      	case "roba" :
	       			pinta("JSC","1446768","300","250","170","_blank");
	     	 return;

//      case "banner" :
       //pinta("IFR","69949","468","60","1","_top"); 
//       pinta("JSC","69949","468","60","1","_top"); 
       //pinta("PRO","http://www.tvcatalunya.com/marato","468","60","http://www.tvcatalunya.com/banner/lamarato/marato_top1.gif","_top"); 
//       return;
//      case "roba" :
       //pinta("IFR","93565","180","190","313","_top");
//       pinta("JSC","93565","180","190","313","_top");
//       return;
//      case "sky" :
       //pinta("IFR","93566","140","400","220","_top");
//       pinta("JSC","93566","140","400","220","_top");
//       return;
     default :
       nopinta();
       return;
   
   } 
   	return;
        //// fi seccio home //////
  	
  					/// seccio blog ///

				case "blog":
          switch (tipus)
          {         
            case "roba" :
               	pinta("JSC","1720591","300","250","170","_blank"); 
            return; 
            default :
              nopinta();
            return;
          } 
        return;
        /// fi seccio blog ///
  	
  	
  	default :	     
	     switch (tipus)	     
	     {
	     	 case "roba" :
	       	pinta("JSC","1446769","300","250","170","_blank");
	       return;
	       case "sky" :
	       	pinta("JSC","1446770","120","600","168","_blank");
	       return;
	       
	      default :
	       nopinta();
	       return;
	     }
	     return;
        //// fi per defecte ///////	       	
     } 
    return;
  } 
return;
}
