// Convert to Lower-Case
    var agt = navigator.userAgent.toLowerCase();
    var appVer = navigator.appVersion.toLowerCase();

// Detect Browser Version

    var is_minor = parseFloat(appVer);
    var is_major = parseInt(is_minor);

    var iePos  = appVer.indexOf('msie');
    if (iePos !=-1) {
       is_minor = parseFloat(appVer.substring(iePos+5,appVer.indexOf(';',iePos)))
       is_major = parseInt(is_minor);
    }

    var is_getElementById   = (document.getElementById) ? "true" : "false"; 
    var is_getElementsByTagName = (document.getElementsByTagName) ? "true" : "false"; 
    var is_documentElement = (document.documentElement) ? "true" : "false"; 

    var is_moz   = ((agt.indexOf('mozilla/5')!=-1) && (agt.indexOf('spoofer')==-1) &&
                    (agt.indexOf('compatible')==-1) && (agt.indexOf('opera')==-1)  &&
                    (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1)     &&
                    (agt.indexOf('gecko/index.html')!=-1) && 
                    ((navigator.vendor=="")||(navigator.vendor=="Mozilla")));
    if (is_moz) {
       var is_gver = (navigator.productSub)?navigator.productSub:0;
       var is_moz_ver = (navigator.vendorSub)?navigator.vendorSub:0;
       if(!(is_moz_ver)) {
           is_moz_ver = agt.indexOf('rv:');
           is_moz_ver = agt.substring(is_moz_ver+3);
           is_paren   = is_moz_ver.indexOf(')');
           is_moz_ver = is_moz_ver.substring(0,is_paren);
       }
       is_minor = is_moz_ver;
       is_major = parseInt(is_moz_ver);
    }

    var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
                && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
                && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1)
                && (!(is_moz)));

    if ((navigator.vendor)&&
        ((navigator.vendor=="Netscape6")||(navigator.vendor=="Netscape"))&&
        (is_nav)) {
       is_major = parseInt(navigator.vendorSub);
       is_minor = parseFloat(navigator.vendorSub);
    }

    var is_opera = (agt.indexOf("opera") != -1);
    var is_opera2 = (agt.indexOf("opera 2") != -1 || agt.indexOf("opera/2") != -1);
    var is_opera3 = (agt.indexOf("opera 3") != -1 || agt.indexOf("opera/3") != -1);
    var is_opera4 = (agt.indexOf("opera 4") != -1 || agt.indexOf("opera/4") != -1);
    var is_opera5 = (agt.indexOf("opera 5") != -1 || agt.indexOf("opera/5") != -1);
    var is_opera6 = (agt.indexOf("opera 6") != -1 || agt.indexOf("opera/6") != -1); 
    var is_opera5up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4);
    var is_opera6up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4 && !is_opera5); 

    var is_nav2 = (is_nav && (is_major == 2));
    var is_nav3 = (is_nav && (is_major == 3));
    var is_nav4 = (is_nav && (is_major == 4));
    var is_nav4up = (is_nav && is_minor >= 4);  
    var is_navonly      = (is_nav && ((agt.indexOf(";nav") != -1) ||
                          (agt.indexOf("; nav") != -1)) );
    var is_nav6   = (is_nav && is_major==6);    
    var is_nav6up = (is_nav && is_minor >= 6) 
    var is_nav5   = (is_nav && is_major == 5 && !is_nav6); 
    var is_nav5up = (is_nav && is_minor >= 5);
    var is_nav7   = (is_nav && is_major == 7);
    var is_nav7up = (is_nav && is_minor >= 7);

    var is_ie   = ((iePos!=-1) && (!is_opera));
    var is_ie3  = (is_ie && (is_major < 4));
    var is_ie4   = (is_ie && is_major == 4);
    var is_ie4up = (is_ie && is_minor >= 4);
    var is_ie5   = (is_ie && is_major == 5);
    var is_ie5up = (is_ie && is_minor >= 5);
    var is_ie5_5  = (is_ie && (agt.indexOf("msie 5.5") !=-1)); 
    var is_ie5_5up =(is_ie && is_minor >= 5.5);               
    var is_ie6   = (is_ie && is_major == 6);
    var is_ie6up = (is_ie && is_minor >= 6);

    var is_aol   = (agt.indexOf("aol") != -1);
    var is_aol3  = (is_aol && is_ie3);
    var is_aol4  = (is_aol && is_ie4);
    var is_aol5  = (agt.indexOf("aol 5") != -1);
    var is_aol6  = (agt.indexOf("aol 6") != -1);
    var is_aol7  = ((agt.indexOf("aol 7")!=-1) || (agt.indexOf("aol7")!=-1));

    var is_webtv = (agt.indexOf("webtv") != -1);
    
    var is_TVNavigator = ((agt.indexOf("navio") != -1) || (agt.indexOf("navio_aoltv") != -1)); 
    var is_AOLTV = is_TVNavigator;

    var is_hotjava = (agt.indexOf("hotjava") != -1);
    var is_hotjava3 = (is_hotjava && (is_major == 3));
    var is_hotjava3up = (is_hotjava && (is_major >= 3));

//Now we want to determine the OS the user is working with
	var win = false;
	var win16 = false;
	var win31 = false;
	var win95 = false;
	var win98 = false;
	var winme = false;
	var winnt = false;
	var win2k = false;
	var winxp = false;
	var win32 = false;
	var os2 = false;
	var mac = false;
	var mac68k = false;
	var macppc = false;
	var other_os = false;

//Switch to lower case
	var agt = navigator.userAgent.toLowerCase();

//Use indexOf to examine the userAgent string to determine the OS

//Win
	if ((agt.indexOf("win")!=-1) || 
	(agt.indexOf("16bit")!=-1) ) {win = true }
	
//Win16
	if ((agt.indexOf("win16")!=-1) ||
	(agt.indexOf("16bit")!=-1) || 
	(agt.indexOf("windows 3.1")!=-1) ||
	(agt.indexOf("windows 16-bit")!=-1) ) {win16 = true }
  	
//Windows 3.1
	else if ((agt.indexOf("windows 3.1") != -1) || 
	(agt.indexOf("win16") != -1) || 
	(agt.indexOf("16bit") != -1) || 
	(agt.indexOf("16-bit") != -1)) { win31 = true }

//Windows 95
	else if ((agt.indexOf("windows 95") != -1) ||
	(agt.indexOf("win95") != -1)) { win95 = true } 

//Windows 98
	else if ((agt.indexOf("windows 98") != -1) ||
	(agt.indexOf("win98") != -1)) { win98 = true }

//Windows NT
	else if ((agt.indexOf("windows nt") != -1) ||
	(agt.indexOf("winnt") != -1)) { winnt = true }

//Windows ME
	else if ((agt.indexOf("win 9x 4.90") != -1) ||
	(agt.indexOf("winme") != -1)) { winme = true }

//Windows 2000
	else if ((agt.indexOf("windows nt 5.0") != -1) ||
	(agt.indexOf("windows 2000") != -1)) { win2000 = true }

//Windows XP
	else if ((agt.indexOf("windows nt 5.1") != -1) ||
	(agt.indexOf("windows xp") != -1)) { winxp = true }

//Win32
	else if (win95 || winnt || win98 ||
	((is_major >= 4) && (navigator.platform == "Win32")) ||
	(agt.indexOf("win32")!=-1) || (agt.indexOf("32bit")!=-1)) {win32 = true }

//OS2
	else if ((agt.indexOf("os/2")!=-1) ||
	(navigator.appVersion.indexOf("OS/2")!=-1) ||
	(agt.indexOf("ibm-webexplorer")!=-1)) {os2 = true }

//Mac
	else if (agt.indexOf("mac")!=-1) {mac = true}

//Mac 680x0
	else if ((agt.indexOf("mac") != -1) &&
	((agt.indexOf("68K") != -1) ||
	(agt.indexOf("68000") != -1))) { mac68k = true }

//MAC PowerPC
	else if ((agt.indexOf("mac") != -1) &&
	((agt.indexOf("ppc") != -1) ||
	(agt.indexOf("powerpc") != -1))) { macppc = true }

//Undefined
	else { other_os = true }


//Now we look at the environment
  
// cookies
	document.iMokie = "cookies=true";
	var is_cookie = (document.iMokie) ? "true" : "false";
	var is_images = (document.images) ? "true":"false";
	var is_layers = (document.layers) ? "true":"false"; 

// Document Objects
	var is_forms = (document.forms) ? "true" : "false";
	var is_links = (document.links) ? "true" : "false";
	var is_frames = (window.frames) ? "true" : "false";
	var is_screen = (window.screen) ? "true" : "false";

//Now check to see if user has javascript enabled
	var javaOK = "unknown";
	if (navigator.javaEnabled()==true){
		javaOK="Yes";
		}
		else{
		javaOK="No";
}

//The Following functions setup the use of popup windows

function detectVersion()
	{
	version = parseInt(navigator.appVersion);
	return version;
	}

function detectOS()
	{
	if(navigator.userAgent.indexOf('Win') == -1) {
	OS = 'Macintosh';
	} else {
	OS = 'Windows';
	}
	return OS;
	}

function detectBrowser()
	{
	if(navigator.appName.indexOf('Netscape') == -1) {
	browser = 'IE';
	} else {
	browser = 'Netscape';
	}
	return browser;
	}

//TO Prenvent Right Clicks
/*
function click(){
	if (event.button==2) 
	{
	alert('Sorry your right mouse button has been temporarilly disabled');
	}
}
document.onmousedown=click
*/

//Closing Windows
function closeWindow() {
	window.close('this');
	}

//General Open Window
function openNewWindow(URLtoOpen, windowName, windowFeatures){ 
	newWindow = window.open(URLtoOpen, windowName,windowFeatures); 
	}

//For General POP-Up Screens

//CONTACT AND FEEDBACK
/*
	var ContactFeedbackX = (screen.width/2)-150;
	var ContactFeedbackY = (screen.height/2)-200;
	var pos = "left="+ContactFeedbackX+",top="+ContactFeedbackY;
	function ContactFeedback(){
	ContactFeedbackWindow = window.open("/PACE2/forms/ContactFeedback.html","ContactFeedback","scrollbars=no,resizable=yes,width=320,height=320,"+pos);
	}
*/
	function ContactFeedback(){
		location.href =  'forms/ContactFeedback.html';
	}
//CONTACT
/*
	var ContactX = (screen.width/2)-150;
	var ContactY = (screen.height/2)-200;
	var pos = "left="+ContactX+",top="+ContactY;
	function Contact(){
	ContactWindow = window.open("/PACE2/forms/ContactFeedback.html","Contact","scrollbars=no,resizable=yes,width=320,height=320,"+pos);
	}
*/
	function Contact(){
		location.href =  'forms/ContactFeedback.html';
	}


//FEEDBACK
/*	
	var FeedbackX = (screen.width/2)-150;
	var FeedbackY = (screen.height/2)-200;
	var pos = "left="+FeedbackX+",top="+FeedbackY;
	function Feedback(){
	FeedbackWindow = window.open("/PACE2/forms/ContactFeedback.html","Feedback","scrollbars=no,resizable=yes,width=320,height=320,"+pos);
	}
*/
	function Feedback(){
		location.href =  'forms/ContactFeedback.html';
	}


//ABOUT PACE
function Home() {
	location.href =  'HTML/AboutPace.html';
}

//SUPPORT
function Support() {
	location.href =  'HTML/Support.html';
}

//Education
function Education() {
	location.href =  'HTML/Education.html';
}

//NEWS AND INFO
function Newsinfo() {
	location.href =  'HTML/NewsInfo.html';
}

//HealthNetwork
function Health() {
	location.href =  'HTML/HealthNetwork.html';
}

//Resources
function Resources() {
	location.href =  'HTML/Resources.html';
}

//LINKS
function Links() {
	location.href =  'HTML/Links.html';
}

//DONATIONS AND VOLUNTEERS
function DonationsVolunteers() {
	location.href =  'HTML/DonationsVolunteers.html';
}

//DONATIONS FORM
function Donations() {
	location.href =  'forms/DonationForm.html';
}

//DONATIONS FORM
function donationForm() {
	location.href =  'forms/DonationForm.html';
}

//VOLUNTEER FORM
function Volunteers() {
	alert ("Sorry, this function is currently disabled");
	//history.back (-1);
	//location.href =  '/PACE2/forms/VolunteerForm.html';
}

//VOLUNTEER FORM
function volunteerForm() {
	alert ("Sorry, this function is currently disabled");
	//history.back (-1);
	//location.href =  '/PACE2/forms/VolunteerForm.html';
}

//PRACTICUM FORM
function Practicum() {
	alert ("Sorry, this function is currently disabled");
	//history.back (-1);
	//location.href =  '/PACE2/forms/PracticumForm.html';
}

//PRACTICUM FORM
function practicumForm() {
	alert ("Sorry, this function is currently disabled");
	//history.back (-1);
	//location.href =  '/PACE2/forms/PracticumForm.html';
}


//OutreachCrisis
function Outreach() {
	location.href =  'HTML/OutreachCrisis.html';
}

//PEACH
function PEACH() {
	alert ("Sorry, this function is currently disabled");
	//location.href =  '/PACE2/HTML/PEACH.html';
}

//AWARDS AND EVALUATION
function AwardsEvaluations() {
	location.href =  'HTML/AwardsEvaluations.html'	;
}

//Community AND Client SUPPORT
function CommunityClient() {
	location.href =  'HTML/CommunityClient.html';
}

//Advocacy
function Advocacy() {
	location.href =  'HTML/Advocacy.html';
}

//MAPS
function Maps() {
	alert ("Sorry, this function is currently disabled");
	//location.href =  '/PACE2/HTML/MAPS.html';
}

//PACE EVENTS CALENDAR
function Events() {
	location.href =  'calendar/calendar.html';
}

//Prevention
function Prevention() {
	location.href =  'HTML/Prevention.html';
}

//PRIVACY POLICY
function Privacy() {
	location.href =  'HTML/privacy_policy.html';
}

//COPYRIGHT
function Copyright() {
	location.href =  'HTML/copyright.html';
}

//SITE REQUIREMENTS
function SiteRequirements() {
	location.href =  'HTML/site_requirements.html';
}


//LOGIN
function login() {
	location.href =  'forms/login.html';
}
	
//REGISTER
function register() {
	location.href =  'forms/registration.html';
}

//SHOUTS FROM THE STREETS
function Word() {
	location.href =  'HTML/shouts.html';
}

//MEDIA
function Media() {
	location.href =  'HTML/media.html';
}

//NEWS MEDIA
function NewMedia() {
	location.href =  'HTML/media.html';
}

//BAD DATE SHEETS
function BadDate() {
	location.href =  'HTML/baddate.html';
}

//PACE PUBLICATIONS
function Publications() {
	location.href =  'HTML/publications.html';
}

//PACE RESEARCH
function Research() {
	location.href =  'HTML/research.html';
}

//PACE VIDEO
function Video() {
	location.href =  'HTML/video.html';
}

//FAQ
function FAQ() {
	//alert ("Sorry, no questions have been submitted to the FAQ database at this time.");
	location.href =  'HTML/FAQ.html';
}

//ADVANCED SEARCH
function AdvancedSearch() {
	location.href =  'advancedsearch.html';
}

//VIOLENCE REPORT
	var violenceReportX = (screen.width/2)-150;
	var violenceReportY = (screen.height/2)-200;
	var pos = "left="+violenceReportX+",top="+violenceReportY;
	function violenceReport(){
	violenceReportWindow = window.open("http://24.85.225.7/PACE2/docs/pdf/PACE_Violence_Report.pdf","ViolenceReport","scrollbars=yes,resizable=yes,width=400,height=400,"+pos);
	}

//DOWNLOAD ADOBE ACROBAT READER
	var downloadAcrobatX = (screen.width/2)-150;
	var downloadAcrobatY = (screen.height/2)-200;
	var pos = "left="+downloadAcrobatX+",top="+downloadAcrobatY;
	function downloadAcrobat(){
	downloadAcrobatWindow = window.open("http://www.adobe.com/products/acrobat/readstep2.html","DownloadAcrobat","scrollbars=yes,resizable=yes,width=400,height=400,"+pos);
	}

//DOWNLOAD SHOCKWAVE PLAYER
	var downloadShockwaveX = (screen.width/2)-150;
	var downloadShockwaveY = (screen.height/2)-200;
	var pos = "left="+downloadShockwaveX+",top="+downloadShockwaveY;
	function downloadShockwave(){
	downloadShockwaveWindow = window.open("http://sdc.shockwave.com/shockwave/download/download.cgi?&amp;P5_Language=English","DownloadShockwave","scrollbars=yes,resizable=yes,width=400,height=400,"+pos);
	}
	
//MACROMEDIA
	var MacromediaX = (screen.width/2)-150;
	var MacromediaY = (screen.height/2)-200;
	var pos = "left="+MacromediaX+",top="+MacromediaY;
	function Macromedia(){
	MacromediaWindow = window.open("http://www.macromedia.com/downloads/","Macromedia","scrollbars=yes,resizable=yes,width=400,height=400,"+pos);
	}	

//DOWNLOAD IE
	var downloadIEX = (screen.width/2)-150;
	var downloadIEY = (screen.height/2)-200;
	var pos = "left="+downloadIEX+",top="+downloadIEY;
	function downloadIE(){
	downloadIEWindow = window.open("http://www.microsoft.com/windows/ie/downloads/critical/ie6sp1/default.asp","DownloadIE","scrollbars=yes,resizable=yes,width=400,height=400,"+pos);
	}

//DOWNLOAD NN
	var downloadNNX = (screen.width/2)-150;
	var downloadNNY = (screen.height/2)-200;
	var pos = "left="+downloadNNX+",top="+downloadNNY;
	function downloadNN(){
	downloadNNWindow = window.open("http://channels.netscape.com/ns/browsers/download.jsp","DownloadNN","scrollbars=yes,resizable=yes,width=400,height=400,"+pos);
	}

//POLL QUESTION HANDLER
	var poll_questX = (screen.width/2)-150;
	var poll_questY = (screen.height/2)-200;
	var pos = "left="+poll_questX+",top="+poll_questY;
	function poll_quest(){
	poll_questWindow = window.open("scripts/poll_quest.html","poll_quest","scrollbars=yes,toolbar=yes,status=yes,resizable=yes,width=400,height=400,"+pos);
	}
		
//RELOAD
function Reload() {
	//window.opener.reload;
	window.opener.location.reload(true);
	window.close('this');
}
	
//CURRENT NEWS HANDLER
	var current_newsX = (screen.width/2)-150;
	var current_newsY = (screen.height/2)-200;
	var pos = "left="+current_newsX+",top="+current_newsY;
	function current_news(){
	current_newsWindow = window.open("http://www.canada.com/vancouver/story.asp?id=97D00315-C73B-40B5-9039-29C8AB4F3CD0","scrollbars=yes,toolbar=yes,status=yes,resizable=yes,width=400,height=400,"+pos);
	}

//CANADA HELPS LINK
	var CanadaHelpsX = (screen.width/2)-150;
	var CanadaHelpsY = (screen.height/2)-200;
	var pos = "left="+CanadaHelpsX+",top="+CanadaHelpsY;
	function CanadaHelps(){
	//<a href="http://www.canadahelps.org/public/content/Donate/DispCharityProfile.asp?cid=77285)#=e">
	//http://www.canadahelps.org/public/content/Donate/DispCharityProfile.asp?cid=77285
	CanadaHelpsWindow = window.open("http://www.canadahelps.org/CharityProfilePage.aspx?CharityID=d77285","CanadaHelps","scrollbars=yes,resizable=yes,status=yes,width=750,height=550,"+pos);
	}

//BigPicture
	var BigPictureX = (screen.width/2)-150;
	var BigPictureY = (screen.height/2)-200;
	var pos = "left="+BigPictureX+",top="+BigPictureY;
	function BigPicture(){
	BigPictureWindow = window.open("images/Dirty-Laundry-Final1.html","BigPicture","scrollbars=yes,resizable=yes,width=400,height=400,"+pos);
	}	

//SEXPO
var SexpoX = (screen.width/2)-150;
var SexpoY = (screen.height/2)-200;
var pos = "left="+SexpoX+",top="+SexpoY;
function Sexpo() {
window.open('http://24.85.225.7/PACE2/docs/pdf/PACE_Goddess_Event2.pdf', 'links' ,'resizable=yes,toolbar=no,scrollbars=yes,height=400,width=400')
}

function checkData() {
		if (document.taste_order.name.value=="") {
		alert ("Please enter your name before submitting the form.");
		document.taste_order.name.value = "";
		document.taste_order.name.focus();
		var problem = true;
		}
		if (document.taste_order.email.value=="") {
		alert ("Please enter your email address so we may contact you.");
		document.taste_order.email.value = "";
		document.taste_order.email.focus();
		var problem = true;
		}
		
		if (problem == true) {
		return false;
		} 
		else {
		alert ("Thank-you. Please be patient as the form is submitted.");
		return true;
		}
}

