﻿var xmlHttp = false;
try {
  xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
  try {
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (e2) {
    xmlHttp = false;
  }
}
if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
  xmlHttp = new XMLHttpRequest();
}


var alan2
function callServer2(yol,alan) {
alan2=alan
  var url = yol ;

  param=("yorum="+encodeURI(document.yorum_form.yorum.value));

 
  xmlHttp.open("post", url, true);
  xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  xmlHttp.setRequestHeader("Content-length", param.length);
  xmlHttp.setRequestHeader("Connection", "close");
  xmlHttp.onreadystatechange = updatePage2;
  xmlHttp.send(param);
}

function yorumgetir(yol,alan) {
alan2=alan
  var url = yol ;

  param=("yorum="+encodeURI(document.yorum_form.yorum.value));

 
  xmlHttp.open("post", url, true);
  xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  xmlHttp.setRequestHeader("Content-length", param.length);
  xmlHttp.setRequestHeader("Connection", "close");
  xmlHttp.onreadystatechange = updatePage2;
  xmlHttp.send(param);
}
function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}

function anketgetir(yol,alan) {
alan2=alan
  var url = yol ;
  
  param=("oy="+getCheckedValue(document.forms['anket_formu'].elements['OY']));
 
 
  xmlHttp.open("post", url, true);
  xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  xmlHttp.setRequestHeader("Content-length", param.length);
  xmlHttp.setRequestHeader("Connection", "close");
  xmlHttp.onreadystatechange = updatePage2;
  xmlHttp.send(param);
}

function callServer(yol,alan) {
alan2=alan
  var url = yol ;

  xmlHttp.open("get", url, true);
  
  xmlHttp.onreadystatechange = updatePage2;
  xmlHttp.send(null);
}
function updatePage2() {
  if (xmlHttp.readyState == 4) {
    var response = xmlHttp.responseText;
    document.getElementById(alan2).innerHTML = response;
  }
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

