var copyright = "copyright";
var privacy = "privacy";
var disclaimer = "disclaimer";
var webAdmin = "webAdmin";

var copyrightPop = "<div><h1>CHAP - Copyright</h1></div><div class='body14padding'>1. Copyright in this Site is owned by Country Home Advocacy Project Incorporated.<br /><br />2. Apart from any use permitted by the Copyright Act 1968, Country Home Advocacy Project Incorporated grants visitors to the site a licence to download, display, print and reproduce this material for private use or use within your organisation, for non-commercial purposes only.<br /><br />3. No licence to publish, communicate, modify, commercialise or alter this material is granted. For reproduction or use of the Country Home Advocacy Project Incorporated copyright material beyond this limited licence, permission must be sought from Country Home Advocacy Project Incorporated.<br /><br />4. That permission, if given, will be subject to conditions that will include a requirement that the copyright owner's name and interest in the material be acknowledged when the material is reproduced or quoted, either in whole or in part. No permission to reproduce or use Country Home Advocacy Project Incorporated, other than that expressly stated above, is to be implied by the availability of that material on this Site. </div><div><h2><form action='javascript:closeWindow()' method='post'><input type='submit' name='submit' value='Close'/></form></h2></div>";

var privacyPop = "<div><h1>CHAP - Privacy</h1></div><div class='body14padding'>Information about us can be obtained by contacting our Privacy Officer on 8565 8100 or facsimile on 8562 4097. Country Home Advocacy Project Incorporated acknowledges and is committed to protecting your privacy. We will only collect, use, disclose and hold personal information in accordance with the Privacy Act 1988 ('the Act').<br /><br />1. A record of your visit which logs the following information for statistical purposes - the user's IP address, the date and time of the visit to the Site, the length of time spent on the site, the pages accessed, documents downloaded, if you are browsing from Australia or outside Australia and the type of browser used. No attempt will be made to identify users or their browsing activities except, in the unlikely event of an investigation where a law enforcement agency may exercise a warrant to inspect our service provider's logs. This information is analysed at the end of each month to determine the site's usage statistics.<br /><br />2. Your personal information will not be disclosed to any third party.<br /><br />3. You should note that there are inherent risks associated with transmission of information via the Internet. You should make your own assessment of the potential risks to the security of your information when making a decision as to whether or not you should utilise this site. There are alternative ways to obtaining information from, and transacting business with Country Home Advocacy Project Incorporated for those users who do not wish to use the Internet.<br /><br />4. Please note that this site contains links to other web sites that are included on the basis of containing content related to Country Home Advocacy Project Incorporated. When a user has clicked on a link to another website, they leave this site and this privacy statement does not apply to those websites.</div><div><h2><form action='javascript:closeWindow()' method='post'><input type='submit' name='submit' value='Close'/></form></h2></div>";

var disclaimerPop = "<div><h1>CHAP - Disclaimer</h1></div><div class='body14padding'>1. Before relying on the material users should independently verify its relevance for their purposes and should obtain any appropriate professional advice.<br /><br />2. Country Home Advocacy Project Incorporated web pages contain links to third party sites not managed by Country Home Advocacy Project Incorporated. Those sites are not within our control and may not follow the same privacy, security, or accessibility standards as ours. We are not responsible for the content or availability of those sites, their partners, or advertisers. Any link to an external site is provided for your information and convenience only.<br /><br />3. Country Home Advocacy Project Incorporated makes reasonable efforts to ensure this website is available for users when required. However, Country Home Advocacy Project Incorporated cannot guarantee to provide continuous or uninterrupted access to this website. Country Home Advocacy Project Incorporated also cannot guarantee this website or software downloaded from it will be free from computer viruses. All files are scanned for viruses before uploading to the web server. Country Home Advocacy Project Incorporated recommends an antivirus software to be installed.</div><div><h2><form action='javascript:closeWindow()' method='post'><input type='submit' name='submit' value='Close'/></form></h2></div>";

var webEmailPop = "<div><h1>Web Administrator - Email</h1></div><div class='body10'>Please fill in all fields marked with a *<br /></div><div class='body14'><form action='php/webEmail.php' method='post' enctype='multipart/form-data' name='emailForm' id='emailForm' onSubmit return webValidateEmail(this)';><table width='100%' border='0'><tr><td>Name*</td><td><input name='Name' id='Name' type='text' size='50' maxlength='50' /></td></tr><tr><td>Organisation</td><td><input name='Organisation' id='Organisation' type='text' size='50' maxlength='50' /></td></tr><tr><td>Your Email*</td><td><input name='Email' id='Email' type='text' size='50' maxlength='50' /></td></tr><tr><td>Message*</td><td><textarea name='Message' id='Message' rows='5' cols='50'></textarea></td></tr><tr><td colspan='2'><div align='center'><input name='submit' type='submit' id='submit' value='Submit Form'><input name='reset' type='reset' id='reset' value='Reset Form'></div></td></tr></table></form></div><div><h2><form action='javascript:closeWindow()' method='post'><input type='submit' name='submit' value='Cancel'/></form></h2></div>";

function popLink(bottomLink)
{
	if (bottomLink == "copyright")
	{
		document.getElementById('popUpWindow').style.display="block";
		document.getElementById('popUpWindow').className="bottomLinkWindow";
		document.getElementById('popUpWindow').innerHTML=copyrightPop;
		centerElement('popUpWindow');
	}
	else if (bottomLink == "privacy")
	{
		document.getElementById('popUpWindow').style.display="block";
		document.getElementById('popUpWindow').className="bottomLinkWindow";
		document.getElementById('popUpWindow').innerHTML=privacyPop;
		centerElement('popUpWindow');
	}
	else if (bottomLink == "disclaimer")
	{
		document.getElementById('popUpWindow').style.display="block";
		document.getElementById('popUpWindow').className="bottomLinkWindow";
		document.getElementById('popUpWindow').innerHTML=disclaimerPop;
		centerElement('popUpWindow');
	}
	else if (bottomLink == "webAdmin")
	{
		document.getElementById('popUpWindow').style.display="block";
		document.getElementById('popUpWindow').className="emailWindow";
		document.getElementById('popUpWindow').innerHTML=webEmailPop;
		centerElement('popUpWindow');
	}
}
function webValidateEmail()
{
	var name = document.getElementById('Name').value;
	var email = document.getElementById('Email').value;
	var organisation = document.getElementById('Organisation').value;
	var message = document.getElementById('Message').value;
	var emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;
	if (name == "")
	{
		window.alert("Please Enter a Name");
		return false;
	}
	else if(emailPattern.test(email)==false) 
	{
		window.alert("Invalid email address entered, Please try again.");
		return false;
	}
	else if (message == "")
	{
		window.alert("Please Enter a Message");	
		return false;
	}
	else
	{
		return true;
	}
}
