function findPosY(obj)
{
    var curtop = 0;var printstring = '';
    if (obj.offsetParent)
    { 
        while (obj.offsetParent) 
        {
            if(obj.style.position == null || (obj.style.position.toLowerCase() != 'relative')) 
                curtop += obj.offsetTop; obj = obj.offsetParent;	
        }
    } 
    else if (obj.y)	curtop += obj.y;
    return curtop;
}



function checkemail2(email)
{
	var bOk;
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;

	if (filter.test(email))
	{
		bOk=true;
	}
	else
	{
	  bOk=false;
	}
	return (bOk);
}


function checkemail(email)
{
	if (document.layers||document.getElementById||document.all)
	{
 	  return checkemail2(email);
	}
	else
	{
		return true;
	}
}

function findPosX(a) {
    var curleft = 0;
	while(a) {
		tn=a.tagName.toUpperCase();
        var bAbsolute = false;
		if(tn == "DIV")
		{
		    if(a.style.position.toLowerCase() == 'relative')
		    {
		        a=a.offsetParent;
		        continue;
		    }
		    else if(a.style.position.toLowerCase() == 'absolute')
		    {
		       bAbsolute = true;
		    }
		    else 
		    {
		        if(a.currentStyle)
		        {
		            var elem = a.currentStyle["position"]
		            if(elem != null && elem.toLowerCase() == 'relative')
		            {
		                  a=a.offsetParent;
		                  continue;
		            }
		            else if(elem != null && elem.toLowerCase() == 'absolute' )
		                bAbsolute = true;
		        }
		        else
		        {
		            var elem = document.defaultView.getComputedStyle(a,null).getPropertyValue("position")
		            if(elem != null && (elem.toLowerCase() == 'relative' || elem.toLowerCase() == 'static'))
		            {
		                  a=a.offsetParent;
		                  continue;
		            }  
		            else if(elem != null && elem.toLowerCase() == 'absolute' )
		                 bAbsolute = true;
		        }
		     }
		    
		     
		}
		
		
        
        if(!bAbsolute)
        {
	        curleft+=a.offsetLeft;
	    }
		if (tn=="BODY") break;
    		a=a.offsetParent;
	}
	return curleft;
}


function OnCallBackError(sender, eventArgs) 
{ 
    alert("\nPage did not load for the following reason(s):\n         * Back button was used\n         * Your session has expired\n         * The data did not complete loading\n\n      Click 'Ok' to return to the housing home page.");
    location.href = strIndexPagePath; 
}
