// scripts/main.css contains javascript functions
//

// function browsr detects which web browser is being 
// used to display the page
	var browser = 0;
	var version = parseInt(navigator.appVrsion);
	var name = navigator.appName;
	
	function browsr(choice) {
	//
		if (name == "Netscape") {
			//
			browser = 2;
			}
		else if (name == "Microsoft Internet Explorer") {
			//
			browser = 1;
			}
	}	
	
	var w;	// the popup window
	var myPage = ""; // page address
	var myTitle = ""; // page title
	
	function popup(choice) {
		//

		switch(choice) {
			case 1:
				if (w) {w.close(); }
				myTitle = "Introduction";
				myPage ="popups/introduction.html";
				break;
			case 2:
				if (w) {w.close(); }
				myPage = "popups/valueformoney.html";
				myTitle = "ValueForMoney";
				break;
			case 3:
				if (w) {w.close(); }
				myPage = "popups/improvingdemocracy.html";
				myTitle = "ImprovingDemocracy";
				break;
			case 4:
				if (w) {w.close(); }
				myPage = "popups/housing.html";
				myTitle = "Housing";
				break;
			case 5:
				if (w) {w.close(); }
				myPage = "popups/climategreen.html";
				myTitle = "Climate_Change_Green_Issues";
				break;
			case 6:
				if (w) {w.close(); }
				myPage = "popups/environment.html";
				myTitle = "The_Living_Environment";
				break;
			case 7:
				if (w) {w.close(); }
				myPage = "popups/crimeorder.html";
				myTitle = "Crime_and_Order";
				break;
			case 8:
				if (w) {w.close(); }
				myPage = "popups/economicstrength.html";
				myTitle = "Economic_strength";
				break;
			case 9:
				if (w) {w.close(); }
				myPage = "popups/sustainability.html";
				myTitle = "Sustainability_and_Community";  
				break;
			case 10:
				if (w) {w.close(); }
				self.location.replace("index.html");

				break;
			case 11:
				if (w) {w.close(); }
				myPage = "popups/how.html";
				myTitle = "How_do_I_vote";  
				break;
			case 12:
				if (w) {w.close(); }
				myPage = "popups/where.html";
				myTitle = "Where_do_I_vote";  
				break;
			case 13:
				if (w) {w.close(); }
				myPage = "popups/count.html";
				myTitle = "Does_my_vote_count";  
				break;
			case 14:
				if (w) {w.close(); }
				myPage = "popups/know.html";
				myTitle = "How_do_I_know_there_is_an_Election";  
				break;
			case 15:
				if (w) {w.close(); }
				myPage = "popups/selection.html";
				myTitle = "Can_I_become_a_Councillor";  
				break;
			case 16:
				if (w) {w.close(); }
				myPage = "popups/becoming.html";
				myTitle = "How_are_candidates_selected";  
				break;
			case 17:
				if (w) {w.close(); }
				myPage = "popups/meetings.html";
				myTitle = "How_often_do_Councils_meet";  
				break;
			case 18:
				if (w) {w.close(); }
				myPage = "popups/attend.html";
				myTitle = "How_do_I_vote";  
				break;
			case 19:
				if (w) {w.close(); }
				myPage = "popups/views.html";
				myTitle = "How_can_I_make_my_views_known";  
				break;
			case 20:
				if (w) {w.close(); }
				myPage = "popups/for.html";
				myTitle = "What_am_I_voting_for";  
				break;
			case 21:
				if (w) {w.close(); }
				myPage = "popups/membersonly.php";
				myTitle = "Members_only";  
				break;
			case 22:
				if (w) {w.close(); }
				myPage = "membersonly.php";
				myTitle = "Members_only";  
				break;
			case 23:
				if (w) {w.close(); }
				self.close();

				break;
			case 24:
				if (w) {w.close(); }
				myPage = "popups/legacy.html";
				myTitle = "The_Legacy";  
				break;
			case 25:
				if (w) {w.close(); }
				myPage = "popups/funding.html";
				myTitle = "Local_Government_Funding";  
				break;
			} 
		if ((choice != 10) && (choice != 23)) { 
		 
			if (browser == 1) {
				if (choice == 21) {
		w = window.open(myPage, myTitle, "width=1024, height=800, resizable=yes, scrollbars=yes, menubar=yes"); }
				else {
		w = window.open(myPage, myTitle, "width=500, height=600, resizable=1, scrollbars=1, menubar=1"); }
				}
			else if (browser == 2){
				if (choice == 21) {
		w = window.open(myPage, myTitle, "width=1024, height=800, resizable=yes, scrollbars=yes, menubar=yes");
				}
				else {
		w = window.open(myPage, myTitle, "width=500, height=600, resizable=yes,s crollbars=yes, menubar=yes"); 
				}
			}
			w.moveTo(250, 100);
			w.focus(); 
		}
	}
	
	function breakout(choice) {
		close();
		switch (choice) {
			case 1:
				myPage = "http://www.bishopsstortford.org/ ";
				myTitle = "Bishops_Stortford_Town_Website";
				break;
			case 2:
				myPage = "http://www.hertford.gov.uk/";
				myTitle = "Hertford_Town_Website";
				break;
			case 3:
				myPage = "http://www.sawbridgeworth-tc.gov.uk/ ";
				myTitle = "sawbridgeworth_Town_Website";
				break;
			case 4:
				myPage = "http://www.waretowncouncil.gov.uk/ ";
				myTitle = "Ware_Town_Website";
				break;
			case 5:
				myPage = "http://www.eastherts.gov.uk/ ";
				myTitle = "East_Herts_District_Website";
				break;
			case 6:
				myPage = "http://www.hertsdirect.org/ ";
				myTitle = "Herts_County_Website";
				break;
			case 7:
				myPage = "http://www.markprisk.com/ ";
				myTitle = "Mark_Prisk_Website";
				break;
			case 8:
				myPage = "http://www.richardhowittmep.com/ ";
				myTitle = "Richard_Howitt_Website";
				break;
			case 9:
				myPage = "http://www.eastherts.gov.uk/index.jsp?articleid=10915 ";
				myTitle = "Election_forms";
				break;
			case 10:
				myPage = "http://www.eastherts.gov.uk/index.jsp?articleid=2077 ";
				myTitle = "Election_forms";
				break;
			case 11:
				myPage = "http://www.eastherts.gov.uk/index.jsp?articleid=460";
				myTitle = "Election_forms";
				break;
			case 12:
				myPage = "http://www.nehertslabour.org.uk/ ";
				myTitle = "NE_Herts";
				break;
			default:
		}
		if (browser == 1) {
		w = window.open(myPage, myTitle, "width=800, height=600, resizable=1, scrollbars=1, menubar=1, toolbar=1" ); 
			}
		else if (browser == 2){
		w = window.open(myPage, myTitle, "width=800, height=600, resizable=yes, scrollbars=yes, menubar=yes, toolbar=yes" ); 
			}		
		w.focus(); 
	}
	

		


	
