///////////////////Start of main2
//load for displaying all
var Znum=T.length-1
var artz=1
var mysel=0
var myhits =1
/// chunks for testing for categories
var chunks = new Array()
// fill with blanks max is 30 
	for (iy=0;iy<31;iy++){
	chunks[iy]=""  // set to blank to display all
	}
//catbits = array for article categories
   var catbits = new Array()
// fill with blanks max is 30
	for (iy=0;iy<21;iy++){
	catbits[iy]=""  // set to blank to display all
	}

// this used to mark records for display => 1 for display
var Z = new Array()
for (iy=0;iy<Znum+1;iy++){
Z[iy]=1  // set to 1 to display all
}
//identify type displayed
var mydisplay=1
//end load
var hpos=0 // header display position
var bpos=0 // header display position
var dpos=1 // detail page position
var numpara = 1 //number of paragraphs in article
////
var cat0 = new Array();
cat0[0]="Wheat  ";
cat0[1]="Wool  ";
cat0[2]="Wine  ";
cat0[3]="Olives ";
cat0[4]="Natural Resources  ";
cat0[5]="Environment ";
cat0[6]="Organic Foods";
cat0[7]="Genetically Modified";
cat0[8]="Water  ";
cat0[9]="Exit";
cat0[10]="a22";
cat0[11]="a25";
cat0[12]="a13";
cat0[13]="a16";
cat0[14]="a37";
cat0[15]="a42";
cat0[16]="a11";
cat0[17]="a12";
cat0[18]="a40";


var cat1 = new Array();
cat1[0]="Machinery ";
cat1[1]="Farm Design/Planning";
cat1[2]="Farm Management ";
cat1[3]="Chemicals/Fertiliser ";
cat1[4]="All Farm Design/Manage";
cat1[5]="Exit";
cat1[10]="a01";
cat1[11]="a02";
cat1[12]="a72";
cat1[13]="a03";
cat1[14]="a01a02a72a03";

var cat2 = new Array();
cat2[0]="Groups/Organisations";
cat2[1]="Politics ";
cat2[2]="Employment ";
cat2[3]="Finance/Econ ";
cat2[4]="Trade/Marketing ";
cat2[5]="All Politics/Finance";
cat2[6]="Exit";
cat2[10]="a04";
cat2[11]="a05";
cat2[12]="a06";
cat2[13]="a07";
cat2[14]="a08";
cat2[15]="a04a05a06a07a08";

var cat3 = new Array();
cat3[0]="Human Health";
cat3[1]="Nutrition ";
cat3[2]="Organic ";
cat3[3]="GMO/Genetics ";
cat3[4]="All Health/Food/GMO ";
cat3[5]="Exit";
cat3[10]="a09";
cat3[11]="a10";
cat3[12]="a11";
cat3[13]="a12";
cat3[14]="a09a10a11a12";

var cat4 = new Array();
cat4[0]="Wine/Grapes ";
cat4[1]="Tea/Coffee ";
cat4[2]="Cotton ";
cat4[3]="Olives ";
cat4[4]="Vegetables ";
cat4[5]="Flowers";
cat4[6]="Herbs ";
cat4[7]="Fruit/Nut ";
cat4[8]="All Horticulture ";
cat4[9]="Exit";
cat4[10]="a13";
cat4[11]="a14";
cat4[12]="a15";
cat4[13]="a16";
cat4[14]="a17";
cat4[15]="a75";
cat4[16]="a76";
cat4[17]="a18";
cat4[18]="a13a14a15a16a17a18a75a76";//add others

var cat5 = new Array();
cat5[0]="Legume/pea/pulse";
cat5[1]="Sugar ";
cat5[2]="Tea Tree ";
cat5[3]="Oil Crops ";
cat5[4]="Native crops ";
cat5[5]="All Sugar & oil crops ";
cat5[6]="Exit";
cat5[10]="a19";
cat5[11]="a20";
cat5[12]="a77";
cat5[13]="a21";
cat5[14]="a78";
cat5[15]="a19a20a77a21a78";

var cat6 = new Array();
cat6[0]="Wheat ";
cat6[1]="Rice ";
cat6[2]="Maize ";
cat6[3]="Sorghum";
cat6[4]="Canola ";
cat6[5]="Other Grain ";
cat6[6]="All Grain";
cat6[7]="Exit";
cat6[10]="a22";
cat6[11]="a23";
cat6[12]="a74";
cat6[13]="a79";
cat6[14]="a82";
cat6[15]="a24";
cat6[16]="a22a23a74a79a82a24";

var cat7 = new Array();
cat7[0]="Wool/Sheep ";
cat7[1]="Dairy ";
cat7[2]="Beef ";
cat7[3]="Alpacha/Lama ";
cat7[4]="Pigs ";
cat7[5]="Poultry/emu/ostrich ";
cat7[6]="Goats ";
cat7[7]="Other Livestock/Vet";
cat7[8]="All Livestock";
cat7[9]="Exit";
cat7[10]="a25";
cat7[11]="a26";
cat7[12]="a27";
cat7[13]="a28";
cat7[14]="a29";
cat7[15]="a30";
cat7[16]="a80";
cat7[17]="a31";
cat7[18]="a25a26a27a28a29a30a80a31";

var cat18 = new Array();
cat18[0]="Feed/ Forage  ";
cat18[1]="Seed  ";
cat18[2]="Pasture  ";
cat18[3]="All Feed/Seed/Pasture  ";
cat18[4]="Exit";
cat18[10]="a32";
cat18[11]="a83";
cat18[12]="a84";
cat18[13]="a32a83a84";

var cat16 = new Array();
cat16[0]="Disease/Quarantine ";
cat16[1]="Weeds ";
cat16[2]="Pests ";
cat16[3]="All Pests/ Weeds";
cat16[4]="Exit";
cat16[10]="a33";
cat16[11]="a85";
cat16[12]="a86";
cat16[13]="a33a85a86";

var cat17 = new Array();
cat17[0]="Fish/Fisheries ";
cat17[1]="Aquaculture ";
cat17[2]="Marine/Mariculture  ";
cat17[3]="All Fish/Aqua/Marine ";
cat17[4]="Exit";
cat17[10]="a34";
cat17[11]="a87";
cat17[12]="a88";
cat17[13]="a34a87a88";

var cat19 = new Array();
cat19[0]="Energy ";
cat19[1]="Transport/Fuel ";
cat19[2]="Alternative/Solar/Wind ";
cat19[3]="All Energy & Transport ";
cat19[4]="Exit";
cat19[10]="a36";
cat19[11]="a56";
cat19[12]="a94";
cat19[13]="a36a56a94";

var cat8 = new Array();
cat8[0]="Weather/Flood/Drought ";
cat8[1]="Climate/ El nino ";
cat8[2]="Nat Resources/Sustain ";
cat8[3]="Catchment/Basin ";
cat8[4]="Land/Landscape/Use ";
cat8[5]="All Climate/Land";
cat8[6]="Exit";
cat8[10]="a35";
cat8[11]="a89";
cat8[12]="a37";
cat8[13]="a38";
cat8[14]="a90";
cat8[15]="a35a89a37a38a90";

var cat9 = new Array();
cat9[0]="Forest/wood";
cat9[1]="Water/Irrig/dams";
cat9[2]="River ";
cat9[3]="Mining ";
cat9[4]="Environment ";
cat9[5]="Salinity/Land degrad "
cat9[6]="All Land/Environment ";
cat9[7]="Exit";
cat9[10]="a39";
cat9[11]="a40";
cat9[12]="a91";
cat9[13]="a41";
cat9[14]="a42";
cat9[15]="a43";
cat9[16]="a39a40a91a41a42a43";

var cat10 = new Array();
cat10[0]="Tourism ";
cat10[1]="Sport/Leisure/Entertain ";
cat10[2]="All Tourism & Leisure ";
cat10[3]="Exit";
cat10[10]="a44";
cat10[11]="a45";
cat10[12]="a44a45"; 

var cat11 = new Array();
cat11[0]="IT/Internet/Web/";
cat11[1]="Software/ Online tools";
cat11[2]="Phone/TV/Commun ";
cat11[3]="All Communication ";
cat11[4]="Exit";
cat11[10]="a46";
cat11[11]="a92";
cat11[12]="a47";
cat11[13]="a46a92a47";

var cat12 = new Array();
cat12[0]="Community ";
cat12[1]="Women ";
cat12[2]="House/Living/Urban ";
cat12[3]="Culture/People/Social ";
cat12[4]="Craft/Home Industries ";
cat12[5]="Education/Youth ";
cat12[6]="Loc Markets/Shows/Fairs";
cat12[7]="All Commun & Education ";
cat12[8]="Exit";
cat12[10]="a48";
cat12[11]="a49";
cat12[12]="a50";
cat12[13]="a51";
cat12[14]="a52";
cat12[15]="a53";
cat12[16]="a54";
cat12[17]="a48a49a50a51a52a53a54";

var cat13 = new Array();
cat13[0]="New venture/Innovation ";
cat13[1]="New crops ";
cat13[2]="Outlook/Future ";
cat13[3]="Research/Development ";
cat13[4]="All Innovation/Ventures ";
cat13[5]="Exit";
cat13[10]="a55";
cat13[11]="a81";
cat13[12]="a57";
cat13[13]="a93";
cat13[14]="a55a81a57a93";

var cat14 = new Array();
cat14[0]="International ";
cat14[1]="Regional ";
cat14[2]="USA ";
cat14[3]="EU ";
cat14[4]="Japan ";
cat14[5]="Asia ";
cat14[6]="All International";
cat14[7]="Exit";
cat14[10]="a58";
cat14[11]="a59";
cat14[12]="a60";
cat14[13]="a61";
cat14[14]="a62";
cat14[15]="a63";
cat14[16]="a58a59a60a61a62a63";

var cat15 = new Array();
cat15[0]="New South Wales ";
cat15[1]="Victoria ";
cat15[2]="Queensland ";
cat15[3]="Western Australia ";
cat15[4]="South Australia ";
cat15[5]="Tasmania ";
cat15[6]="Northern Territory ";
cat15[7]="ACT ";
cat15[8]="All Australia ";
cat15[9]="Exit";
cat15[10]="a64";
cat15[11]="a65";
cat15[12]="a66";
cat15[13]="a67";
cat15[14]="a68";
cat15[15]="a69";
cat15[16]="a70";
cat15[17]="a71";
cat15[18]="a64a65a66a67a68a69a70a71";

var cat20 = new Array();
cat20[0]="All News - Latest";
cat20[1]="All News - Archive 1";
cat20[2]="All News - Archive 2";
cat20[3]="All News - Archive 3";
cat20[4]="All News - Archive 4";
cat20[5]="All News - Archive 5";
cat20[6]="All News - Archive 6";
cat20[7]="All News - Archive 7";
cat20[8]="All News - Archive 8";
cat20[9]="All News - Archive 9";
cat20[10]="Exit";

// this is the start of the program
var curRecord = 1;
var maxRecords = T.length-1;
var maxFields = 5;
var mybit = " ";
var artnum=0;
var delay=1;
var myfilt=""
var mysel=0;
//note current function does verticals => need to clear area
//detail

  function Dummy (){
  }

function Detail(myiz,doff) {
     // generally entered
    // check to find first one to display
    if ( Z[myiz]==1 ) {  
    	 artz=myiz
    	}else{
       //need to find first
       for (xx=1;xx<Znum+1;xx++){
            if (Z[xx]==1) {
                artz=xx
                break
            }
        } //for for
    } // found first if needed

    var myelem =""
    var mytext=""
    var mydiv = document.getElementById("List");
    var myoldp = document.getElementById("Listp");
    var mynewp = document.createElement("DIV")
    mynewp.id="Listp";
    var docfrag = document.createDocumentFragment();
    var myc =0
        mynum=myc
        myref="javascript:Dummy()"        
        myelem = document.createElement("A")
        docfrag.appendChild(myelem);
        myelem.setAttribute("href",myref)
        myelem.style.textDecoration="none"
        myelem.style.fontFamily="arial, helvetica, times"
        myelem.style.fontSize="9pt"
        myelem.style.lineHeight="12pt"
        myelem.style.fontWeight="bold"
        myelem.style.color= "blue"
        mytext = document.createTextNode(T[artz] )
        myelem.appendChild(mytext);
        docfrag.appendChild(myelem);
        // author
        myelem = document.createElement("DIV")
        docfrag.appendChild(myelem);
        myelem.style.fontFamily="arial, helvetica, times"
        myelem.style.fontSize="8pt"
        myelem.style.lineHeight="11pt"
        myelem.style.fontWeight="bold"
        myelem.style.color= "black"
        mytext = document.createTextNode(A[artz])
        myelem.appendChild(mytext);
        docfrag.appendChild(myelem);
        // Date
        myelem = document.createElement("DIV")
        docfrag.appendChild(myelem);
        myelem.style.fontFamily="arial, helvetica, times"
        myelem.style.fontSize="8pt"
        myelem.style.lineHeight="11pt"
        myelem.style.fontWeight="bold"
        myelem.style.color= "black"
        mytext = document.createTextNode(Dt[artz])
        myelem.appendChild(mytext);
        docfrag.appendChild(myelem);
        myelem = document.createElement("DIV")
        docfrag.appendChild(myelem);
        myelem.style.fontFamily="arial, helvetica, times"
        myelem.style.fontSize="8pt"
        myelem.style.lineHeight="11pt"
        myelem.style.fontWeight="bold"
        myelem.style.color= "black"
        myval=" "
			  for (x=1;x<30;x++){
			  myt="S"+eval(x)+"[" + artz +"]";
			  mytest=eval(myt)
			   if (mytest) {
			  	    if (x==1){
			  	 	myval=mytest
			  		}
			  	  else {
			  	  	   myval=myval+mytest
			  		}
			   } else {
			  	   break;
			   }
			   } //for loop
        Formatit();
        mytext = document.createTextNode(myval)
        myelem.appendChild(mytext);
        docfrag.appendChild(myelem);
        
        mynewp.appendChild(docfrag);
        mydiv.replaceChild(mynewp, myoldp)

         }
//end of detail

//brief

function Brief() {

    var myelem =""
    var mytext=""
    var mydiv = document.getElementById("List");
    var myoldp = document.getElementById("Listp");
    var mynewp = document.createElement("DIV")
    mynewp.id="Listp";
    var docfrag = document.createDocumentFragment();
    var myc =0
    for (ty=0;ty<Znum+1;ty++) {
        if (Z[ty]==0) {  //not listed for display skip
        	// bypass for
        }else{
        myname=T[myc]
        mynum=myc
        myref="javascript:Detail(" + myc + ",1)"
        //name
        myelem = document.createElement("A")
        docfrag.appendChild(myelem);
        myelem.setAttribute("href",myref)
        myelem.style.textDecoration="none"
        myelem.style.fontFamily="arial, helvetica, times"
        myelem.style.fontSize="9pt"
        myelem.style.lineHeight="12pt"
        myelem.style.fontWeight="bold"
        myelem.style.color= "blue"
        mytext = document.createTextNode(T[ty] )
        myelem.appendChild(mytext);
        docfrag.appendChild(myelem);
        myelem = document.createElement("DIV")
        docfrag.appendChild(myelem);
        myelem.style.fontFamily="arial, helvetica, times"
        myelem.style.fontSize="8pt"
        myelem.style.lineHeight="11pt"
        myelem.style.fontWeight="bold"
        myelem.style.color= "black"
        myval= ""+B1[myc]+B2[myc]+B3[myc]+B4[myc]+B5[myc]
        Formatit();
        mytext = document.createTextNode(myval)
        myelem.appendChild(mytext);
        docfrag.appendChild(myelem);
        
        } //end of test to display
        myc=myc+1
        
        } //end of loop
        
        mynewp.appendChild(docfrag); // blanks if none found at all
        mydiv.replaceChild(mynewp, myoldp)
  }
 // end of brief


    function Formatit () {
    mytemp="  " + myval;
    var re = /[.][ ]/g
    mytemp= mytemp.replace(re,"\n    ");
    var rrt = /[&]nbsp[;]/g
    mytemp= mytemp.replace(rrt,"")
    var rrt = /[<]BR[>]/g
    mytemp= mytemp.replace(rrt,"...\t\t\t\t\t\t\t")
    myval=mytemp;
    } 
    
    
    function textmod(elnam, newtext){
    var ttext = document.getElementById(elnam);
    var new_txt = document.createTextNode(newtext);
    ttext.replaceChild(new_txt, ttext.childNodes[0]);
  }
 
 //Heads

function Heads(offset) {
// change heading for news - note set at end of javascript need to be out of main

    var myelem =""
    var mytext=""
    var mydiv = document.getElementById("List");
    var myoldp = document.getElementById("Listp");
    var mynewp = document.createElement("DIV")
    mynewp.id="Listp";
    var docfrag = document.createDocumentFragment();
    var myc =0
    ///test for display filter
      myhits=0 //test for hits
    for (ty=0;ty<Znum+1;ty++) {
        if (Z[ty]==0) {  //not listed for display skip 
        	// bypass for
        }else{
        myhits=myhits+1
         if (myhits==1) {
         artz=ty
         }
        /// major test of what to display
        myname=T[myc]
        mynum=myc
        myref="javascript:Detail(" + myc + ",1)"
        //name
        myelem = document.createElement("A")
        docfrag.appendChild(myelem);
        myelem.setAttribute("href",myref)
       	myelem.style.textDecoration="none"
        myelem.style.fontFamily="arial,helvetica,times"
        myelem.style.fontSize="8pt"
        myelem.style.lineHeight="11pt"
        myelem.style.fontWeight="bold"
       	myelem.style.color= "blue"
       	mytext = document.createTextNode(T[ty] )
        myelem.appendChild(mytext);
        docfrag.appendChild(myelem);
        myelem = document.createElement("BR")
        docfrag.appendChild(myelem);
        
        } // end of if for test to display
        myc=myc+1
        } // end of for loop
        // test for hits
        
        if (myhits >0) {
       	    document.getElementById("mess99").style.visibility="hidden" // none found off
        }else{    //none found
       	    document.getElementById("mess99").style.visibility="visible"
        }
        mynewp.appendChild(docfrag);  //note blanks if none found
        mydiv.replaceChild(mynewp, myoldp)
        
  } // end of function

         
 // end of heads


	function Next(nz) { 
               nzn= nz +1
               if (nzn>Znum){
                 artz=nz
                 return
               }
               if ( Z[nzn]==1 ) {  // ok to display 
                    // proceed with artz
               }else{
       			//need to find first valid one
       	       		for (xx=nzn;xx<Znum+1;xx++){
                    		if (Z[xx]==1) {
                        		nzn=xx
                       		break
                    		}else{ //none found display last 
                    	        	nzn=nz
                    		}
        		} //for for

                }
                Detail(nzn,1);
             }

             function Prev(nz) { 
                 nzn= nz - 1
               if (nzn < 0 ) { //at start
                 artz=nz
                 return
               }
               if ( Z[nzn]==1 ) {  // ok to display 
                    // proceed with artz
               }else{
       			//need to find first valid previous one
       	       		for (xx=nzn;xx>-1;xx--){
                    		if (Z[xx]==1) {
                        		nzn=xx
                       		break
                    		}else{ //none found display last 
                    	        	nzn=nz
                    		}
        		} //for for

                }
                Detail(nzn,1);
             }

              function Top() {
        	nzn= 0 
               if ( Z[nzn]==1 ) {  // ok to display first
                    // proceed with artz
               }else{
			//need to find first valid one
       	       		for (xx=0;xx<Znum+1;xx++){
                    		if (Z[xx]==1) {
                        		nzn=xx
                       		break
                    		}else{ //none found display last 
                    	        	nzn=artz
                    		}
        		} //for for

                }
                Detail(nzn,1);
             }

             function Last() {
           	nzn= Znum 
               if ( Z[nzn]==1 ) {  // ok to display last
                    // proceed with artz
               }else{
			//need to find last valid previous one
       	       		for (xx=nzn;xx>-1;xx--){
                    		if (Z[xx]==1) {
                        		nzn=xx
                       		break
                    		}else{ //none found display last 
                    	        	nzn=artz
                    		}
        		} //for for

                }
                Detail(nzn,1);
             }

                          function selectit(sel) {
                               mysel= sel-1
                         }

        function Cat(ncat) {
        // display cats
        document.getElementById("Subcats").style.visibility="visible"
                   //clear first note clears all rewrites
                   //headings
                   //clear headings
               for (y=0;y<21;y++) {
               myn= 'document.getElementById("Hcat'+ eval(y) +'").style.visibility="hidden"'
                eval(myn)
                    }
                    // now add back one needed
                 myn= 'document.getElementById("Hcat'+ eval(ncat) +'").style.visibility="visible"'
                eval(myn)
                    
                          //find exit for loop
                          myend=2
                          mycnt=0
                          myt="Exit"
                        for(zi=0;zi<11;zi++) {
                        mytt="cat"+eval("ncat")+"[zi]";
                        myttt=eval(mytt)
                        if (myttt==myt) {
                           myend=zi-1
                        }
                        }
                             //loop for all records present
                             
    //build subcat
    var myelem =""
    var mytext=""
    var mydiv = document.getElementById("Subcats");
    var myoldp = document.getElementById("Subcatsp");
    var mynewp = document.createElement("DIV")
    mynewp.id="Subcatsp";
    var docfrag = document.createDocumentFragment();
    var myc =0
    for (ty=0;ty<myend+1;ty++) {
        mynum=myc
        myref="javascript:Filter(" + ncat +","
        mynum=ty+10 ///fixithere
        myref=myref+mynum+")";
        //built href
        myelem = document.createElement("A")
        docfrag.appendChild(myelem);
        myelem.setAttribute("href",myref)
        myelem.style.textDecoration="none"
        myelem.style.fontFamily="arial,helvetica,times"
        myelem.style.fontSize="8pt"
        myelem.style.fontWeight="bold"
        myelem.style.lineHeight="11pt"
        myelem.style.color= "green"
        // now for link name
        mycat="cat"+eval(ncat)+"[ty]"
        mybit=eval(mycat)
        //name
        mytext = document.createTextNode(mybit )
        myelem.appendChild(mytext);
        docfrag.appendChild(myelem);
        myc=myc+1
        //add BR line
        myelem = document.createElement("BR")
        docfrag.appendChild(myelem);
        }
        // add exit
         myelem = document.createElement("A")
        docfrag.appendChild(myelem);
        //myref= "'javascript:Exit("
       // myref =myref + eval(ncat)+")";
        myref= "javascript:Exit()"
        myelem.setAttribute("href",myref)
        myelem.style.textDecoration="none"
        myelem.style.fontFamily="arial,helvetica,times"
        myelem.style.fontSize="8pt"
        myelem.style.fontWeight="bold"
        myelem.style.lineHeight="11pt"
        myelem.style.color= "red"
        // now for link name
        mycat="cat"+eval(ncat)+"[myend+1]"
        mybit=eval(mycat)
        //name
        mytext = document.createTextNode(mybit )
        myelem.appendChild(mytext);
        docfrag.appendChild(myelem);
        
        mynewp.appendChild(docfrag);
        mydiv.replaceChild(mynewp, myoldp)

      }
 // end of cat
 function Exit() {
                // hide cats
                document.getElementById("Subcats").style.visibility="hidden"
               //headings
               //rewrite headings
               for (y=0;y<21;y++) {
               myn= 'document.getElementById("Hcat'+ eval(y) +'").style.visibility="visible"'
                eval(myn)
                }
                //=======rewrite heads for all
                 //reset Z counter to display all
                
                  for (iy=0;iy<Znum+1;iy++){
                  Z[iy]=1
                  }
                           hpos=0
                        // set form to latest
                        defhead=mainhead 
                        //change head display
                        textmod("headnews", mainhead)
                         Heads(0)
                //set radio back
                document.F2.Selm[0].checked="true"
                selectit(1)
                

         }

 // end of exit

  function Filter(catn,filtn) {
  // builds a set of references and total number for selected category
 // insert test for selectit to open page if archive
            
            if (mysel>0 || catn == 20) {  //ie radio button pressed or all news
              if (catn == 20) {
              myfile="a00"+"a" + eval(filtn-10)
              myfile=myfile+".html"

               if (filtn==10) { //ie latest news
                   myfile = "index.html"
                   //myfile = "FPplan.html"
                 }
                myfile = "window.location=" +'"'+ myfile +'"'
                eval(myfile)
              //document.all.F1.label.value=myfile
              } else {
               mytnum = (catn*1000) + filtn - 10
                switch (mytnum) {
                case 1004 :
                    myfile = "window.location ="
                    myfile = myfile + '"' + "allplan" + "a" + eval(mysel)
                    myfile = myfile +".html" + '"'
                    eval(myfile)
                        break;
                case 2005 :
                    myfile = "window.location ="
                    myfile = myfile + '"' + "allgrp" + "a" + eval(mysel)
                    myfile = myfile +".html" + '"'
                    eval(myfile)
                        break;
                case 3004 :
                    myfile = "window.location ="
                    myfile = myfile + '"' + "allheal" + "a" + eval(mysel)
                    myfile = myfile +".html" + '"'
                    eval(myfile)
                        break;
                case 4008 :
                    myfile = "window.location ="
                    myfile = myfile + '"' + "allhort" + "a" + eval(mysel)
                    myfile = myfile +".html" + '"'
                    eval(myfile)
                        break;
                case 5005 :
                    myfile = "window.location ="
                    myfile = myfile + '"' + "allsug" + "a" + eval(mysel)
                    myfile = myfile +".html" + '"'
                    eval(myfile)
                        break;
                case 6006 :
                    myfile = "window.location ="
                    myfile = myfile + '"' + "allgrain" + "a" + eval(mysel)
                    myfile = myfile +".html" + '"'
                    eval(myfile)
                        break;
                case 7008 :
                    myfile = "window.location ="
                    myfile = myfile + '"' + "alllive" + "a" + eval(mysel)
                    myfile = myfile +".html" + '"'
                    eval(myfile)
                        break;
                case 18003 :
                    myfile = "window.location ="
                    myfile = myfile + '"' + "allfeed" + "a" + eval(mysel)
                    myfile = myfile +".html" + '"'
                    eval(myfile)
                        break;
                case 16003 :
                    myfile = "window.location ="
                    myfile = myfile + '"' + "allweed" + "a" + eval(mysel)
                    myfile = myfile +".html" + '"'
                    eval(myfile)
                        break;
                case 17003 :
                    myfile = "window.location ="
                    myfile = myfile + '"' + "allfish" + "a" + eval(mysel)
                    myfile = myfile +".html" + '"'
                    eval(myfile)
                        break;
                case 19003 :
                    myfile = "window.location ="
                    myfile = myfile + '"' + "allener" + "a" + eval(mysel)
                    myfile = myfile +".html" + '"'
                    eval(myfile)
                        break;
                case 8005 :
                    myfile = "window.location ="
                    myfile = myfile + '"' + "allweal" + "a" + eval(mysel)
                    myfile = myfile +".html" + '"'
                    eval(myfile)
                        break;
                case 9006 :
                    myfile = "window.location ="
                    myfile = myfile + '"' + "allwater" + "a" + eval(mysel)
                    myfile = myfile +".html" + '"'
                    eval(myfile)
                        break;
                case 10002 :
                    myfile = "window.location ="
                    myfile = myfile + '"' + "alltour" + "a" + eval(mysel)
                    myfile = myfile +".html" + '"'
                    eval(myfile)
                        break;
                case 11003 :
                    myfile = "window.location ="
                    myfile = myfile + '"' + "allit" + "a" + eval(mysel)
                    myfile = myfile +".html" + '"'
                    eval(myfile)
                        break;
                case 12007 :
                    myfile = "window.location ="
                    myfile = myfile + '"' + "allcomm" + "a" + eval(mysel)
                    myfile = myfile +".html" + '"'
                    eval(myfile)
                        break;
                case 13004 :
                    myfile = "window.location ="
                    myfile = myfile + '"' + "allinov" + "a" + eval(mysel)
                    myfile = myfile +".html" + '"'
                    eval(myfile)
                        break;
                case 14006 :
                    myfile = "window.location ="
                    myfile = myfile + '"' + "allint" + "a" + eval(mysel)
                    myfile = myfile +".html" + '"'
                    eval(myfile)
                        break;
                case 15008 :
                    myfile = "window.location ="
                    myfile = myfile + '"' + "allaus" + "a" + eval(mysel)
                    myfile = myfile +".html" + '"'
                    eval(myfile)
                        break;
                    default:
                     myfile="cat"+eval(catn)+"["+eval(filtn)+"]";
                     myfile =eval(myfile)+"a" + eval(mysel)
                     myfile=myfile+".html"
                     myfile = "window.location=" +'"'+ myfile +'"'
                     eval(myfile)
                    //document.all.F1.label.value=myfile
                        break;
                              }

                }

                        // end of send to file
                 } else {
                 
                 ///>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>newbit
			for (iy=0;iy<Znum+1;iy++){
		       		Z[iy]=0  // set to 0 to display none at start
			}
                 
                 //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
                // first change label need to change for netscape
                mylabel="cat"+eval(catn)+"["+eval(filtn-10)+"]";
                mylabel =eval(mylabel)
                defhead= "Latest News for >> "+mylabel
                //now change value for label
                textmod("headnews", defhead)
                //>>>>>>>>>>>>>>>>>>>>>>>>>>>>new bit
                //fill chunks with ""  then test for length=0
                	for (iy=0;iy<31;iy++){
       				chunks[iy]=""  // set to blank to display all
			         }
			mytemp = "cat"+catn+"["+ filtn + "]"
			mystr= eval(mytemp)
			myfiltlen = mystr.length
			  // load chunks with bits of filter
			  //substring (0,4) gets first 3!!! char
                	for (iy=0;iy<31;iy++){
               		// get bit of string
               		mys=iy*3
               		if (mys<myfiltlen+1) {
               		  mybit= mystr.substring(mys,mys+3)
               		  chunks[iy]=mybit
                     }else{
                        break
                     }
			}
			
			//>>>>>>Temp
			//textmod("dummy1",chunks[0])
			//textmod("dummy2",chunks[1])
			//textmod("dummy3",chunks[2])
			
			//>>>>>>Temp
			    
				// go through each listing and test for match in Acats
	           for (xxy=0;xxy<Znum+1;xxy++){
        			// get first chunk
                    for (zy=0;zy<31;zy++){
                		// get first chunk
            		       myone= chunks[zy]
                           if (chunks[zy].length <3){
                           break
                           }
   		                   mytest=eval(Acats[xxy].indexOf(myone));
    				       	if (mytest >-1) {  // -1 if no match
				       	 	Z[xxy]=1
                            break
				            }
			                
      		        }
		        }
                	
                //// end of new bit
                          } //else end 
                          
            Heads(0)  ///display what found need to loop through for Z test
              }

//write1 360 88; pw4 97 167;test2 180 143; 225 179;icon7 202 161
//new function added
 function Tryit(tcat,tfilt) {
                mybit= 'window.location='
                mybit= mybit + '["Feb'
                mynum=0
                mynum=mynum + 2*10
                mynum = mynum +3
                mybit = mybit + eval(mynum)
                mybit= mybit + '.htm"]'
                eval(mybit)
                }

textmod("headnews", mainhead)
defhead=mainhead
