var xmlhttp;
try {
	xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
	try {
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	} catch (E) {
		xmlhttp = false;
	} 
}

if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { 
	xmlhttp = new XMLHttpRequest();
}

function ajax_fields(objId, field) {
	//alert("hai");
	var obj = document.getElementById(objId);
	
	if(field == "previous") 
		{
		var pro_i = document.ajaxfrm.a_pro_id.value;
		var next_ii = document.ajaxfrm.a_next.value;
		var pre_ii = document.ajaxfrm.a_previo.value;
		}else if(field == "next") 
		{
		var pro_i = document.ajaxfrm.a_pro_id.value;
		var next_ii = document.ajaxfrm.a_next.value;
		var pre_ii = document.ajaxfrm.a_previo.value;
		}

		if(field == "open") 
		{
		var pro_i = document.frm.product_id.value;
		var next_ii = '0';
		var pre_ii = '0';

		}
	//alert(field);
	//alert(pro_i);
	//alert(next_ii);
	//alert(pre_ii);
	
	//alert(field);
	
	var server_page = path+"products/case_study_ajax.php?field="+field+"&pro_i="+pro_i+"&next_ii="+next_ii+"&pre_ii="+pre_ii;
	//alert(server_page);
	xmlhttp.open("GET", server_page);
	xmlhttp.onreadystatechange = function () {
		if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
			obj.innerHTML = xmlhttp.responseText;
		}
	}
	xmlhttp.send(null);
}


function ajax_previous(objId, field) {
	//alert("hai");
	var obj = document.getElementById(objId);
	
	if(field == "previous") 
		{
		var pro_i = document.ajaxfrm.a_pro_id.value;
		var next_ii = document.ajaxfrm.a_next.value;
		var pre_ii = document.ajaxfrm.a_previo.value;
		}

	//alert(field);
	//alert(pro_i);
	//alert(next_ii);
	//alert(pre_ii);
	
	//alert(field);
	
	var server_page = path+"products/case_study_ajax.php?field="+field+"&pro_i="+pro_i+"&next_ii="+next_ii+"&pre_ii="+pre_ii;
	//alert(server_page);
	xmlhttp.open("GET", server_page);
	xmlhttp.onreadystatechange = function () {
		if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
			obj.innerHTML = xmlhttp.responseText;
		}
	}
	xmlhttp.send(null);
}





function ajax_next(objId, field) {
	//alert("hai");
	var obj = document.getElementById(objId);
	
	 if(field == "next") 
		{
		var pro_i = document.ajaxfrm.a_pro_id.value;
		var next_ii = document.ajaxfrm.a_next.value;
		var pre_ii = document.ajaxfrm.a_previo.value;
		}

		
	//alert(field);
	//alert(pro_i);
	//alert(next_ii);
	//alert(pre_ii);
	//alert(field);
	
	var server_page = path+"products/case_study_ajax.php?field="+field+"&pro_i="+pro_i+"&next_ii="+next_ii+"&pre_ii="+pre_ii;
	//alert(server_page);
	xmlhttp.open("GET", server_page);
	xmlhttp.onreadystatechange = function () {
		if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
			obj.innerHTML = xmlhttp.responseText;
		}
	}
	xmlhttp.send(null);
}