// Initialization of arrays for:
// countrieslinks.js and
//newspaperlinks.js
//
// When this six lines were on their respective files it did not work!
// I identified that especial characters (accents, etc) mess up the file
// on the server side (UNIX)
//

Names = new Array();
Links = new Array();

Newsp = new Array();
Nplink = new Array();

Topic = new Array();
TLink = new Array();

// Add functions that were previously on the link.html file

function BuildLinksTopic(num)
{
 for(ctr=0; ctr< Topic[num].length; ctr++)
   {
     document.cascadebox.TopicsBox.options[ctr]= new Option(Topic[num][ctr], TLink[num][ctr]);
   }
   document.cascadebox.TopicsBox.length= Topic[num].length;
   document.cascadebox.TopicsBox.selectedIndex= -1;
}

function goLinkTopic(){ 
  wheretogo =document.cascadebox.TopicsBox.options[document.cascadebox.TopicsBox.selectedIndex].value;
  if(wheretogo != '')
    { 
     popup('guest', wheretogo);
     document.cascadebox.TopicsBox.selectedIndex= -1;
    } 
}
	 
function BuildLinks(num)
{
 for(ctr=0; ctr< Names[num].length; ctr++)
   {
    document.cascadebox.Linksbox.options[ctr]= new Option(Names[num][ctr], Links[num][ctr]);
   }
   document.cascadebox.Newspapersbox.length= Newsp[num].length;  
   document.cascadebox.Newspapersbox.selectedIndex=-1; 

 for(ctrb=0; ctrb< Newsp[num].length; ctrb++)
   {
     document.cascadebox.Newspapersbox.options[ctrb]= new Option(Newsp[num][ctrb], Nplink[num][ctrb]);
   }
   document.cascadebox.Linksbox.length= Names[num].length;
   document.cascadebox.Linksbox.selectedIndex= -1;  
}

function goLink(){ 
  wheretogo =document.cascadebox.Linksbox.options[document.cascadebox.Linksbox.selectedIndex].value;
  if(wheretogo != '')
    { 
     popup('guest', wheretogo);
     document.cascadebox.Linksbox.selectedIndex= -1;
    } 
}

function goNewspaper(){ 
  wheretogo =document.cascadebox.Newspapersbox.options[document.cascadebox.Newspapersbox.selectedIndex].value;
  if(wheretogo != '')
    { 
     popup('Newspaper', wheretogo);
    document.cascadebox.Newspapersbox.selectedIndex= -1;
     } 
}
