var maxLength = 10;
siteopt = new Array;
var trueLength = 1;
var lst;
var opened=false;
catopt = new Array;
catopt[0] = "Denominations";
catopt[1] = "Church Organisations";
catopt[2] = "Community Organisations";
catopt[3] = "Youth organisations";
catopt[4] = "Christian Charities";
catopt[5] = "Academic Institutions";
catopt[6] = "Christian Events";
catopt[7] = "Christian Media/Publishing";

function changePage() 
{
menuNum = document.SelectMenu.SelectPrimary.selectedIndex;
        if (menuNum == null){alert("Please select a category from the menu.");return;}
        else
        {
        i = document.SelectMenu.SelectSecondary.selectedIndex;
				if(!opened)
					{
					if(alert_user())
						{
						goLink(url[i]);
						opened = true;
						}
					}
				else
					goLink(url[i]);
        }
}

function changeMenu()
{
siteopt.length = 0;
menuNum = document.SelectMenu.SelectPrimary.selectedIndex;
        if (menuNum == null) return;
  
        if (menuNum == 0) 
     				{
									siteopt = new Array;
									url = new Array;	
									siteopt[0] = new Option("Baptist");
	  					 url[0] = "http://www.baptist.org.uk";
									siteopt[1] = new Option("Church of Scotland");
									url[1] = "http://www.churchofscotland.org.uk";
				     siteopt[2] = new Option("Methodist");
									url[2] = "http://www.methodist.org.uk/";
         siteopt[3] = new Option("Salvation Army");
									url[3] = "http://www.salvationarmy.org/";
         siteopt[4] = new Option("Church of Ireland");
									url[4] = "http://ireland.anglican.org/home.html";
         siteopt[5] = new Option("Church of England");
									url[5] = "http://www.cofe.anglican.org/";
         siteopt[6] = new Option("Presbyterian Church in Ireland");
									url[6] = "http://www.presbyterianireland.org";
	        siteopt[7] = new Option("Catholic Church in Scotland");
									url[7] = "http://www.catholic-scotland.org.uk/index.html";
	        siteopt[8] = new Option("Catholic Church");
    					url[8] = "http://www.catholic-church.org.uk";
							  }

    if (menuNum == 1) 
        {
        siteopt = new Array;
	  					url = new Array;
        siteopt[0] = new Option("Church Pastoral Aids Society");
	  	  	 url[0] = "http://www.cpas.org.uk";
        siteopt[1] = new Option("Church Urban Fund");
	  	  	 url[1] = "http://www.cuf.org.uk";
        siteopt[2] = new Option("Churches Community Work Alliance");
	  	  	 url[2] = "http://www.ccwa.org.uk";
	  	  	 siteopt[3] = new Option("Churches National Housing Coalition");
	  	  	 url[3] = "http://www.justhousing.co.uk";
    	   siteopt[4] = new Option("Churches' Commission for Racial Justice");    
        url[4] = "http://www.ccrj.org.uk";
								siteopt[5] = new Option("Directory of churches and church charities");
								url[5] = "http://www.churchnet.org.uk/listings.shtml";
								siteopt[6] = new Option("Directory of churches");
								url[6] = "http://www.churchuk.net/directory/index.php3 ";
	       }

					if (menuNum == 2)
								{
								siteopt = new Array;
								url = new Array;
								siteopt[0] = new Option("The Corrymeela Community");
								url[0] = "http://www.corrymeela.org.uk/";
								siteopt[1] = new Option("The Iona Community");
								url[1] = "http://www.iona.org.uk/";	  		
								siteopt[2] = new Option("Oasis Trust");
								url[2] = "http://www.u-net.com/oasis/";
								siteopt[3] = new Option("174 Trust");
								url[3] = "http://www.174trust.org"; 
								siteopt[4] = new Option("Churches Community Work Alliance");
								url[4] = "http://www.ccwa.org.uk";
								siteopt[5] = new Option("Communities Online");
								url[5] = "http://www.communities.org.uk";
								siteopt[6] = new Option("Community Development Foundation");
								url[6] = "http://www.cdf.org.uk"; 
								siteopt[7] = new Option("Community fund");
								url[7] = "http://www.community-fund.org.uk/"; 
								siteopt[8] = new Option("Corrymeela Community ");
								url[8] = "http://www.corrymeela.org.uk"; 
								siteopt[9] = new Option("Frontier Youth Trust");
								url[9] = "http://www.fyt.org.uk"; 
								siteopt[10] = new Option("Iona Community");
								url[10] = "http://www.iona.org.uk"; 
								siteopt[11] = new Option("Standing Conference for Comm Dev");
								url[11] = "http://www.communities.org.uk/sccd/home.htm";
								siteopt[12] = new Option("Urban Forum");
								url[12] = "http://www.urbanforum.org.uk";
								siteopt[13] = new Option("Churches Community Work Alliance");
	  	  	 url[13] = "http://www.ccwa.org.uk";
								}  

	
 	  if (menuNum == 3) 
        {
        siteopt = new Array;
								url = new Array;
								siteopt[0] = new Option("Youth for Christ");
								url[0] = "http://www.yfc.co.uk";
        siteopt[1] = new Option("Summer Madness");
        url[1] = "http://www.summermadness.co.uk";
	  					siteopt[2] = new Option("Frontier Youth Trust");
								url[2] = "http://www.fyt.org.uk";
        siteopt[3] = new Option("Greenbelt Arts Festival");
								url[3] = "http://www.greenbelt.org.uk";
	  					siteopt[4] = new Option("Soul Survivor");
								url[4] = "http://www.soulsurvivor.com";
	  					siteopt[5] = new Option("The Message");
								url[5] = "http://www.message.org.uk/";
	  					siteopt[6] = new Option("YMCA                                   ");
								url[6] = "http://www.ymca.org.uk/";
	  					siteopt[7] = new Option("Leeds Faith in Schools");
								url[7] = "http://www.lfis.org/";
        siteopt[8] = new Option("YWAM");	
								url[8] = "http://ywam.gospelcom.net/";
 						 siteopt[9] = new Option("Crusaders");
	  					url[9] = "http://www.crusaders.org.uk/";	  
        }

if (menuNum == 4)
								{
								siteopt = new Array;
								url = new Array;
								siteopt[0] = new Option("Tearfund");
								url[0] = "http://www.tearfund.org.uk/";  
								siteopt[1] = new Option("The Childrens Society");
								url[1] = "http://www.the-childrens-society.org.uk/";
								siteopt[2] = new Option("Care for the Family");
								url[2] = "http://www.care-for-the-family.org.uk/";
								siteopt[3] = new Option("Christian Aid");
								url[3] = "http://www.christian-aid.org.uk/"; 
								siteopt[4] = new Option("Catholic Housing Aid Society");
								url[4] = "http://www.chasnational.org.uk/toc.htm";
								siteopt[5] = new Option("Jubilee 2000 Campaign");
								url[5] = "http://www.jubilee2000uk.org/";	
								siteopt[6] = new Option("The Shaftesbury Society");
								url[6] = "http://www.shaftesburysoc.org.uk/";							
								}

if (menuNum == 5) 
        {
        siteopt = new Array;
								url = new Array;
        siteopt[0] = new Option("Spurgeons College");
								url[0] = "http://www.spurgeons.ac.uk";
        siteopt[1] = new Option("Union College                         ");
								url[1] = "http://www.union.ac.uk";
	  					siteopt[2] = new Option("Irish Baptist College");       
	  					url[2] = "http://www.irishbaptistcollege.org.uk/";
	  					}

if (menuNum == 6) 
        {
								siteopt = new Array;
								url = new Array;
        siteopt[0] = new Option("Spring Harvest");
        url[0] = "http://www.springh.org";
        siteopt[1] = new Option("Summer Madness");
        url[1] = "http://www.summermadness.co.uk";
        siteopt[2] = new Option("Greenbelt Arts Festival");
        url[2] = "http://www.greenbelt.org.uk";
        siteopt[3] = new Option("Soul Survivor");
        url[3] = "http://www.soulsurvivor.com";
        siteopt[4] = new Option("The Message");
        url[4] = "http://www.message.org.uk/"
								}

if (menuNum == 7) 
        {
								siteopt = new Array;
								url = new Array;
        siteopt[0] = new Option("Scripture Union");
        url[0] = "http://www.scripture.org.uk/";
        siteopt[1] = new Option("UCB");
        url[1] = "http://www.ucb.co.uk";
        siteopt[2] = new Option("Alpha Course");
        url[2] = "http://www.alpha.org.uk/";
								}

tot = siteopt.length;
        for (i = lst; i > 0; i--) 
        { document.SelectMenu.SelectSecondary.options[i] = null; }
        for (i = 0; i < tot; i++)
        { document.SelectMenu.SelectSecondary.options[i] = siteopt[i]; }
        document.SelectMenu.SelectSecondary.options[0].selected = true;
lst = siteopt.length;
}

function printlist()
{
	with (document) 
		{
		writeln('<FORM NAME = "SelectMenu"><FONT class="cap">');
		writeln('S</font><font class="normal">elect the link from below');
		writeln('<P>');
		writeln('<IMG SRC="./images/links.gif" ALIGN="right"><TABLE><TR><TH class="normal">Category:</TH><TD>');
		writeln('<SELECT CLASS="select" NAME="SelectPrimary" onChange="changeMenu(this.form)">');
		tot = catopt.length; 
  	for (i = 0; i < tot; i++)
 	 		writeln("<OPTION>" +catopt[i]);
		writeln("</SELECT>");
		writeln('</TD></TR><TR><TH class="normal">');
		writeln('Link:</TH><TD>');
		writeln('<SELECT CLASS="select" NAME="SelectSecondary">');
  	for (i = 0; i < maxLength; i++)
   		writeln("<OPTION>" +siteopt[i]);
  	writeln("</SELECT></TD>");
  	for (i = maxLength; i > trueLength; i--) 
    	{
			SelectMenu.SelectSecondary.options[i] = null; 
			}
		changeMenu();
		writeln('<TD><INPUT TYPE="button" VALUE="go" CLASS="submit" ONCLICK="changePage()"></TD>');
		writeln('</FORM>');
		writeln('</TR></TABLE>');
		}
}
function goLink(prpage)
    	{
			window.open(prpage,'','toolbar=no,directories=no,addressbar=no,menubar=no,status=no,resizable=yes,scrollbars=yes,width=700,height=500');
    	}
function alert_user()
{
if(confirm("Please be advised that all content hosted by external sites is beyond the control of Jesus in the City.\n\nThe sites listed on this page are NOT NECESSARILY AFFILIATES of Jesus in the City - and should not be deemed so (unless otherwise stated).\n\nTherefore we are unable to guarantee that material hosted by other organisations is 'appropriate', or will not cause offence.\n\nHowever, if you do feel that any material included in a site we link to is inappropriate, offensive, racist, or of a pornographic nature - please let us know at once so we can remove the link from our site."))
	return true;
else
	return false;
}
