//startFlash
var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
// Handle all the the FSCommand messages in a Flash movie
//clip name should match the 'IDhere'_DoFSCommand
function ipBtn_DoFSCommand(command, args) {
	if (command == "ipLink") {
		window.open(args);
	}
}
// Hook for Internet Explorer for intLinkClip 
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && 
	  navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<SCRIPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('Sub ipBtn_FSCommand(ByVal command, ByVal args)\n');
	document.write('  call ipBtn_DoFSCommand(command, args)\n');
	document.write('end sub\n');
	document.write('</SCRIPT\> \n');
}
//
//endofFlash
//
function MakePW(input){
	if(input.type == 'text'){
		password = document.createElement('input');
		password.name = 'pw'
		password.id = 'pw'
		password.type = 'password';
		password.className = 'unpw'
		input.parentNode.insertBefore(password,input);
		input.parentNode.removeChild(input);
		password.value = '';
		password.focus();
	}
}
//
//startFlash
var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
// Handle all the the FSCommand messages in a Flash movie
//clip name should match the 'IDhere'_DoFSCommand
function TopMenu_DoFSCommand(command, args) {
	if (command == "DoDD") {
		document.getElementById('TopMenuDiv').style.clip = 'rect(0px, 660px, '+args+'px, 0px)';
		document.getElementById('TopMenu').style.height = args+'px';
	}
	if (command == "noPage") {
		alert('Coming Soon!\n\nThis page is being prepared, please check back soon.')
	}
}
// Hook for Internet Explorer for intLinkClip 
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && 
	  navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<SCRIPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('Sub TopMenu_FSCommand(ByVal command, ByVal args)\n');
	document.write('  call TopMenu_DoFSCommand(command, args)\n');
	document.write('end sub\n');
	document.write('</SCRIPT\> \n');
}
//
//endofFlash
//
//
var bioWin;
function launchBio(ID){ 
	bioWin = window.open('http://www.afpop.com/bioWin.asp?Newlang=DE&ID='+ID,'null','height=520, width=340, top=20, left=20, toolbar=no, status=no, menubar=no,scrollbars=no');
	if (window.focus) {
		bioWin.focus();
	}
}
//
function submitThanks_DE(){
	var ok;
	if (document.membership.privOK.checked) {
		if(document.membership.paymentMethod.value == 'PayPal'){
			if(document.membership.memType.value.length >= 1){
				ok=true;
				if(document.membership.memType.value == 'AFP0001'){
					window.open('http://www.afpop.com/printform_DE.asp','subPopUp','height=540,width=620,top=20,left=20,toolbar=no,status=no,menubar=no,scrollbars=yes');
					document.location.href='goBuy.asp?ID=AFP0001';
				} else {
					window.open('http://www.afpop.com/printform_DE.asp','subPopUp','height=540,width=620,top=20,left=20,toolbar=no,status=no,menubar=no,scrollbars=yes');
					document.location.href='goBuy.asp?ID=AFP0002';
				}
			} else {
				ok=false;
				window.alert('You must choose a membership type to continue.');
			}
		} else {
			ok=true;
			window.open('http://www.afpop.com/printform_DE.asp','subPopUp','height=540,width=620,top=20,left=20,toolbar=no,status=no,menubar=no,scrollbars=yes');
			document.location.href='thanks.asp';
		}
	} else {
		ok=false;
		window.alert('You must check the Privacy Policy box to continue.');
	}
	return (ok);
}
//
function pu(ID){
	leftPos = 0
	topPos = 0
	if (screen){
		leftPos = (screen.width / 2) - 240
		topPos = (screen.height / 2) - 250
	}
	puWin=window.open('pu_'+ID+'.asp','NoteWin','height=500, width=480, top='+topPos+', left='+leftPos+', status=no, scrollbars=yes');
	if (window.focus) {
		puWin.focus();
	}
}
//
function isEmail(eml){
	var i = 1;
	var emlLength = eml.length;
	while ((i < emlLength) && (eml.charAt(i) != "@")){
		i++;
	}
	if ((i >= emlLength) || (eml.charAt(i) != "@")) {
		return false;
	}
	else {
		i += 2;
	}
	while ((i < emlLength) && (eml.charAt(i) != ".")){
		i++;
	}
	if ((i >= emlLength - 1) || (eml.charAt(i) != ".")){
		return false;
	}
	else {
		return true;
	}
}
//
function ValForm(){
	var isAnError = false;
	var errMsg = "";
	//
	if(document.FormInfo.Email.value == "")  {
		errMsg += "You must enter an email address.\n";
		isAnError = true;
	}
	//
	if(document.FormInfo.Email.value != "")  {
		if (!isEmail(document.FormInfo.Email.value)){
			errMsg += "Please enter a valid email address\n";
			isAnError = true;
		}
		
	}
	//
	if(isAnError){
		alert(errMsg);
		return false;
	}
	//
	if(!isAnError){
		return true;
	}
}
//
function openPrivPol(){
		window.open('privPol.asp','null','height=540,width=482,top=20,left=20,toolbar=no,status=no,menubar=no,scrollbars=no');
}

function closeWin(){
	window.close('parent');
}

var user
function doLogin(user){
	window.open('password.asp?username='+user+'','loginWin','height=335, width=340, top=20, left=20, toolbar=no, status=no, menubar=no,scrollbars=no');
	return (false);
}

function doPassword(){
	window.opener.location.href='../home.asp?newlang=DE';
	window.close();
}