



function getFormDataStr (form) {
	var poststr = ''

	// Az összes form mező nevét és adatát stringe gyűjti POStoláshoz
	
		for(i=0; i<document.getElementById(form).length; i++)
		{
				//A ki nem választot checkbox nem fog szerepelni a postolt adatok között
				if (document.getElementById(form).elements[i].type == 'checkbox') {
					if ((document.getElementById(form).elements[i].checked == true)) {
						var poststr = poststr + "&" + document.getElementById(form).elements[i].name + "=" + encodeURI( document.getElementById(form).elements[i].value + "&" )
					}
				} else {
					var poststr = poststr + "&" + document.getElementById(form).elements[i].name + "=" + encodeURI( document.getElementById(form).elements[i].value + "&" )
				}
			
		}
	
	return poststr;
}


function DisableEnableForm(xForm,xHow){
  objElems = document.getElementById(xForm).elements;
  for(i=0;i<objElems.length;i++){
    objElems[i].disabled = xHow;
  }
}

function getRequest (url, parameters) {
	http_request.open('POST', url, true);
	http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	http_request.setRequestHeader("Content-length", parameters.length);
	http_request.setRequestHeader("Connection", "close");
	http_request.send(parameters);
}

function getXMLHttpObject () {
      http_request = false;
      
      if (window.XMLHttpRequest) { // Mozilla, Safari,...
         http_request = new XMLHttpRequest();
         if (http_request.overrideMimeType) {
         	// set type accordingly to anticipated content type
            //http_request.overrideMimeType('text/xml');
            http_request.overrideMimeType('text/html');
         }
      } else if (window.ActiveXObject) { // IE
         try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {
            try {
               http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
         }
      }
      if (!http_request) {
         alert('Engedélyezd a javascriptet és ellenőrizd, hogy IE5+, Mozzila vagy Safari böngészőt használsz-e?');
         return false;
      }
}

function autologout () {
	
	     if (window.location.hostname == 'localhost') {
	  		var loc = "http://" + window.location.hostname + "/diospogi.hu/login_logout.html"
	  		window.location = loc
	  	 }
	  	 
	  	 if (window.location.hostname == 'www.diospogi.hu') {
	  		var loc = "http://" + window.location.hostname + "/login_logout.html"
	  		window.location = loc
	  	 }
	
}


