<!--

//Include sitedata.js file which has urls of all the sites

document.write('<SCRIPT SRC="/scripts/sitedata.js"><\/SCRIPT>');


//to add a country, add it to this if statement as an option
//if you change the numbering, be sure to change it in the loadHomeBusiness function

//To change the address of a page for a country or add pages to a country, add it to
//the loadHomeBusiness function


function changeSite()
{
   var cindex = document.siteSelect.country.selectedIndex;
   var lindex = document.siteSelect.homeBusiness.selectedIndex;

   if ( !(cindex == 0 ) && !(lindex == 0 ) )
   {
   	
   	validatecookie(cindex-1,lindex-1);
       /*var locval= document.siteSelect.homeBusiness.options[lindex].value;
       var expires = new Date();
	   expires.setTime (expires.getTime() + (356 * 24 * 60 * 60 * 1000)); // 1 year from now
       document.cookie = "url=" + escape (locval) + "; expires=" + expires.toGMTString() +  "; path=/";      
       window.document.location = locval;
       document.siteSelect.country.selectedIndex=0;
       document.siteSelect.homeBusiness.selectedIndex=0;*/
   }
   
  
} 

function loadHomeBusiness()
{
//To add a country add it to the if statement
//To change the addresses or add sites for a country, add it to the dropdown

var poleindex = document.siteSelect.country.selectedIndex - 1;

  if ( document.siteSelect.country.selectedIndex !=0 )
    {

    	document.siteSelect.homeBusiness.options.length = sites[poleindex].length+1;
	document.siteSelect.homeBusiness.options[0].value = "null";
        document.siteSelect.homeBusiness.options[0].text = "Select Lighting Site                                   ";
    
    	for ( var i=0; i < sites[poleindex].length; ++i )
      	 {
      		document.siteSelect.homeBusiness.options[i+1].value=sites[poleindex][i][1];
      		document.siteSelect.homeBusiness.options[i+1].text=sites[poleindex][i][0];
      	 }
      }
      
        else
          {    
	                document.siteSelect.homeBusiness.options.length = 6;
		        document.siteSelect.homeBusiness.options[0].text = "Select Lighting Site                                   ";
        		document.siteSelect.homeBusiness.options[0].selected = true;
        		document.siteSelect.homeBusiness.options[1].text = "- - - - - - - - - - - - - - - - - -";
        		document.siteSelect.homeBusiness.options[2].text = "<Select Global Region>";
        		document.siteSelect.homeBusiness.options[3].text = "   ";
        		document.siteSelect.homeBusiness.options[4].text = "   ";
        		document.siteSelect.homeBusiness.options[5].text = "   ";

    	}
      
} //end of function


//-->