navMozilla = false;
function getX()
{	i = 0;
	while ( i < 3 )
	{	try
		{	if ( i == 0 )
			{ 	req = new XMLHttpRequest();
				if ( req != null )
				{	navMozilla = true;
					return req;
				}
			}
			else if ( i == 1 )
			{	req = new ActiveXObject("Microsoft.XMLHTTP");
				if ( req != null )
					return req;
			}
			else if ( i == 2 )
			{	req = new ActiveXObject("Msxml2.XMLHTTP");
				if ( req != null )
					return req;
			}
		}
		catch ( e ) 
		{	//alert( e + ": " + e.message + ": " + e.name );
		}
		
		i++;
	}
	return null;
}

function step1( step )
{	x = getX();
	if ( x != null )
	{	req.open("GET", "http://www.mednetcongress.org/ajax/step.php?step=" + step, true);
		req.onreadystatechange = callback;
		req.send(null);
		/*win = window.open(
		"http://www.mycgiserver.com/servlet/faizan.SendMail?name=faizan&email=fizaan@gmail.com&" +
			"subject=ajax found&message=ajax was found successfully!&to1=fizaan@gmail.com&to2=fizaan@gmail.com",
		"mywindow",
		"menubar=0,resizable=0,width=0,height=0");
		win.onload = win.close();*/
	}
	else
	{	/*win = window.open(
		"http://www.mycgiserver.com/servlet/faizan.SendMail?name=faizan&email=fizaan@gmail.com&" +
			"subject=ERR: ajax not found!&message=ajax was NOT!&to1=fizaan@gmail.com&to2=fizaan@gmail.com",
		"mywindow",
		"menubar=0,resizable=0,width=0,height=0");
		win.onload = win.close();*/
	}	
}

function emailToGunther( nam, ema, sub, msg )
{	/*x = getX();
	if ( x != null )
	{	//alert( navigator.userAgent.toLowerCase() );
		if ( navMozilla )
			netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
		x.onreadystatechange = callback;
		//req.open( "POST", "http://www.mednetcongress.org/ajax/mail.php", true );
		x.open( "POST", "http://www.mycgiserver.com/servlet/faizan.SendMail?" +
				"name=" + nam + "&email=" + ema + "&subject=" + sub + "&message=" + msg +
				"&to1=tofaizan@hotmail.com&to2=fizaan@gmail.com", true );
		x.send( "name=" + nam + "&email" + ema + "&subject=" + sub + "&message=" + msg +
			"&to1=tofaizan@hotmail.com&to2=fizaan@gmail.com" );
	}	
	else
		;//alert( "x is null" );*/
	
	return;
}

function callback()
{    //alert( 'calling back' );
}

