var popwin = null;
var signwin = null;

function popUp(urlval)
{

	if (!popwin || popwin.closed) {
		popwin = window.open(urlval , "popwin" ,"top=75,left=75,width=500,height=300,scrollbars=yes,status=no,resizable=yes");
	} else {
		popwin.document.location = urlval;
	} // end check that window is already open
	popwin.focus();

	return false;
}

function popUpW(urlval)
{

	if (popwin) {
		if (!popwin.closed) {
		popwin.close();
	} } // end check that window is already open

	popwin = window.open(urlval , "popwin" ,"top=75,left=75,width=650,height=400,scrollbars=yes,status=yes,resizable=yes,toolbar=yes,menubar=yes,location=yes");

	popwin.focus();

	return false;
}

function popUpPrint(urlval)
{

	if (popwin) {
		if (!popwin.closed) {
		popwin.close();
	} } // end check that window is already open

	popwin = window.open(urlval , "popwin", "top=75,left=75,width=650,height=400,scrollbars=yes,status=yes,resizable=yes,toolbar=yes,menubar=yes,location=yes");

	popwin.focus();
	
	return false;
}

function popUpDocument(urlval)
{

	if (!popwin || popwin.closed) {
		popwin = window.open(urlval , "popwin", "top=75,left=75,width=650,height=400,scrollbars=yes,status=yes,resizable=yes,toolbar=yes,menubar=yes,location=yes");
	} else {
		popwin.document.location = urlval;
	} // end check that window is already open
	
	popwin.focus();

	return false;
}

function forgotPassword(email)
{
	var urlval= "./forgot_password.cfm?f_email=" + email;

	if (!signwin || signwin.closed) {
		signwin = window.open(urlval , "popwin" ,"top=75,left=75,width=500,height=300,scrollbars=no,status=no,resizable=yes");
	} else {
		signwin.document.location = urlval;
	} // end check that window is already open

	signwin.focus();

	return false;
}

function signIn(email,passw)
{
	var urlval= "./signin.cfm?f_email=" + email + "&f_password=" + passw;

	if (!signwin || signwin.closed) {
		signwin = window.open(urlval , "popwin" ,"top=75,left=75,width=500,height=300,scrollbars=no,status=no,resizable=yes");
	} else {
		signwin.document.location = urlval;
	} // end check that window is already open

	signwin.focus();

	return false;
}

function signIn1(email,passw,voltask)
{
	var urlval= "./signinnew.cfm?f_email=" + email + "&f_password=" + passw + "&f_voltasktimeid=" + voltask;

	if (!signwin || signwin.closed) {
		signwin = window.open(urlval , "popwin" ,"top=75,left=75,width=500,height=300,scrollbars=no,status=no,resizable=yes");
	} else {
		signwin.document.location = urlval;
	} // end check that window is already open

	signwin.focus();

	return false;
}

function closeWindows() {
	if (popwin && !popwin.closed)
		popwin.close();
	if (signwin && !signwin.closed)
		signwin.close();
}
