//
function is_email( Email )
{
	var i;
	var j;
	var StringLength;
	
	var FindDot;
	
	if ( Email == "" )
	{

		return false
	}
	
	

	i = Email.search("@");
	j = -1
	StringLength = Email.length;

	for ( n= i + 2 ; n <= StringLength - 2 ; n++)
	{
		FindDot = Email.substr( n , 1 )
		if (FindDot == "." )
			j = n
	}			
			
	if ( i == -1 || j == -1)
	{

		return false;
	}

	return true
}

function popup( url, options )
{

	popup_window = window.open( url,'popup_window', options )
	popup_window.focus()
}

function getObj(name)
{
	if (document.getElementById)
  	{
  		this.obj = document.getElementById(name);
		this.style = document.getElementById(name).style;
  	}
  	else if (document.all)
  	{
		this.obj = document.all[name];
		this.style = document.all[name].style;
  	}
  	else if (document.layers)
  	{
   		this.obj = document.layers[name];
   		this.style = document.layers[name];
  	}
}

//thanks to apple http://developer.apple.com/internet/webcontent/xmlhttpreq.html for these scripts

var isIE = false;

function getElementTextNS(prefix, local, parentElem, index) {
    var result = "";

    if (window.ActiveXObject) {
        isIE = true;
    }	

    if (prefix && isIE) {
        // IE/Windows way of handling namespaces
        result = parentElem.getElementsByTagName(prefix + ":" + local)[index];
    } else {
        // the namespace versions of this method 
        // (getElementsByTagNameNS()) operate
        // differently in Safari and Mozilla, but both
        // return value with just local name, provided 
        // there aren't conflicts with non-namespace element
        // names
        result = parentElem.getElementsByTagName(local)[index];
    }
    if (result) {
        // get text, accounting for possible
        // whitespace (carriage return) text nodes 
        if (result.childNodes.length > 1) {
            return result.childNodes[1].nodeValue;
        } else {
            return result.firstChild.nodeValue;    		
        }
    } else {
        return "n/a";
    }
}

function getXMLObj() {

     var req

	req = false;
    // branch for native XMLHttpRequest object
    if(window.XMLHttpRequest) 
    {
    	try {
		req = new XMLHttpRequest();
       	} catch(e) {
			req = false;
        }
    // branch for IE/Windows ActiveX version
    } else if(window.ActiveXObject) {
       	try {
        	req = new ActiveXObject("Msxml2.XMLHTTP");
      	} catch(e) {
        	try {
          		req = new ActiveXObject("Microsoft.XMLHTTP");
        	} catch(e) {
          		req = false;
        	}
	}
    }

    return req	
}

//
