var xmlHttp_s

function send_it(){
	if (document.getElementById("email").value == ''){
		alert ("Adres email je wymagany dla dokonania transakcji bankowej.");
		return;
	}
	
	xmlHttp_s=GetXmlHttpObject()
	if (xmlHttp_s==null){
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	var url="sms/session_create.php";

	xmlHttp_s.onreadystatechange=stateChanged_s;
	xmlHttp_s.open("GET",url,true);
	xmlHttp_s.send(null);
} 

function stateChanged_s() 
{ 
	if (xmlHttp_s.readyState==4)
	{ 
		if (xmlHttp_s.responseText != ''){
			//alert(xmlHttp_s.responseText);
			document.getElementById("URL").value="http://szabloniki.com/transakcje.php?sid="+xmlHttp_s.responseText;
			document.getElementById("URLC").value="http://szabloniki.com/transakcje.php?action=c&id="+xmlHttp_s.responseText;
			document.forms['frm'].submit();
		}else{
			alert ("Błąd systemu - nie można rozpocząć transkacji :(");
		}
		
	}
}

function 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;
}


