//<!--

// This include requires status.js to be included
var statusJs = "http://www.lg.elections.nsw.gov.au/by-election/status.js";
document.write('<scr' + 'ipt type="text/javascript" src="' + statusJs + '"></scr' + 'ipt>');

function printpage() {
	if ( document.getElementById('contentcolumn') ) {
		url = "/print.aspx";
		newwindow=window.open(url,'print','height=800,width=700,scrollbars=1,menubar=1,resizable=1');
		if (window.focus) newwindow.focus();
		newwindow.alert("To print landscape for: \nInternet Explorer:\n1. From the web page select print icon. \n2. From the IE browser menu select File -> Page Setup... \n3. From the Page Setup Window select Landscape then click OK button \n4. Select print icon at top-right corner of page \n5. print \n\nMozilla Firefox \n1. From the web page select the print icon. \n2. From the Firefox browser menu select File -> Page Setup... \n3. From the Page Setup Window select Landscape then click OK button \n4. Select print icon at top-right corner of page \n5. print \n\nTo print background images for: \nInternet Explorer \n1. From the web page select the print icon. \n2. From IE main menu select Tools -> Internet Options... \n3. From the Internet Options dialog box select the Advanced tab \n4. Turn on Print background colors and images then click OK button. \n5. Select print icon at top-right corner of page \n6. print \n\nMozilla Firefox \n1. From the web page select the print icon. \n2. From the Firefox browser menu select File -> Page Setup... \n3. From the Page Setup Window select Print Background (colors & images) then click OK button \n3. Select print icon at top-right corner of page \n4. print ");
	} else {
		alert("To print landscape for: \nInternet Explorer:\n1. From the web page select print icon. \n2. From the IE browser menu select File -> Page Setup... \n3. From the Page Setup Window select Landscape then click OK button \n4. Select print icon at top-right corner of page \n5. print \n\nMozilla Firefox \n1. From the web page select the print icon. \n2. From the Firefox browser menu select File -> Page Setup... \n3. From the Page Setup Window select Landscape then click OK button \n4. Select print icon at top-right corner of page \n5. print \n\nTo print background images for: \nInternet Explorer \n1. From the web page select the print icon. \n2. From IE main menu select Tools -> Internet Options... \n3. From the Internet Options dialog box select the Advanced tab \n4. Turn on Print background colors and images then click OK button. \n5. Select print icon at top-right corner of page \n6. print \n\nMozilla Firefox \n1. From the web page select the print icon. \n2. From the Firefox browser menu select File -> Page Setup... \n3. From the Page Setup Window select Print Background (colors & images) then click OK button \n3. Select print icon at top-right corner of page \n4. print ");
		window.print();
	}
	return false;
}

function displaystatus(obj) {
	window.status = obj.innerText;
}

function addDisplayStatus() {
	// Remove all href and onclick action for anchor element
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i < anchors.length; i++) {
		if (anchors[i].onmouseover == null)
	  		anchors[i].onmouseover = function () {displaystatus(this); return true;};
	}
}

function displayPartyName(pname) {
	var partydiv = document.getElementById("partyname");
	if (partydiv) {
		partydiv.style.visibility = "visible";
		partydiv.style.left = screen.width/4 + "px";
		partydiv.style.top = screen.height/4 + "px";
		partydiv.innerHTML = pname + "<br/><a href=\"javascript:closePartyName()\">Close</a>";
	} else {
        var newwindow = window.open("/partyname.aspx?partyname=" + pname, "PartyName", "width=300px,height=10px,status=no,menubar=no,location=no,scrollbars=auto,top=" + screen.height/2 + ",left=" + screen.width/3);
		newwindow.focus();
	}
}

function closePartyName() {
	var partydiv = document.getElementById("partyname");
	if (partydiv) {
		partydiv.style.visibility = "hidden";
	}
}

var PreferentialCount = "<br>" +
												"<table class=\"guide\"><tr><td>" +
												"<h3>Guide to:	PREFERENTIAL COUNT</h3>" +
												"<p>The Preferential Count (or Distribution of Preferences) is conducted to determine who is to be  elected.</p>" +
												"<p>The rules for the count and the way it is to be conducted is set out in the Seventh Schedule to the Constitution Act 1902.</p>" +
												"<p>A candidate is elected when they have accumulated more than half the votes remaining in the count. If no-one achieves this on first preferences, other candidates are progressively excluded and their votes transferred to remaining candidates.</p>" +
												"<p>The candidate with the least number of votes is always excluded, and their votes are transferred to the remaining candidates according to the voters next preference as shown on the ballot paper. If no further preference is shown the ballot paper exhausts.</p>" +
												"<p>The votes received by each candidate are then added to their total.</p>" +
												"<p>This process is repeated until a candidate is elected or only 2 candidates remain.</p>" +
												"<p>Scrutineers appointed by each candidate are welcome to attend and observe at the Returning Officer's office.</p>" +
												"</td></tr></table>" +
												"<br><br>";

var ElectionNight = "<br>" +
										"<table class=\"guide\"><tr><td>" +
										"<h3>Guide to:	ELECTION NIGHT RESULTS</h3>" +
										"<p>Election Night figures will show the result of counts conducted at each Polling Place on election night.</p>" +
										"<p>After voting closes at 6.00 pm on Saturday, the staff at each polling place will open the ballot boxes and count the votes recorded for each candidate. Only the first preference vote for each candidate, ie the number 1, is counted.</p>" +
										"<p>Registered Scrutineers appointed by each candidate are welcome to attend and observe in the polling place.</p>" +
										"<p>Note that these figures do not yet include any Postal, Prepoll, Absent, or other declaration votes.</p>" +
										"<p>First polling place results are not expected before 6.30 pm. Results from all Polling Places should be available by 11.00 pm.</p>" +
										"</td></tr></table>" +
										"<br><br>";

var ElectionNightNotional = "<br>" +
														"<table class=\"guide\"><tr><td>" +
														"<h3>Guide to:	ELECTION NIGHT NOTIONAL RESULTS</h3>" +
														"<p>Election Night Notional figures will show the result of the notional count conducted at each Polling Place on election night.</p>" +
														"<p>After voting closes at 6.00 pm on Saturday, the staff at each polling place will open the ballot boxes and count the votes recorded for each candidate. As well as counting the first preference vote, ie the number 1, a notional count is conducted.</p>" +
														"<p>A notional count is a count where only 2 candidates are considered.</p>" +
														"<p>The 2 candidates, who are selected prior to election day, are considered the most likely to be the winning candidate and runner-up when preferences are later distributed.</p>" +
														"<p>For this Notional count to be reliable in forecasting the result, the 2 candidates selected must ultimately turn out to be the last 2 candidates when the real Distribution of Preference count is conducted on the Wednesday after the election.</p>" +
														"<p>Each ballot paper is allocated to one of these 2 candidates, based on whichever has the highest preference. Any ballot paper with no preference for either candidate is termed exhausted.</p>" +
														"<p>This process replicates the last stage of the distribution of preferences, where all but 2 candidates have been excluded.</p>" +
														"<p>Note that these figures do not yet include any Postal, Prepoll, Absent, or other declaration votes.</p>" +
														"<p>Registered Scrutineers appointed by each candidate are welcome to attend and observe.</p>" +
														"<p>First notional results are not expected before 6.30 pm. Results from all Polling Places should be available by 11.00 pm</p>" +
														"</td></tr></table>" +
														"<br><br>";


var PostElectionNightNotional = "<br><br>" +
																"<table class=\"guide\"><tr><td>" +
																"<h3>Guide to: 	POST ELECTION NIGHT NOTIONAL RESULTS</h3>" +
																"<p>After the Check Count has been conducted on Sunday of the votes cast at polling places a Notional Count is conducted. (See election Night Notional Results for details)</p>" +
																"<p>Some Declaration votes (Postal Prepoll, Absent etc) are also being counted and added progressively to the results. As these declaration votes are counted, a notional count is also conducted on these.</p>" +
																"<p>Registered Scrutineers appointed by each candidate are welcome to attend and observe at the Returning Officer's office.</p>" +
																"</td></tr></table>" +
																"<br><br>";

var PostElectionNight = "<br><br>" +
												"<table class=\"guide\"><tr><td>" +
												"<h3>Guide to:	POST ELECTION NIGHT RESULTS</h3>" +
												"<p>The Election Night figures show the result of counts conducted at each Polling Place on election night. All ballot papers from polling places are then delivered back to the Returning Officer.</p>" +
												"<p>On the Sunday, the Returning Officer will recount all the ballot papers from every polling place to ensure the Election Night count was accurate. This is called the Check Count.</p>" +
												"<p>Not all people voted at  a polling place on Election Day.  Many voted either Absent, Postal or Prepoll. These votes need to be counted and included, and are shown in this table as separate categories below the polling places.</p>" +
												"<p>The Post election Night figures will therefore show both the result  of the Check Count by Sunday evening, and the count of the declaration votes which will be added progressively over the next few days. (Postal Votes can be accepted up to Wednesday afternoon after election day, and absent votes need to be transferred from other districts)</p>" +
												"<p>Registered Scrutineers appointed by each candidate are welcome to attend and observe counting at the Returning Officer's office.</p>" +
												"</td></tr></table>" +
												"<br><br>";


var TwoPartyPreferredCount = "<br><br><br><br><br><br><br><br><br><br>";

function printExplanation(electype) {
	document.write(eval(electype));
}

function outputFooter() {
	var footer = '<div id="footer">' +
							 '<div id="site-tools-footer">' +
							 'Developed  by <a href="http://www.eglootech.com/" target="_blank"> eGloo Technologies Pty Limited</a><br><br>' + servername + ' - ' +
							 'Press CTRL+F5 to refresh this page on PCs' +
							 '</div>' +
							 '<div>' +
							 '<a href="http://www.elections.nsw.gov.au/copyright" target="_blank">Copyright </a> &copy; NSW State Electoral Commission, 2008<br>' +
							 '<a href="http://www.elections.nsw.gov.au/" target="_blank">www.elections.nsw.gov.au </a><br>' +
							 'Please read our <a href="http://www.elections.nsw.gov.au/privacy_statement" target="_blank">Privacy Statement</a>,' +
							 '<a href="http://www.elections.nsw.gov.au/accessibility_statement" target="_blank">Accessibility Statement</a> and' +
							 '<a href="http://www.elections.nsw.gov.au/disclaimer" target="_blank">Disclaimer</a>' +
							 '</div>' +
							 '<div class="clr">&#160;</div>' +
							 '</div>';
	document.write(footer);
}

function outputStatus(area, elect) {
	document.write(eval(area));
}

function printElected(district) {
	document.write(eval(district + '_elected'));
}
//-->
