var context;
var xmlHttp;

function stf_stateChanged() 
{
	try
	{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	 { 
		 //alert('step 1 good')
		 div = 	 document.getElementById(context);
		 //alert('context good')
		 if (div != null)
		 {
			 //alert('divExists');
			 //alert(xmlHttp.responseText);
		 	div.innerHTML=xmlHttp.responseText ;
		 	//alert('innerhtml filled')
	 	}
		 else
		 {
		 	alert('missing block' + context);
	 	}
	 }
 	} 
	catch(err)
	{
		alert(err.description);
		alert(xmlHttp.responseText);
		}
}
function stf_GetXmlHttpObject()
{
	var xmlHttp=null;
	try
	 {
	 // Firefox, Opera 8.0+, Safari
	 xmlHttp=new XMLHttpRequest();
	 }
	catch (e)
	 {
	 //Internet Explorer
	 try
	  {
	  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	  }
	 catch (e)
	  {
	  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	 }
	return xmlHttp;
}
function stf_notavailable()
{
	alert('This has not been implemented yet');
}
function stf_notSupported() {
	alert('Sorry for the inconvience, but your browser is not supported. Make sure javascript is turned on. If the error continues, please contact efirmus to correct the issue.');
}
BROWSER_TYPE_UNKNOWN = -1;
BROWSER_TYPE_MSIE = 1;
BROWSER_TYPE_FIREFOX = 2;
BROWSER_TYPE_CHROME = 3;
BROWSER_TYPE_SAFARI = 4;
BROWSER_TYPE_OPERA = 5;
BROWSER_TYPE_KONQUEROR = 6;
BROWSER_TYPE_OMNIWEB = 7;
browser_type = 0;
function stf_getBrowser() {
	isChromeBrowser = navigator.userAgent.toLowerCase().indexOf("chrome") > 0;
	if (isChromeBrowser)
		browser_type = BROWSER_TYPE_CHROME;
	else {
		isOmniWebBrowser = navigator.userAgent.toLowerCase().indexOf("omniweb") > 0;
		if (isOmniWebBrowser){
			browser_type = BROWSER_TYPE_OMNIWEB;
		}
		else {
			isOperaBrowser = navigator.userAgent.toLowerCase().indexOf("opera") > 0;		
			if (isOperaBrowser) {
				browser_type = BROWSER_TYPE_OPERA;
			}
			else {
				isKonquerorBrowser = navigator.userAgent.toLowerCase().indexOf("konqueror") > 0;
				if (isKonquerorBrowser) {
					browser_type = BROWSER_TYPE_KONQUEROR;
				}
				else {
					isSafariBrowser = navigator.userAgent.toLowerCase().indexOf("safari") > 0;
					if (isSafariBrowser) {
						browser_type = BROWSER_TYPE_SAFARI;
					}					
					else {
						isIEBrowser = navigator.userAgent.toLowerCase().indexOf("msie") > 0;
						if (isIEBrowser) {
							browser_type = BROWSER_TYPE_MSIE;
						}
						else {
							isFFBrowser = navigator.userAgent.toLowerCase().indexOf("firefox") > 0;							
							if (isFFBrowser) {
								browser_type = BROWSER_TYPE_FIREFOX;
							}
							else {
								browser_type = BROWSER_TYPE_UNKNOWN;
							}
						}
					}
				}
			}
		}
	}		
	return browser_type;
}

