

	function getelebyid(id)
	{
		if(document.layers)	   //NN4+
   		{
			obj = document.layers[id];
	   	}
		else if(document.getElementById)	  //gecko(NN6) + IE 5+
		{
			obj = document.getElementById(id);
		}
		else if(document.all)	// IE 4
		{
			obj = document.all[id];
		}
		
		return obj;
	}



	function getelebyidinopenerwindow(id)
	{
		if(window.opener.document.layers)	   //NN4+
		{
			obj = window.opener.document.layers[id];
		}
		else if(window.opener.document.getElementById)	  //gecko(NN6) + IE 5+
		{
			obj = window.opener.document.getElementById(id);
		}
		else if(window.opener.document.all)	// IE 4
		{
			obj = window.opener.document.all[id];
		}
		
		return obj;
	}



	function XmlHttpObjectGet2()
	{
		var xmlhttp;
//		if (typeof XMLHttpRequest == "undefined") {
		    try { xmlhttp = new XMLHttpRequest(); }
		    	catch (e1) {}
		    try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP.6.0"); }
		      catch (e2) {}
		    try { xmlhttp =  new ActiveXObject("Msxml2.XMLHTTP.3.0"); }
		      catch (e3) {}
		    try { xmlhttp =  new ActiveXObject("Msxml2.XMLHTTP"); }
		      catch (e4) {}
		    try { xmlhttp =  new ActiveXObject("Microsoft.XMLHTTP"); }
		      catch (e5) {}
		    throw new Error("This browser does not support XMLHttpRequest.");
//		}
		alert('what about now')
		return xmlhttp;				  
	}


	function XmlHttpObjectGet()
	{
		var xmlHttp; // willstorethereferenceto theXMLHttpRequestobject
		try// thisshouldworkforallbrowsersexceptIE6 and older
		{ // tryto createXMLHttpRequestobject
			xmlHttp= new XMLHttpRequest();
		}
		catch(e)
		{
			// assumeIE6 or older
			var XmlHttpVersions= new Array("MSXML2.XMLHTTP.6.0",
			"MSXML2.XMLHTTP.5.0",
			"MSXML2.XMLHTTP.4.0",
			"MSXML2.XMLHTTP.3.0",
			"MSXML2.XMLHTTP",
			"Microsoft.XMLHTTP");
			// tryeveryiduntiloneworks
			for(var i=0; i<XmlHttpVersions.length && !xmlHttp; i++)
			{
				try
				{ // tryto createXMLHttpRequestobject
					xmlHttp= new ActiveXObject(XmlHttpVersions[i]);
				}
				catch(e) {} // ignorepotentialerror
			}
		}
		// returnthecreatedobjector display anerrormessage
		if(!xmlHttp)
			displayError("ErrorcreatingtheXMLHttpRequestobject.");
		else
			return xmlHttp;
	}





	function XmlHttpObjectGet1()
	{
		var xmlhttp;
		if (window.XMLHttpRequest)
		  {
		  // code for IE7+, Firefox, Chrome, Opera, Safari
		  xmlhttp=new XMLHttpRequest();
		  }
		else if (window.ActiveXObject)
		  {
		  // code for IE6, IE5
		  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		  }
		else
		  {
		  alert("Your browser does not support XMLHTTP!");
		  }
		return xmlhttp
	}
	


	function changeDisplay( elementId, setTo ) {
	  var theElement;
	  theElement = getelebyid(elementId);
	  
	  if( theElement.style ) { theElement = theElement.style; }
	  if( typeof( theElement.display ) == 'undefined' ) {
	    //The browser does not allow us to change the display style
	    //Alert something sensible (not what I have here ...)
	    window.alert( 'Your browser does not support change visibility of HTML element' );
	    return;
	  }
	  //Change the display style
	  theElement.display = setTo;
	}
	
	
		
	
	function findPosX(obj) {
// http://blog.firetree.net/2005/07/04/javascript-find-position/
    var curleft = 0;
    if (obj.offsetParent) {
        while (1) {
            curleft+=obj.offsetLeft;
            if (!obj.offsetParent) {
                break;
            }
            obj=obj.offsetParent;
        }
    } else if (obj.x) {
        curleft+=obj.x;
    }
    return curleft;
}


function findPosY(obj) {
// http://blog.firetree.net/2005/07/04/javascript-find-position/
    var curtop = 0;
    if (obj.offsetParent) {
        while (1) {
            curtop+=obj.offsetTop;
            if (!obj.offsetParent) {
                break;
            }
            obj=obj.offsetParent;
        }
    } else if (obj.y) {
        curtop+=obj.y;
    }
    return curtop;
}
	
		
