// **********************************************************************************************
//  MyVoice® Net Facile
//  v.1.0
//  ©2003 Rigel Engineering S.r.l.
// **********************************************************************************************

//  dati licenza MyVoice® Net
var companyDefault="ebret"
var domainDefault="ebretit"
var serial="MV11-A721-2C6B-B650-37EE-6783-0F79"

// Var globali
var nomyv
var namePlugin = "MyVoice Plugin"
var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
var bVer = parseInt(navigator.appVersion);
var gMyVoiceTalk;

// Oggetto Myvoice corrente
var myVoiceObj;
var MyVoiceId;

//Variabili di default per la creazione dell'oggetto MyVoice e per il pannello
var codebaseDefault="http://www.myvoice.it/myvoice"
var srcDefault="dummy.myv"
var ramDefault="false"
var autostartDefault="false"
var layoutDefault="true"
var widthDefault=138
var heightDefault=19

var timestamp; //indica il momento in cui è stata fatta l'ultima getMyVoiceObject()

var debug = true; //visualizzare alert sul funzionnamento di myvoice se è true


/* 
   Le variabil seguenti servono a gestire diversi speakers 
   Caratteristiche di uno Speaker:
       - id
       - voice (male,female)
       - speed (1-10)
       - tone (1-10)			
*/
var speakers=new Array();
var currSpeaker='default'; //Speaker corrente


/* Gestione profili */
var currProfile='default'; //il profilo corrente selezionato dall'utente
var profiles=new Array(); //i profili esistenti


var reset=0;

var audio=true; //se il plug-in è abilitato o meno

var nostop = false; //utilizzato da PlayURLCond, PALYTestoCond e ManageSpeakerProfile

function init()
   {
   }


/********************************************************************/
/********************************************************************/
/******************   FUNZIONI BASE      ****************************/
/********************************************************************/
/********************************************************************/

function SpeakText(txt)
{
   MyVoiceObj = getMyVoiceObject()
   if (MyVoiceObj==null) return;
   
   MyVoiceObj.Speak(txt);
}


function SetSource(str)
{
   if (!audio) return;
   var MyVoiceObj = getMyVoiceObject()
   if (MyVoiceObj==null) return;
   
   MyVoiceObj.SetSource(str);
}


function SpeakURL(url)
{
   MyVoiceObj = getMyVoiceObject()
   if (MyVoiceObj==null) return;
   
   MyVoiceObj.SpeakURL(url);
}


function Play()
{
   if (!audio) return;
   MyVoiceObj = getMyVoiceObject()
   if (MyVoiceObj==null) return;
   MyVoiceObj.Start();
}


function Stop()
{
   MyVoiceObj = getMyVoiceObject()
   if (MyVoiceObj==null) return;
   MyVoiceObj.Stop();
}


function Pause()
{
   MyVoiceObj = getMyVoiceObject()
   if (MyVoiceObj==null) return;
   
   MyVoiceObj.Pause();
}


function Resume()
{
   MyVoiceObj = getMyVoiceObject()
   if (MyVoiceObj==null) return;
   
   MyVoiceObj.Resume();
}


function GetSpeed()
{
   MyVoiceObj = getMyVoiceObject()
   if (MyVoiceObj== null) return;
   
   return MyVoiceObj.GetSpeed();
}


function SetSpeed(vv)
{ //set speed when vv is a string containing a number
   MyVoiceObj = getMyVoiceObject()
   if (MyVoiceObj==null) return;
   
   var n = parseInt(vv);
   MyVoiceObj.SetSpeed( n );
}


function GetTone()
{
   MyVoiceObj = getMyVoiceObject()
   if (MyVoiceObj==null) return;
   
   return MyVoiceObj.GetTone();
}


function SetTone(vv)
{
   MyVoiceObj = getMyVoiceObject()
   if (MyVoiceObj==null) return;
   
   var n = parseInt(vv);
   MyVoiceObj.SetTone(n);
}


function GetLoop()
{
   MyVoiceObj = getMyVoiceObject()
   if (MyVoiceObj==null) return;

   if (MyVoiceObj.IsLooping())
      {return 'ON';
      }
   else
      {return 'OFF';
      }
}


function SetLoop(n)
{
   MyVoiceObj = getMyVoiceObject()
   if (MyVoiceObj==null) return;
   	
   if (n == 1)
      {MyVoiceObj.Loop(true);
      }
    else
      {MyVoiceObj.Loop(false);
      }
}


function GetVoice()
{
   MyVoiceObj = getMyVoiceObject()
   if (MyVoiceObj==null) return;
   
   return MyVoiceObj.GetVoice();
}


function SetVoice(voice)
{
   MyVoiceObj = getMyVoiceObject()
   if (MyVoiceObj==null) return;

   MyVoiceObj.SetVoice(voice);
}


/********************************************************************/
/*********************  FUNZIONI UTENTE  ****************************/
/********************************************************************/

/*
	Inserisce un oggetto MyVoice nella pagina html con i seguenti parametri:
	 ______________________________________________________________________________________
	| id		 | Identificativo														   |
	| larghezza  | Larghezza in pixels													   |
	| lunghezza  | Lunghezza in pixels													   |
	| visibile   | true (Default) = visibile ,  false=nascosto							   |
	| src		 | URL del documento caricato in fase di creazione						   |
	| indbase	 | indirizzo di base del sito											   |
	| autostart	 | riproduzione del doc. caricato subito dopo la creazione (Deafult false) |
	| ram		 | Carica i difoni in ram (Default false)								   |
	| azienda    | dato fornito in seguito alla registrazione del prodotto				   |
	| dominio	 | dato fornito in seguito alla registrazione del prodotto				   |
	 --------------------------------------------------------------------------------------
	 
    Di questi parametri solo i primi tre (id, larghezza e lunghezza) sono obbligatori.
    Tutti gli altri hanno dei valori di default.
*/
function CreaOggettoMyVoice(id,visibile)
{
	width=widthDefault
	height=heightDefault
	if (visibile=='false')
	  {
	  	width=1
		height=1
	  }
	  
	InsertMyVoiceObject(id,width,height,visibile)
}


/*function CreaOggettoMyVoice2(id,larghezza,altezza,visibile,src,indbase,autostart,ram,azienda,dominio)
{
	InsertMyVoiceObject(id,larghezza,altezza,visibile,src,indbase,autostart,ram,azienda,dominio)
}*/


/*
	Carica l'url specificato nell'oggetto; 
*/
function CaricaURL(url)
{  
   SetSource(url);
}


/** 
	Le tre funzioni seguenti riproducono rispettivamente:
	- Il testo contenuto nell'url (ParlaURL);
	- Il testo passato come parametro (ParlaTesto)
	- Il testo contenuto nell'url caricato nell'oggetto myvoice (Riproduci); 
		tale url può essere caricato usando la funzione CaricaURL oppure passandolo 
		con il parametro src in fase di creazione dell'oggetto MyVoice 
	Inoltre le tre funzioni hanno due parametri opzionali, speaker e profilo, utilizzati, 
	rispettivamente, per specificare lo speaker che si vuole utilizzare per la riproduzione, 
	e sotto quale profilo la riproduzione è ritenuta valida.
*/
function ParlaURL(url,speaker,profilo)
{
	if (!manageSpeakerProfile(speaker,profilo)) return;
	
	SpeakURL(url);
}



function ParlaTesto(text,speaker,profilo)
{
   if (!manageSpeakerProfile(speaker,profilo)) return;

   SpeakText(text)
}


function Riproduci(speaker,profilo)
{
   if (!manageSpeakerProfile(speaker,profilo)) return;
	
   Play();
}


/*
	I tre metodi seguenti hanno lo stesso significato delle tre precedenti.
	L'unica differenza è che queste sono utilizzate per poter inserire un "RITARDO", 
	dopo il quale la riproduzione può iniziare.
	Un possibile utilizzo si ha quando si vogliono concatenare testi provenienti da fonti
	diverse; in questo caso il primo testo viene riprodotto subito, l'altro dopo il ritardo specificato;
	Un altro utilizzo è quando si vogliono concatenare testi utilizzando profili o speaker 
	diversi, etc... 
*/
function ParlaURLDopo(url,ritardo,speaker,profilo)
{
	SpeakAtEnd(url,ritardo,speaker,profilo,null,'url')
}


function ParlaTestoDopo(testo,ritardo,speaker,profilo)
{
	SpeakAtEnd(testo,ritardo,speaker,profilo,null,'text')
}


function RiproduciDopo(ritardo,speaker,profilo)
{
	SpeakAtEnd(' ',ritardo,speaker,profilo,null,'play')
}


/*
	I tre metodi seguenti, come le precedenti terne di metodi, servono, rispettivamente, a
	riprodurre il testo riferito da un URL, il testo passato come parametro, o quello 
	caricato nell'oggetto MyVoice.
	La riproduzione, però, in questo caso, inizia solo se l'oggetto MyVoice no sta già 
	riproducendo qualcosa.
	Un utilizzo possibile è quello di utilizzarlo quando si raccoglie l'evento 'onmouseover' 
	su un oggetto grande, quale un'intera tabella; in questo caso, infatti, se, durante la 
	riproduzione delle informazioni legate alla tabella, l'utente muove il mouse, pur 
	restando all'interno della tabella, viene rilevato un nuovo evento onmouseover e quindi 
	la riproduzione ricomincia da capo. Con i tre metodi seguenti si evita questo inconveniente.
*/
function ParlaURLCond(url,speaker,profilo)
{
	SpeakIfNotRunning(url,speaker,profilo,'url')
}


function ParlaTestoCond(testo,speaker,profilo)
{
	SpeakIfNotRunning(testo,speaker,profilo,'text')
}


function RiproduciCond(speaker,profilo)
{
	SpeakIfNotRunning(' ',speaker,profilo,'play')
}


/*
	Aggiunge un nuovo speaker
*/
function AggiungiSpeaker(id,tipovoce,velocita,tono)
  {
  if (getSpeaker(id,'noalert')!=null) 
	{
	alert('Speaker '+ id + 'già esistente')
	return;
	}
	
  var n = speakers.length
  speakers[n] = new Array()
  speakers[n][0]= id
  speakers[n][1]= tipovoce
  speakers[n][2]= velocita
  speakers[n][3]= tono
  }

/*
	Modifica le caratteristiche dello speaker di default
*/
function ImpostaSpeakerDefault(tipovoce,velocita,tono)
{
	ModificaSpeaker('default',tipovoce,velocita,tono);
}

/*
	Modifica le caratteristiche di uno speaker già esistente
*/
function ModificaSpeaker(id,tipovoce,velocita,tono)
  {
  var sp = getSpeaker(id)
  
  if (sp!=null)
	  {
	  sp[1]= tipovoce
	  sp[2]= velocita
	  sp[3]= tono
	  }
  }


/* 
	b=false -> MyVoice disabilitato; b=true -> MyVoice abilitato
*/
function AbilitaMyVoice(b)
{
   setAudio(b); 
}


/*
	dice se MyVoice è abilitato o meno
*/
function MyVoiceAbilitato()
{
	return getAudio();
}

/*
	Imposta il profilo corrente
*/
function FissaProfiloCorrente(id)
{
	currProfile=id;
}

/*
	Restituisce il profilo corrente
*/
function DammiProfiloCorrente(id)
{
	return currProfile;
}

/*
	Aggiunge un nuovo profilo
*/
function AggiungiProfilo(id)
{
	if (existsProfile(id)) 
		{alert('Profilo ' + id + ' già presente');
		}
	else
		{
		var n = profiles.length;
		profiles[n]=id;
		}
}


/********************************************************************/
/********************************************************************/
/********************  FUNZIONI DI SUPPORTO  ************************/
/********************************************************************/
/********************************************************************/
function SpeakAtEnd(url,time,speaker,profile,timest,type)
{
//alert('SpeakAtEnd('+url+','+time+','+speaker+','+profile+','+timest+','+type+')')
   if (timest!=null)
     {if (timest!=timestamp) return;
     }
   var sp = speaker
   var pr = profile
   if (sp!=null) sp = '"'+sp+'"' 
   else sp = null;
   if (pr!=null) pr = '"'+pr+'"' 
   else pr = null;
   
   if (timest==null)
      {window.setTimeout('SpeakAtEnd("'+url+'",'+ time +','+ sp +',' + pr + ',"' + timestamp + '","'+ type+'")',time)
      }
   else
      {     
	  MyVoiceObj = getMyVoiceObject();
	  if (MyVoiceObj!=null)
		 {
		 if (!MyVoiceObj.isRunning())
            {
			if (type=='url') ParlaURL(url,speaker,profile);
			else if (type=='text') ParlaTesto(url,speaker,profile);
				 else if (type=='play') Riproduci(speaker,profile);
			}
		 else
            {window.setTimeout('SpeakAtEnd("'+url+'",'+ time +','+ sp +',' + pr + ',"' + timestamp + '","'+ type+'")',500)
		    }
		}	
      }
   return;
}


function SpeakIfNotRunning(url,speaker,profile,type,ok)
{
/*   if (ok==null)
      {
      var sp = speaker
	  var pr = profile
	  if (sp!=null) sp = '"'+sp+'"' 
	  else sp = null;
      if (pr!=null) pr = '"'+pr+'"' 
      else pr = null;
      window.setTimeout('SpeakIfNotRunning("'+url+'",'+ sp +',' + pr + ',"'+ type+'","go")',100)
      }
   else
      {     
	  MyVoiceObj = getMyVoiceObject();
	  if (MyVoiceObj!=null)
		 {
		 if (!MyVoiceObj.isRunning())
            {
			if (type=='url') ParlaURL(url,speaker,profile);
			else if (type=='text') ParlaTesto(url,speaker,profile);
				 else if (type=='play') Riproduci(speaker,profile);
			}
		}	
      }*/
   if (!nostop)
	  {
	  if (type=='url') ParlaURL(url,speaker,profile);
			else if (type=='text') ParlaTesto(url,speaker,profile);
				 else if (type=='play') Riproduci(speaker,profile);
	  nostop=true;
	  }
   return;
}



function setAudio(b)
{
   audio = b;
   if (!b) Stop();
}

function getAudio()
{
   return audio;
}


function getMyVoiceObject()
{
   timestamp = new Date().toGMTString()
   if (myVoiceObj==null)
     {myVoiceObj=setMyVoiceObject(MyVoiceId)
     }
   return myVoiceObj;
}


function setMyVoiceObject(objname)
{
   myVoiceObj = InternetExplorer ? document.all(objname) : document.embeds(objname);
   return myVoiceObj;
}


function getSpeaker(id,yy)
{
   var tp=-1
   for (var i=0; i<speakers.length && tp==-1; i++)
      {if (speakers[i][0] == id) tp=i
      }
   if (tp == -1)
      {
      if (yy==null) alert('Speaker ' + id + ' inesistente.');
      return null
      }
   else
      {return speakers[tp];
      }
}


function setSpeaker(id)
{
   Stop();
   if (id==null)
      {
      resetSpeaker();
      return;
      }
   if (id==currSpeaker) return;
   var pp = getSpeaker(id)
   if (pp!=null)
      {

      var obj = getMyVoiceObject();     
      obj.SetVoice(pp[1]);
      obj.SetSpeed(pp[2]);
      obj.SetTone(pp[3]);
      }
   currSpeaker=id
}


function resetSpeaker()
{
   if (currSpeaker!='default' || reset>5)
      {
      setSpeaker('default')
	  reset=0
      }
   else reset++
}


function listSpeakers()
{
   var s='Elenco degli Speakers.\n \nSpeaker         Voice     Speed     Tone\n'
   for (var i=0; i<speakers.length; i++)
      {
      s=s +speakers[i][0]
      for (var j=0; j<(16-speakers[i][0].length);j++) s=s+' ';
      s=s+speakers[i][1]
      for (var j=0; j<(13-speakers[i][1].length);j++) s=s+' ';
      s=s+speakers[i][2]
      for (var j=0; j<11;j++) s=s+' ';
      s=s+speakers[i][3]+'\n'
      }
    alert(s);
}


function existsProfile(id)
{
   if (id==null) return false;
   for (var i=0; i<profiles.length; i++)
      {if (profiles[i] == id) return true
      }
   return false;
}


function listProfiles()
{
   var s = 'Profili presenti: \n'
   for (var i=0; i<profiles.length; i++)
      {s = s+profiles[i]+'\n'
      }
   alert(s)
}


//Gestisce i profili e gli speakers;
//ritorna true se myvoice deve riprodurre qualcosa; false se si deve interrompere
function manageSpeakerProfile(speaker,profile)
{
	if (!audio) return false;
	if (nostop)
	   {
	   if (getMyVoiceObject().isRunning())
			{return false;
			}
	   else nostop=false;	
	   }
	
	var sp = speaker;
	var pr = profile;
	
	if (pr==null && existsProfile(speaker))
		{
		pr = speaker;
		sp=null;
		}
	
	setSpeaker(sp);
	return (currProfile==pr || pr==null);
}

/********************************************************************/
/********************************************************************/
/********  FUNZIONI PER IL CARICAMENTO DI UN OGGETTO MYVOICE  *******/
/********************************************************************/
/********************************************************************/

function IsMyVoicePluginInstalled()
{
   if (navigator.appName == 'Netscape')
      {//alert("Netscape");
      if (navigator.platform == "Win32")
         {
         if (navigator.plugins["MyVoice Plugin "])
            {//alert("Netscape Win32 - Spazio");
            return (1);
            }
          else
             if (navigator.plugins["MyVoice Plugin"])
                {//alert("Netscape Win32 - NO Spazio");
                return (1);
                }
             else
                {return (0);
                }
         }
      else //platform Mac
         if (navigator.plugins["MyVoice Plugin"])
            {//alert("Netscape Mac");
            return (1);
            }
         else
            {//alert("Netscape - NO OS");
            return (0);
            }
      }
   else if (navigator.appName == "Microsoft Internet Explorer")
      {//alert("Internet Explorer");
      if (navigator.platform == "Win32")
         {//alert("Internet Explorer Win32"+"  "+CheckIEControl());
         return (CheckIEControl()); //CheckIEControl è in vbscripts.vbs
         }
      else
         if (navigator.platform == "MacPPC")
            {
            if (navigator.plugins["MyVoice Plugin"])
               {//alert("Internet Explorer Mac");
               return (1);
               }
            else
               {return (0);
               }
            }
          else
             {return (0);
             }
      }
}


function MyVoiceUsable()
{
   var UseMyVoice = 0
   gMyVoiceTalk = IsMyVoicePluginInstalled();

   if ( gMyVoiceTalk )
     {
     if (navigator.platform == "Win32")
        {
        if ((navigator.appName == "Netscape") & (bVer < 3)) //navigator.appVersion.substring(0,1) != "3"))
           {MacOSNetscapeAlert();
           }
        else
           if ((navigator.appName == "Netscape")||(navigator.appName == "Microsoft Internet Explorer"))
              {UseMyVoice = 1;
              }
           else
              {WinOSAlert();
              }
        }
     else
        if (navigator.platform == "MacPPC")
           {
           if (navigator.appName == "Netscape")
              {
              if (bVer > 3) //(navigator.appVersion.substring(0,1) != "3")
                 {UseMyVoice = 1;
                 }
              else
                 {MacOSNetscapeAlert();
                 }
              }
           else
              {MacOSNetscapeAlert();
              }
           }
        else
           {OSAlert();
           }
     }
  else
     {NoMyVoiceAlert();
     }

   return UseMyVoice;
}


function InsertMyVoiceObject(id,width,height,layout,src,codebase,autostart,ram,company,domain)
   {
   if (layout==null) layout=layoutDefault
   if (codebase==null) codebase=codebaseDefault
   if (src==null) src=srcDefault
   if (ram==null) ram=ramDefault
   if (autostart==null) autostart=autostartDefault
   if (company==null) company=companyDefault
   if (domain==null) domain=domainDefault
   //width="138" height="19"

   if (MyVoiceUsable())
     {
	  
     if (speakers.length==0) AggiungiSpeaker('default','male',5,5);
	 if (profiles.length==0) AggiungiProfilo('default');

     if (MyVoiceId==null) MyVoiceId=id
     
     // Use MyVoice
	 document.write('<OBJECT classid="clsid:4866B425-40EA-11D3-97D2-0060085F3E07"');
     document.write(' codebase="'+codebase+'"');
     document.write(' ID="' +id+ '" WIDTH="' + width + '" HEIGHT="' + height + '">');
     document.write('<PARAM NAME="SRC" VALUE="' + src + '">');
     document.write('<PARAM NAME="LANGUAGE" VALUE="ita">');
     document.write('<PARAM NAME="VOICE" VALUE="' + speakers[0][1] + '">');
     document.write('<PARAM NAME="RAM" VALUE="' + ram + '">');
     document.write('<PARAM NAME="SPEED" VALUE="' + speakers[0][2] + '">');
     document.write('<PARAM NAME="TONE" VALUE="' + speakers[0][3] + '">');
     document.write('<PARAM NAME="LOOP" VALUE="false">');
     document.write('<PARAM NAME="AUTOSTART" VALUE="' + autostart + '">');
     document.write('<PARAM NAME="LAYOUT" VALUE="' + layout + '">');

     document.write('<PARAM NAME="COMPANY" VALUE="' + company + '">');
     document.write('<PARAM NAME="DOMAIN" VALUE="' + domain + '">');
     document.write('<PARAM NAME="SN" VALUE="' + serial + '">');

     document.write('<EMBED TYPE="plugin/x-myvoice" SRC="' + src + '"');
     document.write(' NAME="'+id+'" WIDTH="' + width + '" HEIGHT="' + height + '"');
     document.write(' LANGUAGE="ita"');
     document.write(' VOICE="' + speakers[0][1] + '"');
     document.write(' RAM="' + ram  + '"');
     document.write(' SPEED="' + speakers[0][2] + '"');
     document.write(' TONE="' + speakers[0][3] + '"');
     document.write(' LOOP="false"');
     document.write(' AUTOSTART="' + autostart +  '"');
     document.write(' LAYOUT="' + layout + '"');

     document.write(' COMPANY="' + company + '"');
     document.write(' DOMAIN="' + domain + '"');
     document.write(' SN="'+ serial + '">');
	
     document.write("</EMBED>");
     document.write("</OBJECT>");
	
	 
     }
   else
     {
     if (debug) 
		{
		nomyv = false;
		/*
		document.write('<BR><BR><B>INSTALLAZIONE NON CORRETTA</B><BR><BR>');
		document.write('Prova a reinstallare il Plugin o ActiveX<BR>');
		document.write('Se il problema persiste contattare il supporto tecnico.<BR>');
		*/
		//document.write('no plugin');
		}
     }
}



/********************************************************************/
/********************************************************************/
/************  FUNZIONI UTILIZZATE IN CASO DI ERRORE  ***************/
/********************************************************************/
/********************************************************************/

function MacOSNetscapeAlert()
{
   before();

   document.write("Mi dispiace, attualmente <i>MyVoice&reg; Plugin</i>  non &egrave; disponibile per il tuo browser. <BR> <BR>La versione MacOS&reg; di <i>MyVoice&reg; Plugin</i> attualmente &egrave; disponibile solo per Netscape versione 3.X.");

   after();
}


function WinOSAlert()
{
   before();

   document.write("Mi dispiace, attualmente <i>MyVoice&reg; Plugin</i> non &egrave; disponibile per il tuo browser. <BR> <BR>La versione Windows di <i>MyVoice&reg; Plugin</i> &egrave; disponibile solo per Netscape e IE.");

   after();
}

function OSAlert()
{
   before();

   document.write("Mi dispiace, attualmente <i>MyVoice&reg; Plugin</i> non &egrave; disponibile per il tuo browser. <BR> <BR>La versione di <i>MyVoice&reg; Plugin</i> attualmente &egrave; disponibile solo per Windows e MacOS.");

   after();
}

function NoMyVoiceAlert()
{
	nomyv = false;
	/*
   before();

   document.write("Mi dispiace, <i>MyVoice&reg; Plugin</i> non &egrave; installato.<BR>");
   document.write("Se vuoi avere aiuti sonori, vai nell'area Download e scarica MyVoice&reg; Plugin.");

   after();
   */
}

function before()
{
   document.write('<TABLE WIDTH="185">');
   document.write('	<TR ALIGN="left" VALIGN="top">');
   document.write('		<TD BGCOLOR="#000099" ALIGN="left" VALIGN="middle">');
   document.write('<IMG SRC="img/alert.gif" ALT="Alert" WIDTH="17" HEIGHT="17" ALIGN="middle">');
   document.write('<FONT SIZE="1" FACE="Verdana" COLOR="#FFFFFF">');
   document.write('			ATTENZIONE');
   document.write('</FONT>');
   document.write('		</TD>');
   document.write('	</TR>');
   document.write('	<TR ALIGN="center" VALIGN="top">');
   document.write('		<TD BGCOLOR="#FFFF77" ALIGN="left">');
   document.write('<FONT SIZE="1" FACE="Verdana" COLOR="#000066">');
}


function after()
{
   document.write('</FONT>');
   document.write('		</TD>');
   document.write('	</TR>');
   document.write('</TABLE>');
}
/***************************************************************************/