var xmlHttp
var wicbox
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;
}

function kayitislem(str,str2,str3,str4,str5){ 
	var url="kayit_cat.php"
	wicbox=str5;
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null){
		alert ("Browser does not support HTTP Request")
		return
	}
	// kategori , ulkeid , sehirid , okulid , kutu 
	/*alert(str); 
	alert(str2);
	alert(str3);
	alert(str4);
	alert(str5);*/
	url=url+"?kategori="+str
	url=url+"&ulkeno="+str2
	url=url+"&sehirno="+str3
	url=url+"&okulno="+str4
	url=url+"&kutu="+str5
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=kayitChange;
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function kayitChange(){
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
		//var mySelect = document.getElementById(selectID); 
		//mySelect.options[mySelect.selectedIndex].text = xmlHttp.responseText; 
		document.getElementById(wicbox).innerHTML=xmlHttp.responseText 		
	} 
}

function takipdurum(str,str2,str3){ 
	var url="kayit_cat.php"
	wicbox=str3;
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null){
		alert ("Browser does not support HTTP Request")
		return
	}
	url=url+"?takipno="+str
	url=url+"&takippass="+str2
	url=url+"&tkutu="+str3
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=kayitChange;
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function konakcheck(str){
	//alert(str,document.getElementById('hafta').value);
	if (parseInt(str)>parseInt(document.getElementById('hafta').value)){
		document.getElementById('konaksure').value = document.getElementById('hafta').value
		return false 
	}
}

function kayitonay(id){
	if (id==1){
		document.getElementById('odemesubmit').value='Ödeme Islemlerine Geç'
	} else {
		document.getElementById('odemesubmit').value='Islemleri Bitir'
	}
}

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 sozcheck(str){
	if (document.getElementById('odemes1').checked == true || document.getElementById('odemes2').checked == true){
		if (document.getElementById('sozlesme').checked == false){
			alert('Sözlesme Kosullarini Kabul Etmelisiniz');
			return false;
		}
	} else if (document.getElementById('odemes3').checked == true){
		return true;
	} else {
		alert('Ödeme tipi seçmelisiniz');
		return false;
	}
}

function popUp(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, 'MyWindow', 'toolbar=0,scrollbars=yes,location=0,statusbar=0,menubar=0,resizable=0,width=700,height=600,left = 262,top = -16');");
}

