function menu(page,level)
{ 
	var text;
	var text2;
    var photo=(Math.round(Math.random()*23))+1001;


	text = "";
	text2 = "";

	if (level=='2')
	  {
	   text="../";
	  }
	else if (level=='3')
	  {
		text="../../";
	   text2 = "../";
	  }


     document.write("<td rowspan='2' align='center' valign='top' width='180' bgcolor='#009999'>");
     document.write("  <a class='menu' href='http://www.laa.uk.com' target='_blank'>");
     document.write("    <font face='Verdana' size='3' color='Blue'><b>Light </B></font>");
     document.write("    <font face='Verdana' size='3' color='Blue'><b>Aircraft </b></font>");
     document.write("    <font face='Verdana' size='3' color='Blue'><b>Association </b></font>");
     document.write(" </a>");
     document.write(" <BR>");
     document.write(" <A target='_window' HREF='http://www.suffolkcoastalstrut.org.uk'><img src='" + text + "scs_logo_sm.gif' width='177' height='132' border='0'></A>");
     document.write(" <BR>");
     document.write("<font face='Arial' color='yellow'><b>Boxted <BR> Summer 're-run' Fly-in <BR> 19th September 2009</b></font> <BR>");   
	 document.write("<font face='Arial' color='yellow' size='-1'><b>10:00 - 17:00 (local)</b></font> <BR><BR>"); 

	if (page=='home')
	  {
	   document.write("<font color='black'><b>Home</b></font>");
	  }
	else
	  {
	   document.write("<a class='menu' href='" + text + "index.html'>Home</a>");
	  }

	document.write("<font size='1'><BR><BR></font>");


	if (page=='ppr')
	  {
	   document.write("<font color='black'><b>On-line PPR Form</b></font>");  
	  }
	else
	  {
	   document.write("<a class='menu' href='" + text + "ppr.html'>On-line PPR Form</a>");
	  }

    
	document.write("<font size='1'><BR><BR></font>");


    if (page=='briefing')
	  {
   	   document.write("<font color='black'><b>Visiting Pilots Info</b></font><br>"); 
	  }
    else
	 {
     document.write("<a class='menu' href='" + text + "pilot_info.html'>Visiting Pilots Info</a><br>");
	  }

	document.write("<font size='1'><BR></font>");

    if (page=='Visitors')
	  {
   	   document.write("<font color='black'><b>List of PPR Requests</b></font><br>"); 
	  }
    else
	 {
     document.write("<a class='menu' href='" + text + "visitors.html'>List of PPR Requests</a><br>");
	  }

   
	document.write("<BR>");
    document.write("<a target='_window' href='http://tinyurl.com/6f562w '><IMG name='photo1' SRC='" + text + "photos/" + photo +".jpg'  border='0'></A><BR>");
    document.write("<a class='menu' target='_window' href='http://tinyurl.com/6f562w '>Photos from 2008</a>");

	document.write("<BR>");

    document.write("<font size='1'><BR><BR></font>");

    document.write("<font size='-1' color='yellow'>The <A class='hidden' HREF='" + text + "secure/bookings.html'>Boxted Fly-in</A> has been organisied by the<BR>"); 
	document.write(" <A class='menu' target='_window' HREF='http://www.suffolkcoastalstrut.org.uk'>Suffolk Coastal LAA Strut</A></font>");


    document.write("<BR><BR>");
    document.write("<font size='-1'  color='yellow'>Money from this event will be going to the <A class='menu' HREF='http://www.boxted-airfield.com' target='_window'>Boxted Airfield Historical Group</A> to help in their effect with creating a permanent <A class='menu' HREF='http://www.boxted-airfield.com/richards/page3.html' target='_window'>Boxted Airfield Museum.</font>");


    document.write("<BR><BR>");


    document.write("</td>");

}


function first_photo(p_level)
{
    mytimer=setTimeout("next_photo("+ p_level + ")",5000)
}

function next_photo(p_level)
{

   	var text;
    var nbr=(Math.round(Math.random()*23))+1001;

    text="";

	if (p_level=='2')
	  {
	   text="../";
	  }

	photo1.src=text + 'photos/' + nbr + '.jpg';

    mytimer=setTimeout("next_photo("+ p_level + ")",5000)
}



function print_ppr_number()
{
    var url = document.URL;
	var where=url.indexOf('#');
	var ppr_nbr = "";
	var failure = "N";
	var available = "Y";

	if (where > -1)
	{
      where++;
  	  ppr_nbr = url.substr(where,3);
	}
	else
    {
      failure = "Y";
   }

        if (failure == "N")
          {
          document.write(" <tr align='center'><td colspan='2'><b>Thank you for Registering to vist the Boxted Fly-in.</b><BR>");
		  document.write(" <font size='+2'>Your PPR Number is&nbsp;&nbsp;</font><font size='+4' color='red'>" + ppr_nbr + "</font><BR>");
		  document.write(" <BR><HR><BR><font size='+2' color='green'>Visiting Pilots Information</font><BR><BR>");

          if (available == "N")
             {
			   document.write("The Pilots briefing notes for this years event are not available yet <BR>but we will contact you just as soon as there are available.<BR><BR></td></tr>");
             }
          else
			  {
	           document.write("<b>Please ensure that you read the Visiting Pilots Information.</b><BR><BR>");
               document.write("These are available either on the <A HREF='pilot_info.html'>website</A> or as a printable <A HREF='boxted_2009_pilot_info.pdf' target='_window'>pdf file</A> (157kb).<BR><BR></td></tr>");
              } 
		  }
		else
	     {	
			document.write("<b>There appears to have been a failure in the process to allocate you a PPR number.</b><BR><BR>");
			document.write("Please email <SCRIPT>contact('flyin')</SCRIPT> to report this issue.<BR><BR>");
   		     document.write("We Apologise for the inconvenience.<BR><BR></td></tr>");
         }
		 

}



function print_request()
{
    var url = document.URL;
	var where=url.indexOf('#');
	var ppr_nbr = "";
	var ppr_reg = "";
	var failure = "N";
	var defaults = "N";
	var available = "N";

	if (where > -1)
	{
		where = where + 1;
		if (url.substr(where,1) == 'N')
		  {
            failure = "Y";
			where = where + 1;
		  }

		defaults = "Y";
		ppr_nbr = url.substr(where,3);
		ppr_reg = url.substr(where+3);
	    
	}

        if ((defaults == "Y") && (failure == "N"))
          {
          document.write(" <tr align='center'><td colspan='2'>Thank you for Registering to visting the Boxted Fly-in.<BR>");
		  document.write(" <font size='+1'>Your PPR Number is&nbsp;&nbsp;</font><font size='+4' color='red'>" + ppr_nbr + "</font><BR>");
		  document.write(" <BR><font size='+2'>Visiting Pilots Briefing Notes</font><BR><BR>");

          if (available == "N")
             {
			   document.write("The Pilots briefing notes for this years event are not available yet <BR>but we will contact you just as soon as there are available.<BR><BR></td></tr>");
             }
          else
			  {
	           document.write("Please rea<BR><BR></td></tr>");
              } 
		  }
		else
	     {
		  document.write("<tr><td colspan='2' align='center'><font size='+2'>Visiting Pilots Briefing Notes</font><b></td></tr>");
          if (available == "N")
             {
			   document.write("<tr><td colspan='2' align='center'><BR>The Pilots briefing notes for this years event are not available yet."); 
			   document.write("<BR><BR>Although you can still <A HREF='ppr.html'>register for a PPR Number</A> <BR>and we will then contact just as soon as there are available.<BR><BR></td></tr>");
             }
          else
  	        {
              document.write(" <tr><td colspan='2' align='center'><BR>Please enter your PPR number and Registration <BR> to Display the Boxted Fly-in Briefing Details.<BR><BR></td></tr>");
            }
         }



       if (available == "Y")
	      {
            if (failure == "Y")
            	{
		            document.write("<tr><td colspan='2' align='center'><font color='red'> Sorry but we could not find your details.</font><BR><BR></td></tr>");
			    }

   		    document.write(" <tr><td align='right'><b>PPR Number:</b>&nbsp;&nbsp;&nbsp;&nbsp;</td><td><input TYPE='TEXT' SIZE='10' NAME='ppr_nbr' value='" + ppr_nbr +"'></td></tr>");
            document.write(" <tr><td align='right'><b>Aircraft Reg:</b>&nbsp;&nbsp;&nbsp;&nbsp;</td><td><input TYPE='TEXT' SIZE='10' NAME='ppr_reg' value='" + ppr_reg +"'></td></tr>");
            document.write(" <tr><td align='right'><BR><input TYPE='BUTTON' VALUE='Submit' onclick='submit_form();'>&nbsp;&nbsp;&nbsp;&nbsp;</td><td><BR><input TYPE='RESET'></td></tr>");
		  }

}

function contact(name)
{

    if (name=='ppr')
	   {   
             document.write(String.fromCharCode(60,97,32,104,114,101,102,61,34,109,97,105,108,116,111,58,112,112,114,64,98,111,120,116,101,100,50,48,48,57,46,99,111,46,117,107,32,34,62,112,112,114,64,98,111,120,116,101,100,50,48,48,57,46,99,111,46,117,107,32,60,47,97,62))
	   }
	else if (name=='flyin')
	{
          document.write(String.fromCharCode(60,97,32,104,114,101,102,61,34,109,97,105,108,116,111,58,102,108,121,105,110,64,98,111,120,116,101,100,50,48,48,57,46,99,111,46,117,107,32,34,62,102,108,121,105,110,64,98,111,120,116,101,100,50,48,48,57,46,99,111,46,117,107,32,60,47,97,62))
  	}
	else
		document.write('xxxxxxxxxxxxx');
}

function display_briefing()
{

    var url = document.URL;
	var where=url.indexOf('#');

	if (where > -1)
	{
		document.write("<IMG SRC='notes/briefing.gif' WIDTH='775'>");
	}
	else
	{
      document.write("To be able to view the Briefing Details you must first have registered for a <A HREF='ppr.html'>PPR number</A>");
	}

}



function aerial_photos()
{

    var url = document.URL;
	var where=url.indexOf('#');
	var nbrx = "1";

	if (where > -1)
	{
		nbrx = url.substr(where+1);
	}
	
    var desc= new Array(11); 
	desc[1]  = "<b>View from the South East</b> <BR> Note aircraft departing off runway 04";
	desc[2]  = "<b>View from overhead</b> -  A12 running parrallel to the runway at top <BR> <b>Note:</b> the track crossing runway at midpoint is now the end of the runway, the runway to the right of the track is now crop field again";
	desc[3]  = "<b>View from the North (deadside)</b> <BR> A12 running parallel to the runway, with the junction to A134 to the top right and Ardleigh Reservoir top of photo ";
	desc[4]  = "<b>View from the North West (deadside)</b> <BR> A12 running parallel to the runway, Ardleigh Reservoir top right, and River Stour top left";
	desc[5]  = "<b>View from the West </b> <BR> A12 running parallel to the runway, and Langham village between A12 and left of photo";
	desc[6]  = "<b>View from the South</b> <BR> A12 running at bottom";
	desc[7]  = "<b>View from the South East (downwind)</b> <BR> A12 running at bottom and Langham village top right";
	desc[8]  = "<b>View from the East</b> <BR> A12 running top left running round the north of Colchester";

	var nbr = nbrx - 0;
	var prev = nbr -1;
	var next = nbr +1;
		
	document.write("<A HREF='lg_photo.html#" + nbr + "' target='_window'><IMG SRC='aerial/photo" + nbr + ".jpg' border='0' height='513' width='672'></A>");
    document.write("<TABLE cellpadding='0' border='0' width='700'>");
    document.write("    <TR><TD colspan='4' align='center'>" + desc[nbr] + "</TD></TR>");
    document.write("    <TR><TD align='right' width='125'>");

	if (nbr == 1) 
	    {
          document.write("Previous Photo");
		}
       else
		{
          document.write("<A HREF='javascript:photo_click(" + prev +")'>Previous Photo</A>");
		}

        document.write("</TD><TD align='center' width='125'><A HREF='aerial.html#" + nbr + "'> Aerial Index</A></TD><TD  align='left' width='125'>");

		if (nbr == 8) 
		{
          document.write("Next Photo");
		}
       else
		{
          document.write("<A HREF='javascript:photo_click(" + next +")'>Next Photo</A>");
		} 

     document.write("</TD><TD width='325' align='center'>click photo for 1600x1200 image (approx 400kb)");

	  document.write("</TD></TR></TABLE>");
         

}

function large_photos()
{

    var url = document.URL;
	var where=url.indexOf('#');
	var nbrx = "1";

	if (where > -1)
	{
		nbrx = url.substr(where+1);
	}

	var nbr = nbrx - 0;

   document.write("<IMG SRC='aerial/lg_photo" + nbr + ".jpg' border='0' height='1200' width='1600'>");


}

function photo_click(nbr)
{

  document.location.href='aphoto.html#'+ nbr;
  document.location.reload()

}


