//this files to get product by category and product price and product measure unit for 20 text fields
var http = createRequestObject();
function createRequestObject(){
    var request_;
    var browser = navigator.appName;
    if(browser == "Microsoft Internet Explorer"){
        request_ = new ActiveXObject("Microsoft.XMLHTTP");
    }
    else{
        request_ = new XMLHttpRequest();
    }
    return request_;
}

function getInfo4(){	

	// for get
    http.open('get', 'get_age.php?b_day='+ document.form2.b_day.value + '&b_month='+ document.form2.b_month.value + '&b_year='+ document.form2.b_year.value);
    //http.open('get', 'get_age.php?b_year='+ document.form2.b_year.value);
    http.onreadystatechange = handleInfo4;
    http.send(null);
	//for post
	//http.abort;

//	var url = "handle.php?showit=" + escape(content) + "&input=" + myinput;


/*http.open('post', 'get_age.php');
http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
http.onreadystatechange =  handleInfo4;
//http.send('birth='+ document.form2.b_date.value); //form element sent with name id to get_student.php by post



//http.send('b_day='+ document.form2.b_day.value,'b_month='+ document.form2.b_month.value,'b_year='+ document.form2.b_year.value);

//var url = "handle.php?showit=" + escape(content) + "&input=" + myinput;

//http.send('b_month='+ document.form2.b_month.value);
//http.send('b_year='+ document.form2.b_year.value);

//var dat=document.form2.b_year.value+document.form2.b_month.value+document.form2.b_day.value;
//var dat=http.send('b_year='+ document.form2.b_year.value);+http.send('b_month='+ document.form2.b_month.value)+http.send('b_day='+ document.form2.b_day.value);

//http.send('b_day='+ document.form2.b_day.value);
//http.send('b_day='+ document.form2.b_day.value+'&'+'b_month='+ document.form2.b_month.value+'&'+'b_year='+ document.form2.b_year.value); //form element sent with name id to get_student.php by post
//http.send('b_month='+ document.form2.b_month.value);
http.send('b_year='+ document.form2.b_year.value);*/
}

function handleInfo4(){
	
    if(http.readyState == 1){
		//document.getElementById('mydiv4').innerHTML = 'Load...';
		document.getElementById('mydiv4').innerHTML = '';
    }
    if(http.readyState == 4){
        var response = http.responseText;
		document.getElementById('mydiv4').innerHTML = response;
    }
}








/*
//================================== post
function getInfo4(){	
http.open('post', 'get_age.php');
http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
http.onreadystatechange =  handleInfo4;
//http.send('birth='+ document.form2.b_date.value); //form element sent with name id to get_student.php by post



//http.send('b_day='+ document.form2.b_day.value,'b_month='+ document.form2.b_month.value,'b_year='+ document.form2.b_year.value);

//var url = "handle.php?showit=" + escape(content) + "&input=" + myinput;

//http.send('b_month='+ document.form2.b_month.value);
//http.send('b_year='+ document.form2.b_year.value);

//var dat=document.form2.b_year.value+document.form2.b_month.value+document.form2.b_day.value;
//var dat=http.send('b_year='+ document.form2.b_year.value);+http.send('b_month='+ document.form2.b_month.value)+http.send('b_day='+ document.form2.b_day.value);

//http.send('b_day='+ document.form2.b_day.value);
//http.send('b_day='+ document.form2.b_day.value+'&'+'b_month='+ document.form2.b_month.value+'&'+'b_year='+ document.form2.b_year.value); //form element sent with name id to get_student.php by post
//http.send('b_month='+ document.form2.b_month.value);
http.send('b_year='+ document.form2.b_year.value);
}

function handleInfo4(){
    if(http.readyState == 1){
		//document.getElementById('mydiv4').innerHTML = 'Load...';
		document.getElementById('mydiv4').innerHTML = '';
    }
    if(http.readyState == 4){
        var response = http.responseText;
		document.getElementById('mydiv4').innerHTML = response;
    }
}
//===============================================
*/