function getposOffset(overlay, offsettype){
var totaloffset=(offsettype=="left")? overlay.offsetLeft : overlay.offsetTop;
var parentEl=overlay.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function overlay(curobj, subobjstr, opt_position, val_left){
	
if (document.getElementById){
var subobj=document.getElementById(subobjstr)
subobj.style.display=(subobj.style.display!="block")? "block" : "none"
var xpos=getposOffset(curobj, "left")+((typeof opt_position!="undefined" && opt_position.indexOf("right")!=-1)? -(subobj.offsetWidth-curobj.offsetWidth) : 0);
var ypos=getposOffset(curobj, "top")+((typeof opt_position!="undefined" && opt_position.indexOf("bottom")!=-1)? curobj.offsetHeight : 0);
if (typeof val_left!="undefined"){ xpos =xpos + val_left;}
subobj.style.left=xpos+"px";
subobj.style.top=ypos+"px";
return false
}
else
return true
}

function overlayclose(subobj){
document.getElementById(subobj).style.display="none"
}

function disableRightClick(e){

  if(!document.rightClickDisabled) // initialize
  {
    if(document.layers){
      document.captureEvents(Event.MOUSEDOWN);
      document.onmousedown = disableRightClick;
    }
	else document.oncontextmenu = disableRightClick;

    return document.rightClickDisabled = true;
  }

  if(document.layers || (document.getElementById && !document.all)){
    if (e.which==2||e.which==3){      
      return false;
    }
  }else{
    return false;
  }
}

//disableRightClick();

function isPackage(isPack, URL, itemId, isProd){
	
	if(isPack != 0 && isPack != itemId){
		var retvalue = confirm("A package is already on the cart!\r\n Do you want to replace it?\r\n");
		
		if (retvalue) {			
			//alert(URL + '&delitem_id=' + isPack);
			window.location=URL + '&delitem_id=' + isProd + isPack+':1';
		}		
	}else{
		var arrParams = isProd.split("~");				
		var i = 0; x = 0;
		if(arrParams.length > 1){
			x = 1;
		}
		if(x != 1){
			window.location=URL;
		}else{
			var retvalue = confirm("A product that is contained in this package is already on your shopping cart!\r\n Do you want to replace it?\r\n");
		
			if (retvalue) {			
				//alert(URL + '&delitem_id=' + isPack);
				window.location=URL + '&delitem_id=' + isProd;
			}	
		}
	}	
}

function isAllowed(varPackage, varOnCartPack, strRedirect){
	
		var arrParams = varPackage.split("~");		
		
		var i = 0; x = 0;
		for (i=0;i<arrParams.length;i++)
		{
			arrItem = arrParams[i].split(":");			
			if(varOnCartPack == arrItem[0]){
				x = 1;
				var retvalue = confirm("This item is already part of a package you purchased.\r\n Do you want to replace the package with this item?");				
				if (retvalue) {			
					//alert(URL + '&delitem_id=' + isPack);
					window.location=strRedirect + '&delitem_id=' + varOnCartPack + ':1';
				}
			}
		}
		if(x != 1){
			window.location = strRedirect;
		}
		
}

function DoCallback(data, url, what)
{
    // branch for native XMLHttpRequest object
    if (window.XMLHttpRequest) {
        req = new XMLHttpRequest();		
		//alert(processReqChange(what));
        req.onreadystatechange = function(){processReqChange(what)}
        req.open('GET', url, true);
        req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        req.send(data);
    // branch for IE/Windows ActiveX version
    } else if (window.ActiveXObject) {
        req = new ActiveXObject('Microsoft.XMLHTTP')
        if (req) {
            req.onreadystatechange = function(){processReqChange(what)}
            req.open('GET', url, true);
            req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
            req.send(data);
        }
    }
}


function processReqChange(what) {	
    // only if req shows 'loaded'
    if (req.readyState == 4) {
        // only if 'OK'
        if (req.status == 200) {
			//alert('Test the XML data: ' +
            //    req.responseText);
            //eval(what);
        } else {
            alert('There was a problem retrieving the XML data: ' +
                req.responseText);
        }
    }
}


// Floater Section



var persistclose=0 //set to 0 or 1. 1 means once the bar is manually closed, it will remain closed for browser session

if (screen.width >= 1024){
var startX = 280 //set x offset of bar in pixels
var startY = 210 //set y offset of bar in pixels
}
if (screen.width == 800){
var startX = 35 //set x offset of bar in pixels
var startY = 2 //set y offset of bar in pixels
}
if (screen.height == 768){
var startX = 147 //set x offset of bar in pixels
var startY = 70 //set y offset of bar in pixels
}

var verticalpos="fromtop" //enter "fromtop" or "frombottom"

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function closebar(){
if (persistclose)
document.cookie="remainclosed=1"
document.getElementById("topbar").style.visibility="hidden"
}

/*function staticbar(){
	barheight=document.getElementById("topbar").offsetHeight
	var ns = (navigator.appName.indexOf("Netscape") != -1) || window.opera;
	var d = document;
	function ml(id){
		var el=d.getElementById(id);
		if (!persistclose || persistclose && get_cookie("remainclosed")=="")
		el.style.visibility="visible"
		if(d.layers)el.style=el;
		el.sP=function(x,y){this.style.left=x+"px";this.style.top=y+"px";};
		el.x = startX;
		if (verticalpos=="fromtop")
		el.y = startY;
		else{
		el.y = ns ? pageYOffset + innerHeight : iecompattest().scrollTop + iecompattest().clientHeight;
		el.y -= startY;
		}
		return el;
	}
	window.stayTopLeft=function(){
		if (verticalpos=="fromtop"){
		var pY = ns ? pageYOffset : iecompattest().scrollTop;
		ftlObj.y += (pY + startY - ftlObj.y)/8;
		}
		else{
		var pY = ns ? pageYOffset + innerHeight - barheight: iecompattest().scrollTop + iecompattest().clientHeight - barheight;
		ftlObj.y += (pY - startY - ftlObj.y)/8;
		}
		ftlObj.sP(ftlObj.x, ftlObj.y);
		setTimeout("stayTopLeft()", 10);
	}
	ftlObj = ml("topbar");
	stayTopLeft();
}

if (window.addEventListener)
window.addEventListener("load", staticbar, false)
else if (window.attachEvent)
window.attachEvent("onload", staticbar)
else if (document.getElementById)
window.onload=staticbar
*/

function download(varfile) {  
  window.location = "members.php?download="+varfile;  
 
}
function download2(varfile) {
  window.location = "members.php?download="+"allforms/"+varfile;  
}
function msg(){
alert('PDF not available at this moment..');
}


function validateMemberInput()
{
	if (document.frm.txtuser.value == '')
	{
		alert('Please enter your username.');
		document.frm.txtuser.focus();
	}
	else if (document.frm.txtpass.value == '')
	{
		alert('Please enter your password.');
		document.frm.txtpass.focus();
	}
	else
	{
		document.frm.action = 'process/proc_login.php?freesec=1';
		document.frm.submit();
	}
}


function validateMemberInput1()
{
	if (document.frm2.txtemail.value == '')
	{
		alert('Please enter your Email.');
		document.frm2.txtemail.focus();	
	}
	else if (document.frm2.txtuname.value == '')
	{
		alert('Please enter your username.');
		document.frm2.txtuname.focus();
	}
	else if (document.frm2.txtpass.value == '')
	{
		alert('Please enter your password.');
		document.frm2.txtpass.focus();
	}
	else if (document.frm2.txtstate.value == '#')
	{
		alert('Please Select a State.');
		document.frm2.txtstate.focus();
	}
	else
	{
		document.frm2.action = 'process/proc_login.php?freesec=1';
		document.frm2.submit();
	}
}


//function validate_required(field,alerttxt)
//{
//with (field)
//{
//if (value==null||value==""||value=="#")
//  {alert(alerttxt);return false}
//else {return true}
//}
//}
//
//function validateCustomerInput1()
//{
//with (thisform)
//{
//if (validate_required(txtuname,"User Name must be filled out!")==false)
// {name.focus();return false}
//if (validate_required(txtpass,"Password must be filled out!")==false)
// {name.focus();return false}
//
//if (validate_required(txtstate,"State must be Selected")==false)
// {name.focus();return false}
//
//if (validate_required(txtcity,"City Must be Filled Out")==false)
// {name.focus();return false}
//}
//}


function validate_required(field,alerttxt)
{
with (field)
{
if (value==null||value==""||value=="#")
  {alert(alerttxt);return false}
else {return true}
}
}

function validate_email(field,alerttxt)
{
with (field)
{

apos=value.indexOf("@")
dotpos=value.lastIndexOf(".")
if(apos<1||dotpos-apos<2) 
  {alert(alerttxt);return false}

else {return true}

}
}

function emailCheck (emailStr) {

/* The following variable tells the rest of the function whether or not
to verify that the address ends in a two-letter country or well-known
TLD.  1 means check it, 0 means don't. */

var checkTLD=1;

/* The following is the list of known TLDs that an e-mail address must end with. */

var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;

/* The following pattern is used to check if the entered e-mail address
fits the user@domain format.  It also is used to separate the username
from the domain. */

var emailPat=/^(.+)@(.+)$/;

/* The following string represents the pattern for matching all special
characters.  We don't want to allow special characters in the address. 
These characters include ( ) < > @ , ; : \ " . [ ] */

var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";

/* The following string represents the range of characters allowed in a 
username or domainname.  It really states which chars aren't allowed.*/

var validChars="\[^\\s" + specialChars + "\]";

/* The following pattern applies if the "user" is a quoted string (in
which case, there are no rules about which characters are allowed
and which aren't; anything goes).  E.g. "jiminy cricket"@disney.com
is a legal e-mail address. */

var quotedUser="(\"[^\"]*\")";

/* The following pattern applies for domains that are IP addresses,
rather than symbolic names.  E.g. joe@[123.124.233.4] is a legal
e-mail address. NOTE: The square brackets are required. */

var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;

/* The following string represents an atom (basically a series of non-special characters.) */

var atom=validChars + '+';

/* The following string represents one word in the typical username.
For example, in john.doe@somewhere.com, john and doe are words.
Basically, a word is either an atom or quoted string. */

var word="(" + atom + "|" + quotedUser + ")";

// The following pattern describes the structure of the user

var userPat=new RegExp("^" + word + "(\\." + word + ")*$");

/* The following pattern describes the structure of a normal symbolic
domain, as opposed to ipDomainPat, shown above. */

var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");

/* Finally, let's start trying to figure out if the supplied address is valid. */

/* Begin with the coarse pattern to simply break up user@domain into
different pieces that are easy to analyze. */

var matchArray=emailStr.match(emailPat);

if (matchArray==null) {

/* Too many/few @'s or something; basically, this address doesn't
even fit the general mould of a valid e-mail address. */

alert("Invalid Email Address!");
return false;
}
var user=matchArray[1];
var domain=matchArray[2];

// Start by checking that only basic ASCII characters are in the strings (0-127).

for (i=0; i<user.length; i++) {
if (user.charCodeAt(i)>127) {
alert("Invalid Email Address!");
return false;
   }
}
for (i=0; i<domain.length; i++) {
if (domain.charCodeAt(i)>127) {
alert("Invalid Email Address!");
return false;
   }
}

// See if "user" is valid 

if (user.match(userPat)==null) {

// user is not valid

alert("Invalid Email Address!");
return false;
}

/* if the e-mail address is at an IP address (as opposed to a symbolic
host name) make sure the IP address is valid. */

var IPArray=domain.match(ipDomainPat);
if (IPArray!=null) {

// this is an IP address

for (var i=1;i<=4;i++) {
if (IPArray[i]>255) {
alert("Invalid Email Address!");
return false;
   }
}
//alert("Thank you for registering for the LandlordOnline.com newsletter.");
return true;
}

// Domain is symbolic name.  Check if it's valid.
 
var atomPat=new RegExp("^" + atom + "$");
var domArr=domain.split(".");
var len=domArr.length;
for (i=0;i<len;i++) {
if (domArr[i].search(atomPat)==-1) {
alert("Invalid Email Address!");
return false;
   }
}

/* domain name seems valid, but now make sure that it ends in a
known top-level domain (like com, edu, gov) or a two-letter word,
representing country (uk, nl), and that there's a hostname preceding 
the domain or country. */

if (checkTLD && domArr[domArr.length-1].length!=2 && 
domArr[domArr.length-1].search(knownDomsPat)==-1) {
alert("Invalid Email Address!");
//alert("The address must end in a well-known domain or two letter " + "country.");
return false;
}

// Make sure there's a host name preceding the domain.

if (len<2) {
//alert("This address is missing a hostname!");
alert("Invalid Email Address!");
return false;
}

// If we've gotten this far, everything's valid!
//alert("Thank you for registering for the LandlordOnline.com newsletter.");
//return true;
}






function validate_freesec(thisform){
with (thisform)
{
	
//if (validate_required(txtemail,"Email Name must be filled out!")==false)
//  {
	//  txtemail.focus();return false}
//if (validate_email(txtemail,"Not a valid e-mail address!")==false)
//{txtemail.focus();return false}
if (emailCheck(txtemail.value)==false)
{
txtemail.focus();return false}
//if (emailCheck(txtemail,"Not a valid e-mail address!")==false)
//{txtemail.focus();return false}
if (validate_required(txtuser,"Username type must be filled out!")==false)
  {txtuser.focus();return false}
if (validate_required(txtpass,"Password must be filled out!")==false)
  {txtpass.focus();return false}
if (txtpass.value.length < 4)
  {   alert("Password Character must be greater than or equal to 4");
	  txtpass.focus();return false}


if (validate_required(txtstate,"State should also be Selected!")==false)
  {txtstate.focus();return false}
 
}
}




<!-- Begin
function emailCheck (emailStr) {


/* The following variable tells the rest of the function whether or not
to verify that the address ends in a two-letter country or well-known
TLD.  1 means check it, 0 means don't. */

var checkTLD=1;

/* The following is the list of known TLDs that an e-mail address must end with. */

var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;

/* The following pattern is used to check if the entered e-mail address
fits the user@domain format.  It also is used to separate the username
from the domain. */

var emailPat=/^(.+)@(.+)$/;

/* The following string represents the pattern for matching all special
characters.  We don't want to allow special characters in the address. 
These characters include ( ) < > @ , ; : \ " . [ ] */

var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";

/* The following string represents the range of characters allowed in a 
username or domainname.  It really states which chars aren't allowed.*/

var validChars="\[^\\s" + specialChars + "\]";

/* The following pattern applies if the "user" is a quoted string (in
which case, there are no rules about which characters are allowed
and which aren't; anything goes).  E.g. "jiminy cricket"@disney.com
is a legal e-mail address. */

var quotedUser="(\"[^\"]*\")";

/* The following pattern applies for domains that are IP addresses,
rather than symbolic names.  E.g. joe@[123.124.233.4] is a legal
e-mail address. NOTE: The square brackets are required. */

var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;

/* The following string represents an atom (basically a series of non-special characters.) */

var atom=validChars + '+';

/* The following string represents one word in the typical username.
For example, in john.doe@somewhere.com, john and doe are words.
Basically, a word is either an atom or quoted string. */

var word="(" + atom + "|" + quotedUser + ")";

// The following pattern describes the structure of the user

var userPat=new RegExp("^" + word + "(\\." + word + ")*$");

/* The following pattern describes the structure of a normal symbolic
domain, as opposed to ipDomainPat, shown above. */

var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");

/* Finally, let's start trying to figure out if the supplied address is valid. */

/* Begin with the coarse pattern to simply break up user@domain into
different pieces that are easy to analyze. */

var matchArray=emailStr.match(emailPat);

if (matchArray==null) {

/* Too many/few @'s or something; basically, this address doesn't
even fit the general mould of a valid e-mail address. */

alert("Invalid Email Address!");
return false;
}
var user=matchArray[1];
var domain=matchArray[2];

// Start by checking that only basic ASCII characters are in the strings (0-127).

for (i=0; i<user.length; i++) {
if (user.charCodeAt(i)>127) {
alert("Invalid Email Address!");
return false;
   }
}
for (i=0; i<domain.length; i++) {
if (domain.charCodeAt(i)>127) {
alert("Invalid Email Address!");
return false;
   }
}

// See if "user" is valid 

if (user.match(userPat)==null) {

// user is not valid

alert("Invalid Email Address!");
return false;
}

/* if the e-mail address is at an IP address (as opposed to a symbolic
host name) make sure the IP address is valid. */

var IPArray=domain.match(ipDomainPat);
if (IPArray!=null) {

// this is an IP address

for (var i=1;i<=4;i++) {
if (IPArray[i]>255) {
alert("Invalid Email Address!");
return false;
   }
}
//alert("Thank you for Registering for the LandlordOnline.com Free Section.");
return true;
}

// Domain is symbolic name.  Check if it's valid.
 
var atomPat=new RegExp("^" + atom + "$");
var domArr=domain.split(".");
var len=domArr.length;
for (i=0;i<len;i++) {
if (domArr[i].search(atomPat)==-1) {
alert("Invalid Email Address!");
return false;
   }
}

/* domain name seems valid, but now make sure that it ends in a
known top-level domain (like com, edu, gov) or a two-letter word,
representing country (uk, nl), and that there's a hostname preceding 
the domain or country. */

if (checkTLD && domArr[domArr.length-1].length!=2 && 
domArr[domArr.length-1].search(knownDomsPat)==-1) {
//alert("The address must end in a well-known domain or two letter " + "country.");
alert("Invalid Email Address!");
return false;
}

// Make sure there's a host name preceding the domain.

if (len<2) {
//alert("This address is missing a hostname!");
alert("Invalid Email Address!");
return false;
}

// If we've gotten this far, everything's valid!
//alert("Thank you for registering for the LandlordOnline.com newsletter.");
return true;
}

//  End -->


//neil_valid
function open_win()
{
window.open("http://www.landlord411.com/index_sample.php","_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=230, height=120,left = 500,top = 500")
}
function ts_411_log()
{
window.open("http://www.landlordonline.com/tenant-screening/llo.html","_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=280, height=120,left = 500,top = 500")
}
function open_win_2() {
	document.frm.action = 'http://www.landlord411.com/DA/index.php?page=account&next_page=account&session_id=$sid&action=login';
	document.frm.submit(); 
}
function silver() { 
	document.frm.action = 'http://landlordonline.com/signup/upgrade.php?item_type=1&item_id=2';
	document.frm.submit();
}
 
	
   

