var typeA="<a href=\"http://www.stobhillgate.northumberland.sch.uk/\" target=\"_blank\"><img src=\"graphics/typeA1.jpg\" width=\"200\" alt=\"type A page example 1\" title=\"type A page example 1\"></a> &nbsp <a href=\"http://www.amble.firstschool.org.uk/\" target=\"_blank\"><img src=\"graphics/ambleHome.jpg\" width=\"200\" alt=\"type A page example 2\" title=\"type A page example 2\"></a><br><a href=\"http://www.blythnewshamfirst.northumberland.sch.uk/times.htm\" target=\"_blank\"><img src=\"graphics/newshamtimes.jpg\" width=\"200\" alt=\"type A page example 3\" title=\"type A page example 3\"></a> &nbsp <a href=\"http://www.stobhillgate.northumberland.sch.uk/news/news.htm\" target=\"_blank\"><img src=\"graphics/typeA3.jpg\" width=\"200\" alt=\"type A page example 4\" title=\"type A page example 4\"></a><br><p>Click on any of the examples above to visit that page and examine it more thoroughly.</p><h2>Type A pages include:</h2><ul><li>text content</li><li>upto five graphic elements, picturesor existing animations<br>(i.e. not created specifically for that page)</li><li>simple links or menu</li></ul><p>Price per page = <span class=\"purple\">�20</span></p>";
var typeB="<a href=\"http://www.stobhillgate.northumberland.sch.uk/fun/fun.htm\" target=\"_blank\"><img src=\"graphics/typeB1.jpg\" width=\"200\" alt=\"type B page example 1\" title=\"type B page example 1\"></a> &nbsp <a href=\"http://www.amble.firstschool.org.uk/welldone.html\" target=\"_blank\"><img src=\"graphics/amblewelldone.jpg\" width=\"200\" alt=\"type B page example 2\" title=\"type B page example 2\"></a><br><a href=\"http://www.choppington.northumberland.sch.uk/\" target=\"_blank\"><img src=\"graphics/choppHome.jpg\" width=\"200\" alt=\"type B page example 3\" title=\"type B page example 3\"></a> &nbsp <a href=\"http://www.stobhillgate.northumberland.sch.uk/tour/tour.htm\" target=\"_blank\"><img src=\"graphics/typeB4.jpg\" width=\"200\" alt=\"type B page example 4\" title=\"type B page example 4\"></a><br><p>Click on any of the examples above to visit that page and examine it more thoroughly.</p><h2>Type B pages include:</h2><ul><li>simple script elements</li><li>more than five graphic elements or pictures</li><li>animations specifically designed for that page</li><li>several graphic links (buttons, arrows, tabs, etc) specifically designed for that page</li><li>script elements (other than the menu creation script)</li></ul><p>Price per page = <span class=\"purple\">�40</span></p>";
var typeRA="<a href=\"http://www.stobhillgate.northumberland.sch.uk/stobhillmob/MrsJenkins.htm\" target=\"_blank\"><img src=\"graphics/typeA2.jpg\" width=\"200\" alt=\"this is the initial type A page example\" title=\"this is the initial type A page example\"></a> &nbsp <a href=\"http://www.stobhillgate.northumberland.sch.uk/stobhillmob/MissJohnston.htm\" target=\"_blank\"><img src=\"graphics/typeA13.jpg\" width=\"200\" alt=\"type RA page example 3\" title=\"type RA page example 3\"></a> <a href=\"http://www.stobhillgate.northumberland.sch.uk/stobhillmob/MrCharlton.htm\" target=\"_blank\"><img src=\"graphics/typeA11.jpg\" width=\"200\" alt=\"type RA page example 1\" title=\"type RA page example 1\"></a> &nbsp <a href=\"http://www.stobhillgate.northumberland.sch.uk/stobhillmob/MrRichmond.htm\" target=\"_blank\"><img src=\"graphics/typeA12.jpg\" width=\"200\" alt=\"type RA page example 2\" title=\"type RA page example 2\"></a><br><h2>Type RA pages are based upon an existing type A or type B page with changes to:</h2><ul><li>text content</li><li>graphic elements or pictures<br></li><li>simple links</li></ul><p>The basic layout of the page remains unchanged.</p><p>The first page laid out as above would be considered type A.</p><p>Subsequent pages would become type RA pages.<br>Price per type RA page = <span class=\"purple\">�10</span></p>";
var typeRB="<a href=\"http://www.amble.firstschool.org.uk/teachers.html\" target=\"_blank\"><img src=\"graphics/ambleteachers.jpg\" width=\"200\" alt=\"this is the initial type B page example\" title=\"this is the initial type B page example\"></a> &nbsp <a href=\"http://www.amble.firstschool.org.uk/support.html\" target=\"_blank\"><img src=\"graphics/amblesupport.jpg\" width=\"200\" alt=\"type RB page example\" title=\"type RB page example\"></a><br><h2>Type RB pages are based upon an existing type B page with changes to:</h2><ul><li>text content</li><li>graphic elements or pictures<br></li><li>scripts</li></ul><p>The basic layout of the page remains unchanged but the pictures, graphics, animations, text and scripts are modified.</p><p>The first page laid out as above would be considered type B.</p><p>Subsequent pages would become type RB pages.<br>Price per type RB page = <span class=\"purple\">�20</span></p>";
var equivs="<h2>The standard packages are quoted in terms of type A pages but these can be traded for other types</h2><br><table><tr><th>Alternative Type</th><th>Trade Value - Type A Pages</th></tr><tr><td>Type B</td><td>2</td></tr><tr><td>Type C</td><td>3</td></tr><tr><td>Type RA</td><td>0.5</td></tr></table><p>For example: </p><p>Instead of ten type A pages your start up site could consist of<br> three type A, two type B and a type C<br> at the same low cost of <span class=\"purple\">�250</span>.</p>";
var message;
var popwin;
//pop up window
function popWindow(n)
  {
    if (popwin){popwin.close();}
    popwin=window.open("","sub","width=480,height=560,left=100,top=10,resizable");
	  switch (n)
	    {
	  	  case 1 : message=typeA; break;
        case 2 : message=typeB; break;
				case 3 : message=typeRA; break;
				case 4 : message=typeRB; break;
				case 5 : message=equivs; break;
	  		default  : message="Goodbye World"; break;
	  	}

	  write(message);
  }

function write(messageIn)
  {
	  var newContent="<html><head><title>Sub Window</title><link rel = \"stylesheet\" type = \"text/css\" href = \"styles/mainstyle.css\"><style type = \"text/css\"><!--body {background-color:#ffffff;}ul{list-style-image:none;font-size:10pt;}table{padding:5px;font-size:10pt;text-align:center;}td,th,table {border:1px outset black;border-collapse:collapse;padding:5px 20px;}--></style></head>\n";
	  newContent+="<body>\n"+messageIn+"\n";
	  newContent+="</body></html>";
	  popwin.document.write(newContent);
	  popwin.document.close();
	  popwin.focus();
	}

//change url loaded in iframe id
function changeframe(id,url)
  {
    document.getElementById(id).src=url;
  }


//build main navigational links buttons for page p
var links="";
function makeLinks(p)
  {

	  links+="<table>";

// nav buttons for school section

		if (p == 's')
			{


				links+="<tr><td><a href=\"why.html\"><img src=\"buttons/whyNormal.gif\" alt=\"Why do schools need a web site?\" title=\"Why do schools need a web site?\" width=\"100\" height=\"29\" id=\"why\" border=\"0\" onmouseover=\"changeButton('why',0)\" onmouseout=\"changeButton('why',1)\"></a> </td></tr>";

				links+="<tr><td><a href=\"how.html\"><img src=\"buttons/howNormal.gif\" alt=\"How easy is it to have a web site designed by Snowcutter?\" title=\"How easy is it to have a web site designed by Snowcutter?\" width=\"100\" height=\"29\" id=\"how\" border=\"0\" onmouseover=\"changeButton('how',0)\" onmouseout=\"changeButton('how',1)\"></a> </td></tr>";

				links+="<tr><td><a href=\"schools.html\"><img src=\"buttons/schoolsNormal.gif\" alt= \"Schools\" title= \"Schools\" width=\"100\" height=\"29\" id=\"schools\" border=\"0\" onmouseover=\"changeButton('schools',0)\" onmouseout=\"changeButton('schools',1)\"></a> </td></tr>";

				links+="<tr><td><a href=\"safety.html\"><img src=\"buttons/safetyNormal.gif\" alt= \"Safety\" title= \"Safety\" width=\"100\" height=\"29\" id=\"safety\" border=\"0\" onmouseover=\"changeButton('safety',0)\" onmouseout=\"changeButton('safety',1)\"></a> </td></tr>";

				links+="<tr><td><a href=\"prices.html\"><img src=\"buttons/pricesNormal.gif\" alt=\"How much will it cost?\" title=\"How much will it cost?\" width=\"100\" height=\"29\" id=\"prices\" border=\"0\" onmouseover=\"changeButton('prices',0)\" onmouseout=\"changeButton('prices',1)\"></a> </td></tr>";

			}

		else
			{
				links+="<tr><td>&nbsp</td></tr><tr><td>&nbsp</td></tr><tr><td>&nbsp</td></tr><tr><td>&nbsp</td></tr>"
			}

//////////////////////////////////////////////////////////////////////////////////////////////

		links+="<tr><td>&nbsp</td></tr>";


		links+="<tr><td><a href=\"contact.html\"><img src=\"buttons/contactNormal.gif\" alt= \"Contact us\" title= \"Contact us\" width=\"100\" height=\"29\" id=\"contact\" border=\"0\" onmouseover=\"changeButton('contact',0)\" onmouseout=\"changeButton('contact',1)\"></a> </td></tr>";

		links+="<tr><td><a href=\"about.html\"><img src=\"buttons/aboutNormal.gif\" alt=\"About Snowcutter Web Designs\" title=\"About Snowcutter Web Designs\" width=\"100\" height=\"29\" id=\"about\" border=\"0\" onmouseover=\"changeButton('about',0)\" onmouseout=\"changeButton('about',1)\"></a> </td></tr>";

		 links+="<tr><td><a href=\"index.html\"> <img src=\"buttons/homeNormal.gif\" alt=\"Snowcutter Web Designs - Home\" title=\"Snowcutter Web Designs - Home\" width=\"100\" height=\"29\" id=\"home\" border=\"0\" onmouseover=\"changeButton('home',0)\" onmouseout=\"changeButton('home',1)\"></a> </td></tr>";


		links+="</table>";

	document.getElementById("links").innerHTML=links;
  }

//link button variations
function changeButton(nameIn,state)
  {
	  if (state==0)
	  {
	  	document.getElementById(nameIn).src="buttons/"+nameIn+"Hover.gif";
	  }
	  else
	  {
	  	document.getElementById(nameIn).src="buttons/"+nameIn+"Normal.gif";
	  }
  }

//Verification of contact form
var formOk=true;
function verify()
  {

	//  window.alert("form sent");
	}



//Browser sniffer for IE4+ or NN4+

//create string 'agent' with contents of navigator.userAgent
var agent = navigator.userAgent.toLowerCase();
var isMajor = parseInt(navigator.appVersion);
var isMinor = parseFloat(navigator.appVersion);

//check indexOf various sub strings within 'agent'
//if the result is -1 then that substring is not present in 'agent'
var isNav =((agent.indexOf('mozilla')!=-1)&&(agent.indexOf('spoofer')==-1)&&(agent.indexOf('compatible')==-1)&&(agent.indexOf('opera')==-1)&&(agent.indexOf('webtv')==-1)&&(agent.indexOf("firefox")==-1));
//var isNav4up = (isNav && (isMajor>=4));
var isIE = (agent.indexOf("msie") != -1);
//var isIE4up = (isIE && (isMajor >=4));
var isFirefox = (agent.indexOf("firefox")!= -1);
var isWindows=agent.indexOf("win")!=-1;
var isLinux=agent.indexOf("x11")!=-1;



// Dummy function to allow inheritence
function sniff()
  {

  }


// use to find out operating system and browser
function reveal()
	{
		if (isWindows)
			{
				if (isIE)
					{
						alert("Windows - Internet Explorer");
					}
				else if (isNav)
					{
						alert("Windows - Netscape Navigator");
					}
				else if (isFirefox)
					{
						alert("Windows - Firefox");
					}
			}
		if (isLinux)
			{
				if (isNav)
					{
						alert("Linux - Netscape Navigator");
					}
				else if (isFirefox)
					{
						alert("Linux - Firefox");
					}
			}

	}

function validateForm()
	{
		if (document.form1.name.value == "")
	  	{
       		alert("Oops!!! - you've forgotten to enter your name :-)");
					return false;
			}

		if (document.form1.message.value == "")
	  	{
       		alert("Oops!!! - you've forgotten to enter a message :-)");
					return false;
			}

		if (document.form1.email.value == "")
	  	{
       		alert("Oops!!! - you've forgotten to enter your email address :-)");
					return false;
			}

		var namePattern=/\w{1,}@\w{1,}\x2e\w{2,}\x2e\w{2,3}|\w{1,}@\w{1,}(\x2e\w{2,3})$/;
		if (!namePattern.test(document.form1.email.value))
    		{
					alert("The email address entered appears invalid");
     			return false;
    		}


		return true;


	}

//	Launch will transfer the values from the visible form1 to the invisible form2. It then clears form1 and submits form2
//  This means anyone trying to submit multiple messages via the form1 will have to enter all values each time.
// A pain but legitimate occassions when you need to do this will be rare. It prevents easy hitting the back then submit buttons repeatedly.

	function launch()
    {
    document.getElementById("transfer").innerHTML="<form action=\"/cgi-bin/postman.pl\" method=\"post\" id=\"form2\" name=\"form2\">        <input type=\"hidden\" name=\"message\" id=\"message\" value=\"\"><input type=\"hidden\" name=\"name\" id=\"name\" value=\"\">        <input type=\"hidden\" name=\"org\" id=\"org\" value=\"\"><input type=\"hidden\" name=\"email\" id=\"email\" value=\"\">        <input type=\"hidden\" name=\"tel\" id=\"tel\" value=\"\"></form>";


 //     alert(document.forms[1].id);

      document.form2.name.value=document.form1.name.value;
      document.form2.message.value=document.form1.message.value;
      document.form2.org.value=document.form1.org.value;
      document.form2.email.value=document.form1.email.value;
      document.form2.tel.value=document.form1.tel.value;

 //     alert(document.form2.name.value+"\t"+document.form2.message.value+"\t"+document.form2.org.value+"\t"+document.form2.email.value+"\t"+document.form2.tel.value);

      document.form1.reset();

      document.form2.submit();

    }
