function openVerifyWindow(pspt)
{
	var psptID = "";
	if(pspt == "DP")
	{
		psptID = document.getElementById("pt").value;
		if((psptID == "") || (psptID == "passport ID"))
		{
			alert("Passport ID is required!");
		}
		else
		{
			url = "https://www.mydatingpassport.com/verifypassport.php?pspt="+psptID;
			window.open(url, "verify_form", "width=800,height=700,directories=no,menubar=no,resizable=no,scrollbars=no,toolbar=no,status=no");
		}
	}
	else
	{
		psptID = pspt;
		url = "https://www.mydatingpassport.com/verifypassport.php?pspt="+psptID;
		window.open(url, "verify_form", "width=800,height=700,directories=no,menubar=no,resizable=no,scrollbars=no,toolbar=no,status=no");
	}
}

function openHelpWindow(page)
{
	//this function opens a help window. Need to supply the help page from the database table.
	url = "/helpinformation.php?page="+page;
	window.open(url, "helppage", "width=600,height=400,directories=no,menubar=no,resizable=no,scrollbars=yes,toolbar=no,status=no");
}

function launchChat()
{
	//this function opens the chat window
	url = "chat/index.php";
	window.open(url, "chat", "width=700,height=600,directories=no,menubar=no,resizable=no,scrollbars=yes,toolbar=no,status=no");
}

function launchMemberArea()
{
	//this function opens member updates area
	url = "https://www.mydatingpassport.com/memberlogin.php";
	window.open(url, "memberarea", "width=900,height=600,directories=no,menubar=no,resizable=no,scrollbars=yes,toolbar=no,status=no");
}

function launchAgentMemberArea()
{
	//this function opens member updates area
	url = "https://www.mydatingpassport.com/agentlogin.php";
	window.open(url, "agentarea", "width=900,height=600,directories=no,menubar=no,resizable=no,scrollbars=yes,toolbar=no,status=no");
}

function launchAgentForm()
{
	//this function opens member updates area
	url = "https://www.mydatingpassport.com/agentreg.php";
	window.open(url, "agentreg", "width=900,height=600,directories=no,menubar=no,resizable=no,scrollbars=no,toolbar=no,status=no");
}

function closeWindow()
{
	this.window.close();
}

function clearText(p)
{
	document.getElementById(p).value = "";
}

function openForm(arg)
{
	var extra = "";
	if(arg != "")
	{
		extra = "?type="+arg;
	}
	window.open("https://www.mydatingpassport.com/enrollform.php"+extra, "enroll_form", "width=900,height=700,directories=no,menubar=no,resizable=no,scrollbars=yes,toolbar=no,status=no");
}

function openEmailForm(email)
{
	window.open(email, "email_form", "width=700,height=600,directories=no,menubar=no,resizable=no,scrollbars=no,toolbar=no,status=no");
}

function confirmDel(label)
{
	//This function gets user confirmation before carrying out the delete function
	
	if(confirm('Do you really want to delete this '+label+' ?'))
	{
		return true;
	}
	else
	{
		return false;
	}
}

function confirmResign()
{
	//This function gets user confirmation before resigning an account
	
	if(confirm('Do you really want to resign this account?'))
	{
		return true;
	}
	else
	{
		return false;
	}
}

function checkAge()
{
	if(document.form01.age.checked)
	{
		return true;
	}
	else
	{
		alert("You need to certify you are over 18 years old to continue!");
		return false;
	}
}

function checkRefund()
{
	if(document.form02.refund.checked)
	{
		this.form.submit();
		return true;
	}
	else
	{
		alert("You need to agree to our refund policy before proceeding!");
		return false;
	}
}

function toggleForms(tb1, tb2)
{
	document.getElementById(tb1).style.display = "block";
	document.getElementById(tb2).style.display = "none";
}

function showRecord(tb)
{
	var myarr = new Array("01", "02", "03", "04");
	for(var i=0; i<myarr.length; i++)
	{
		if(tb == myarr[i])
		{
			document.getElementById(tb).style.display = "block";
			//handle.style.display = "block";
		}
		else
		{
			document.getElementById(myarr[i]).style.display = "none";
			//handle.style.display = "none";
		}
	}
}

function submitForm(goto)
{
	document.form02.action = goto;
	document.form02.submit();
	return true;
}


