function XMLHTTPButton_onclick(form_name, action_file) {
 var DataToSend = "form_name="+form_name;

 

 for(var i=0; i<document.forms[form_name].length; i++)
  {
  if (document.forms[form_name].elements[i].type=="checkbox")
   { 
    if (document.forms[form_name].elements[i].checked==true)
     DataToSend=DataToSend+"&"+document.forms[form_name].elements[i].name+"=1";
    else
     DataToSend=DataToSend+"&"+document.forms[form_name].elements[i].name+"=0";
   }
  else
  if (document.forms[form_name].elements[i].type=="radio")
   { 
    if (document.forms[form_name].elements[i].checked==true)
     DataToSend=DataToSend+"&"+document.forms[form_name].elements[i].name+"="+document.forms[form_name].elements[i].value;
   }
  else
   DataToSend=DataToSend+"&"+document.forms[form_name].elements[i].name+"="+document.forms[form_name].elements[i].value;
  //alert(document.forms[form_name].elements[i].name);
  //alert(document.forms[form_name].elements[i].value);
  }

 

 DataToSend=replaceSubstring(DataToSend, " ", "%20");
  //alert(DataToSend);
 var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
 xmlhttp.Open("POST", action_file, false);
 xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
 xmlhttp.send(DataToSend);
 //alert(xmlhttp.responseText);
 if (xmlhttp.responseText=="<font size='4' color=black><b>Tekrar giris yapmalisiniz.</b></font>")
  window.location.href='/';
 return xmlhttp.responseText;
}

//Geri dönen string değerlerin parse edilerek işlenmesi.melcin.
function XMLHTTPText_response(form_name, request_text)
{
  var splited_array ;
  var splited_field ;
  
  // Sayfaya dönen değer ile DB(action)  sayfasından gelen mesajı ayırmak için
  splited_array = request_text.split("|");

  //dizinin 1. elemanı olan 0.item mesaj string tir. melcin.
  if ((splited_array.length==0) || (splited_array.length>0))
   request_text = splited_array[0];

 
  //dizinin 2. elemanı olan 2.item field aktarımının yapıldığı string tir. 
  //bu yüzden dizi 1 den büyük olmalıdır. melcin.
  if (splited_array.length>1)
  {
   splited_field = splited_array[1].split("&");   
   for (i=0; i<splited_field.length; i++)
	{	
    eval("document.forms[form_name]."+splited_field[i].replace("=",".value='")+"';");
    }
  }

  //dizinin 3. elemanı olan 3.item response.redirect. melcin.
  if (splited_array.length==3)
   window.location.href=splited_array[2];

 

  return request_text;
}

function replaceSubstring(inputString, fromString, toString) {
   // Goes through the inputString and replaces every occurrence of fromString with toString
   var temp = inputString;
   if (fromString == "") {
      return inputString;
   }
   if (toString.indexOf(fromString) == -1) { // If the string being replaced is not a part of the replacement string (normal situation)
      while (temp.indexOf(fromString) != -1) {
         var toTheLeft = temp.substring(0, temp.indexOf(fromString));
         var toTheRight = temp.substring(temp.indexOf(fromString)+fromString.length, temp.length);
         temp = toTheLeft + toString + toTheRight;
      }
   } else { // String being replaced is part of replacement string (like "+" being replaced with "++") - prevent an infinite loop
      var midStrings = new Array("~", "`", "_", "^", "#");
      var midStringLen = 1;
      var midString = "";
      // Find a string that doesn't exist in the inputString to be used
      // as an "inbetween" string
      while (midString == "") {
         for (var i=0; i < midStrings.length; i++) {
            var tempMidString = "";
            for (var j=0; j < midStringLen; j++) { tempMidString += midStrings[i]; }
            if (fromString.indexOf(tempMidString) == -1) {
               midString = tempMidString;
               i = midStrings.length + 1;
            }
         }
      } // Keep on going until we build an "inbetween" string that doesn't exist
      // Now go through and do two replaces - first, replace the "fromString" with the "inbetween" string
      while (temp.indexOf(fromString) != -1) {
         var toTheLeft = temp.substring(0, temp.indexOf(fromString));
         var toTheRight = temp.substring(temp.indexOf(fromString)+fromString.length, temp.length);
         temp = toTheLeft + midString + toTheRight;
      }
      // Next, replace the "inbetween" string with the "toString"
      while (temp.indexOf(midString) != -1) {
         var toTheLeft = temp.substring(0, temp.indexOf(midString));
         var toTheRight = temp.substring(temp.indexOf(midString)+midString.length, temp.length);
         temp = toTheLeft + toString + toTheRight;
      }
   } // Ends the check to see if the string being replaced is part of the replacement string or not
   return temp; // Send the updated string back to the user
} // Ends the "replaceSubstring" function


function popup(url,name,features,replace)
{
window.open(url,name,features,replace);
}

function isNumber(a) {
    return typeof a == 'number';
}
function isFunction(a) {
    return typeof a == 'function';
}
function isNull(a) {
    return typeof a == 'object' && !a;
}

function isObject(a) {
    return (a && typeof a == 'object') || isFunction(a);
}
function isString(a) {
    return typeof a == 'string';
}
function isUndefined(a) {
    return typeof a == 'undefined';
}
function isAlien(a) {
   return isObject(a) && typeof a.constructor != 'function';
}
function isArray(a) {
    return isObject(a) && a.constructor == Array;
}
function isBoolean(a) {
    return typeof a == 'boolean';
}
function isEmpty(o) {
    var i, v;
    if (isObject(o)) {
        for (i in o) {
            v = o[i];
            if (isUndefined(v) && isFunction(v)) {
                return false;
            }
        }
    }
    return true;
}

function isNumberEx(eobje)
        { 
        if ((event.keyCode < 48 || event.keyCode > 57) && (event.keyCode= 46))
        	{        	 
        	 event.returnValue = 
        	 0; return
        	false;
        	} 
        	 else return true
        ;
} 

function convertTurkishSet(prmObject){
document.all(prmObject).value = document.all(prmObject).value.replace(/Ğ/g,'G');
document.all(prmObject).value = document.all(prmObject).value.replace(/Ü/g,'G');
document.all(prmObject).value = document.all(prmObject).value.replace(/İ/g,'i');
document.all(prmObject).value = document.all(prmObject).value.replace(/I/g,'i');
document.all(prmObject).value = document.all(prmObject).value.replace(/Ş/g,'S');
document.all(prmObject).value = document.all(prmObject).value.replace(/Ö/g,'O');
document.all(prmObject).value = document.all(prmObject).value.replace(/Ç/g,'C');
document.all(prmObject).value = document.all(prmObject).value.replace(/ğ/g,'g');
document.all(prmObject).value = document.all(prmObject).value.replace(/ü/g,'u');
document.all(prmObject).value = document.all(prmObject).value.replace(/ı/g,'i');
document.all(prmObject).value = document.all(prmObject).value.replace(/ş/g,'s');
document.all(prmObject).value = document.all(prmObject).value.replace(/ö/g,'o');
document.all(prmObject).value = document.all(prmObject).value.replace(/ç/g,'c');
}

function
        isReal() 
        { if((event.keyCode!=13)&&(event.keyCode!=46)&&(event.keyCode < 48 || event.keyCode > 57) && (event.keyCode= 46))
        	{alert("Lütfen sayısal ifade giriniz!");        	 
        	 event.returnValue = 0;}
        }

        
function isNeverNumber(eobje)
        { 
          if ((event.keyCode > 45 || event.keyCode < 90) )
        	{        	 
        	 event.returnValue = 1;
        	 return true;
        	}
        	else 
        	{        	     	 
        	event.returnValue = 0;
        	return false;
        	}
        }
        

function fnSetValues(width,height){
  
   var sFeatures="dialogWidth: "+width+"px;dialogHeight: " + height + "px;center:1;dialogHide:1;scroll:1;status:0;unadorned:1";
   return sFeatures;
}

function fnOpen(URL){
   var sFeatures=fnSetValues(480,280);
   returnValue = window.showModalDialog(URL, "",sFeatures)
   // alert(returnValue);
}

function blockEnter(evt) {
    evt = (evt) ? evt : event;
    var charCode = (evt.charCode) ? evt.charCode :
        ((evt.which) ? evt.which : evt.keyCode);
    if (charCode == 13 || charCode == 3) {
        return false;
    } else {
        return true;
    }
}

