//document.write ("enter javascript" + "<br>");
//we need serval functions --- // one --> to build a list of urls, descriptions, // two --> fetch a cookie if it exists // three ---> select the correct element from the array ---
// needs to consider if there is no cookie how to select the correct one
// ie such as total int (entries / day of month) // four ---> update the cookie ---
// two three and four are all done in cookie land at the top of the script --
// so it was only really necessary
//**********************************
Cur_Cookie_Num = 4;
Cur_Cookie_String = "4";
Max_Number = 19;
//********** Note if you change the number of entries ---- 
//********** Max_Number will also need to be changed 
//********** 
function XstoreCookies()
{ mydate = new Date(); myvar = mydate.getTime();
myvar = myvar + 1000*60 * 60 * 24 * 90;
myndate = new Date(myvar);
document.cookie = "current_number=" + Cur_Cookie_String + "; expires=" + myndate; }
function cookieVal(cookieName, CookieString) {
var startLoc = CookieString.indexOf(cookieName);
if (startLoc == -1) {
return(""); // No such cookie
}
var sepLoc = CookieString.indexOf("=", startLoc);
var endLoc = CookieString.indexOf(";", startLoc);
if(endLoc == -1) {
// last one has no ";"
endLoc = CookieString.length;
}
return(CookieString.substring(sepLoc+1, endLoc));
}
function presetValues()
{
var cookies = document.cookie; Cur_Cookie_String = cookieVal("current_number", cookies);
if (Cur_Cookie_String == "") {
var randnum = Math.floor(Math.random() * Max_Number) ;
Cur_Cookie_String = randnum.toString();
Cur_Cookie_Num = randnum;
}
else if (isNaN(Cur_Cookie_String))
{
var randnum = Math.floor(Math.random() * Max_Number) ;
var randnum = randnum - 1;
Cur_Cookie_String = randnum.toString();
Cur_Cookie_Num = randnum;
} else
{
if (!isNaN(Cur_Cookie_String))
{
Cur_Cookie_Num = parseInt(Cur_Cookie_String);
Cur_Cookie_Num = Cur_Cookie_Num + 1;
if (Cur_Cookie_Num > Max_Number) { Cur_Cookie_Num = 0;} Cur_Cookie_String = Cur_Cookie_Num.toString();
}
} }
//**********************************
array_number = Max_Number + 1;
url_ref_array = new Array(array_number);
url_title_array = new Array(array_number);
url_description_array = new Array(array_number);
function loadarray() { //************************ Note //******* if you add entries you must change Max_Number //******* which is near the top //*************************
//*********** Note that there are three arrays that need to be update
//*********** together ----
// - url_ref_array, url_title_array, and url_description_array //********************
url_ref_array[0] = "http://www.inece.org/newsletter/";
url_ref_array[1] = "http://www.inece.org/manual/";
url_ref_array[2] = "http://www.inece.org/conferenceproceedings.html";
url_ref_array[3] = "http://www.inece.org/enforcementprinciples.html";
url_ref_array[4] = "http://www.inece.org/illegaltimber";
url_ref_array[5] = "http://www.inece.org/wssd.html";
url_ref_array[6] = "http://inece.org/links_pages/onlineresourcesozone.html";
url_ref_array[7] = "http://www.inece.org/links_pages/onlineresourcesCost.html";
url_ref_array[8] = "http://www.inece.org/links_pages/onlineresourcesEnvironmentalagencies.html";
url_ref_array[9] = "http://www.inece.org/library/presentations.html";
url_ref_array[10] = "http://www.inece.org/links_pages/onlineresourcesEIA.html";
url_ref_array[11] = "http://www.inece.org/links_pages/onlineresourcesHazwastes.html";
url_ref_array[12] = "http://www.inece.org/links_pages/onlineresourcesInspection.html";
url_ref_array[13] = "http://www.inece.org/links_pages/onlineresourcesInspection_statute.html";
url_ref_array[14] = "http://www.inece.org/forumspublicaccess_documents.html"; url_ref_array[15] = "http://www.inece.org/forumspublicaccess_citizen.html";
url_ref_array[16] = "http://www.inece.org/regions.html";
url_ref_array[17] = "http://www.inece.org/library/law.html";
url_ref_array[18] = "http://www.inece.org/library/training.html";
url_ref_array[19] = "http://www.inece.org/secretariat.html";
url_ref_array[20] = "http://www.inece.org/conference/7/";
url_title_array[0] = "INECE Newsletters";
url_title_array[1] = "Conducting Environmental Compliance Inspections - Training Manual";
url_title_array[2] = "Conference Proceedings";
url_title_array[3] = "Enforcement Principles";
url_title_array[4] = "INECE-EIA Workshop: Controlling Transboundary Trade in Illegally Produced Logs and Timber";
url_title_array[5] = "World Summit on Sustainable Development";
url_title_array[6] = "Online Resources – Ozone Depleting Substances";
url_title_array[7] = "Benefits and Costs of Environmental Enforcement Bibliography";
url_title_array[8] = "Environmental Agencies of the World";
url_title_array[9] = "INECE Presentation Archive";
url_title_array[10] = "Environmental Impact Assessment Links";
url_title_array[11] = "Hazardous Waste Resources";
url_title_array[12] = "Environmental Inspection Resources";
url_title_array[13] = "US Statute-Specific Self-Assessment Tools";
url_title_array[14] = "Public Access to Information Resources"; url_title_array[15] = "Access to Information, Citizen Right to Know, and Citizen Suits Resources";
url_title_array[16] = "INECE Regional Networks";
url_title_array[17] = "International Environmental Law and Treaty Resources";
url_title_array[18] = "INECE Training Documents";
url_title_array[19] = "A Mandate for Strenghtening Environmental Enforcement and Compliance";
url_title_array[20] = "INECE 7th International Conference (April, 2005)";
url_description_array[0] = "Visit INECE's most recent newsletter to hear about compliance and enforcement actions and the national and international level.";
url_description_array[1] = "This manual is an introduction to common skills needed for environmental compliance inspections where a determination of the facility's compliance status is required.";
url_description_array[2] = "The proceedings include papers solicited on special topics and country programs, opening speeches, results of workshop discussions, and conference evaluations.";
url_description_array[3] = "This text has been prepared to help individuals responsible for environmental protection design and implement compliance strategies and enforcement programs."; url_description_array[4] = "Links to all the presentations and background papers, including country reports, developed for the workshop on combatting trade in illegally produced timber and logs.";
url_description_array[5] = "This page describes INECE's role in the WSSD and subsequent enforcement-related events.";
url_description_array[6] = "Directory of Web links relating to compliance and enforcement mechanisms for ozone depleting substances.";
url_description_array[7] = "References and links to recent analyses of the costs and benefits of environmental enforcement and compliance.";
url_description_array[8] = "Web directory presents links to environmental agencies organized by region.";
url_description_array[9] = "Read presentations on INECE recent activities in this section of the International Environmental Compliance and Enforcement Library.";
url_description_array[10] = "Web directory presents links on environmental impact assessment.";
url_description_array[11] = "Web directory presents links relating to compliance and enforcement mechanisms for hazardous waste.";
url_description_array[12] = "Web directory presents links relating to inspections to ensure environmental compliance.";
url_description_array[13] = "Web directory of tools for US environmental inspectors. Organized by US statute (e.g., Clean Water Act, Clean Air Act, CERCLA, FIFRA, and RCRA)";
url_description_array[14] = "Directory of Web links related to public access to information. Topics include networks, public involvement, legislative authority, citizen enforcement, and articles."; url_description_array[15] = "Directory of Web links related to citizen enforcement. Organized by region";
url_description_array[16] = "INECE promotes the development of regional networks to carry out INECE's mission and goals at the regional and national levels in Africa; North, South, and Central America; Asia, and Europe."; url_description_array[17] = "Web page featuring links to environmental law libraries and legal resources.";
url_description_array[18] = "Browse INECE's library of documents related to compliance and enforcement training.";
url_description_array[19] = "Durwood Zaelke, Director of the INECE Secretariat, summarizes the need to strengthen environmental enforcement and compliance.";
url_description_array[20] = "The Conference web page features and interactive conference program, links to news stories about the conference, the final conference statement, and the conference proceedings.";
} // end function loadarray
//document.write("before loadarray" + "<br>");
loadarray();
presetValues();
XstoreCookies();
//document.write("after loadarray" + "<br>");
url_ref = url_ref_array[Cur_Cookie_Num]; url_title = url_title_array[Cur_Cookie_Num];
url_description = url_description_array[Cur_Cookie_Num];
// document.write ("after Randnum");
// document.write (randnum);
// document.write (url_ref);
// document.write (url_title);
document.write ("<td><a href=" );
document.write (url_ref);
// document.write (" TARGET=NONE"); // this makes it open a new window. undid this feature---
document.write ("><font color=#0000cc");
document.write ( " size=2 ");
document.write ("face=Verdana, Arial, Helvetica, sans-serif>"); document.write (url_title);
document.write ("</font></a></td>");
document.write ("</tr>");
document.write ("<tr>");
document.write ("<td><font color=#666666 size=1 ");
document.write ("face=Verdana, Arial, Helvetica, sans-serif>");
document.write (url_description); document.write ("</font></td>");
document.write ("</tr>");
