/*****************************************************************
*                                                                *
*	standard.js                                                  *
*	For use with ProChoiceAmerica.org and affiliated websites    *
*                                                                *
*	written by Michael Rathmann                                  *
*	(c)2004 RathmannDesign.com. All rights reserved.             *
*                                                                *
*****************************************************************/

var loaded = new Array();

//	Rollover Controls
function F_loadRollover(image,imageName) {
	if (image && image.src &&
		(null == image.out || typeof(image.out) == typeof(void(0)))) {
		s = image.src;
		image.out = new Image();
		image.out.src = s;
		image.over = new Image();
		if (imageName.lastIndexOf('/') >= 0 || imageName.lastIndexOf('\\') >= 0) {
			s = imageName;
		} else {
			i = s.lastIndexOf('/');
			if (i<0) i = s.lastIndexOf('\\');
			if (i<0) { s = imageName; }
			else	 { s = s.substring(0,i+1) + imageName; }
		}
		image.over.src = s;
		loaded[image.name] = image;
	}
} function F_roll(imageName,over) {
	if (document.images) {
	if (over) { imageObject = "over"; }
	else	  { imageObject = "out"; }
	image = loaded[imageName];
	if (image) {
		ref = eval("image."+imageObject);
		if (ref) image.src = eval("image."+imageObject+".src");
	}
	if (window.event)
		window.event.cancelBubble = true;
	}
}

//	Pop-up Controls
var chasm = screen.availWidth; var mount = screen.availHeight;
var width = 0; var height = 0; var paux = null;
function popWindow(width,height) {
	if (paux != null && paux.open) paux.close();
	paux = window.open('','popup','resizable=yes,toolbar=no,scrollbars=yes,status=yes,width=' + width + ',height=' + height + ',left=' + ((chasm - width - 10) * .5) + ',top=' + ((mount - height - 30) * .5));
} function printWindow(width,height) {
	if (paux != null && paux.open) paux.close();
	paux = window.open('','print','resizable=no,menubar=yes,scrollbars=yes,status=yes,width=' + width + ',height=' + height + ',left=' + ((chasm - width - 10) * .5) + ',top=' + ((mount - height - 30) * .5));
} function auxWindow(width,height) {
	if (paux != null && paux.open) paux.close();
	paux = window.open('','aux','resizable=no,toolbar=no,scrollbars=no,status=yes,width=' + width + ',height=' + height + ',left=' + ((chasm - width - 10) * .5) + ',top=' + ((mount - height - 30) * .5));
} function eradic() { if (paux != null && paux.open) paux.close(); }

//	Browser Check Variables
var agt=navigator.userAgent.toLowerCase();
var is_major = parseInt(navigator.appVersion);
var is_minor = parseFloat(navigator.appVersion);

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));
var is_nav4up = (is_nav && (is_major >= 4));
var is_nav6up = (is_nav && (is_major >= 5));

var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
var is_ie3    = (is_ie && (is_major < 4));
var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) );
var is_ie5up  = (is_ie && !is_ie3 && !is_ie4);

//	Form Event Handlers
function handleFocus(form) { form.id = "fieldon"; }
function handleBlur(form) { form.id = "fieldoff"; }

//	CAN Spot Validation
function validateEmail(form) {
	alertStart = "In order to continue, please ";
	if (!form.contactEmail.value) {
		alert(alertStart + "enter your email address.");
		form.contactEmail.focus(); return false;
	} if (!isEmail(form.contactEmail.value)) {
		alert("'" + form.contactEmail.value + "' is an invalid email address! Please reenter.");
		form.contactEmail.focus(); form.contactEmail.select(); return false;
	} popWindow(623,370);
	return true; //change this to return false to disable
} function isEmail(str) {
	if (str.length <= 6) { return false; }
	else { return ((str != "") && (str.indexOf("@") != -1) && (str.indexOf(".") != -1)); }
}

function showDetail (call) {
	if (call == 1) {
		alert("1. Roe v. Wade --\n\nThirty years ago, New York became the first state to legalize abortion.  Anti-choice forces continue working to outlaw this right.  All legislators must remain vigilant in their support for those crucial Supreme Court decisions that protect abortion rights for women.");
	} if (call == 2) {
		alert("2. Medicaid Funding --\n\nAll women, regardless of economic status, should have equal access and the means to exercise their legal right to abortion.  NARAL Pro-Choice New York strongly opposes bans on Medicaid funding for abortions, which would delay a woman in obtaining an abortion, increasing the cost and complexity of the procedure.");
	} if (call == 3) {
		alert("3. Government-Mandated Parental Consent –-\n\nParental consent laws force a minor to obtain consent from parents prior to obtaining an abortion. We support efforts to encourage minors to discuss medical decisions with an adult. However, state-mandated laws are unrealistic. Parental consent laws do not promote family communication nor do they reduce unwanted teen pregnancies.");
	} if (call == 4) {
		alert("4. Ban on Abortion Procedures –-\n\nMedically, there is no such thing as a \"partial birth\" abortion. It is a phrase coined by anti-choice forces, designed to undermine Roe v. Wade. Politicians not trained to make medical decisions should not threaten patient safety by regulating the practice of medicine. These unconstitutional measures seek to ban abortion procedure by procedure.");
	} if (call == 5) {
		alert("5. Fetal Rights --\n\nActs of violence against women, especially pregnant women, are tragic and should be punished.  However, the true aim of \"fetal rights\" legislation is to undermine a woman’s right to choose by recognizing a zygote, blastocyst, embryo, or fetus as a person, with rights separate and equal to that of women.  If there were a real desire to protect pregnant women from acts of violence, a better approach would be to support increased penalties for persons who knowingly injure a pregnant woman with the intent to harm her health.  This approach would serve to place additional penalties on persons who harm a pregnant woman, without opening the door to constitutionally flawed approaches that seek to elevate the legal status of a fetus and undermine a woman's right to choose.");
	} if (call == 6) {
		alert("6. Improved Access to Emergency Contraception –-\n\nEmergency Contraception (EC) can prevent unintended pregnancy in the first few days following sex. EC does not induce an abortion, is safe to use and more effective the earlier it is taken. Lawmakers should promote policies that increase access to EC.");
	}
}