
function ajaxRequest(process,divname,arg1,arg2,arg3){ 

	
	if(process == 'CheckNLEmailExist'){
		
		txtValue	= document.getElementById(arg1).value;
		

		if(txtValue==""){
			qstr 	= 'p=' + escape(process) + '&email=' + escape(txtValue) + '&check=' + 'null';  
		
		}else{
			qstr 	= 'p=' + escape(process) + '&email=' + escape(txtValue);  
		}
		//xmlhttpPost('http://192.168.1.124:8080/fihlprod/includes/common_ajax.php',divname,qstr);
		xmlhttpPost('http://www.franchiseindia.com/includes/common_ajax.php',divname,qstr);
		
	}else 
	
	if(process == 'MagzOldCommentPagenation'){		
	
		var magzID	= arg1;
		var artID	= arg2;

		var minLimit = document.getElementById('hidMinLimit').value;
		minLimit = parseInt(minLimit)+5;

		qstr 	= 'p=' + escape(process) + '&mID=' + escape(magzID)  + '&aID=' + escape(artID) + '&minLimit=' + escape(minLimit);  

		xmlhttpPost('http://www.franchiseindia.com/includes/common_ajax.php',divname,qstr);
		
	}else 
	
	if(process == 'MagzNewCommentPagenation'){			

		var magzID	= arg1;
		var artID	= arg2;

		var minLimit = document.getElementById('hidMinLimit').value;
		minLimit = parseInt(minLimit)-5;

		qstr 	= 'p=' + escape(process) + '&mID=' + escape(magzID)  + '&aID=' + escape(artID) + '&minLimit=' + escape(minLimit);  

		xmlhttpPost('http://www.franchiseindia.com/includes/common_ajax.php',divname,qstr);
	}else 
	
	if(process == 'NewsOldCommentPagenation'){		

		var newsID	= arg1;

		var minLimit = document.getElementById('hidMinLimit').value;

		minLimit = parseInt(minLimit)+5;

		qstr 	= 'p=' + escape(process) + '&nID=' + escape(newsID) + '&minLimit=' + escape(minLimit);  

		xmlhttpPost('http://www.franchiseindia.com/includes/common_ajax.php',divname,qstr);
	}else 

	if(process == 'NewsNewCommentPagenation'){			

		var newsID	= arg1;

		var minLimit = document.getElementById('hidMinLimit').value;
		minLimit = parseInt(minLimit)-5;

		qstr 	= 'p=' + escape(process) + '&nID=' + escape(newsID) + '&minLimit=' + escape(minLimit);  

		xmlhttpPost('http://www.franchiseindia.com/includes/common_ajax.php',divname,qstr);
	}else 
		
	if(process == 'Postcomment')
	{
		txtValue	= document.getElementById(arg1).value;
		ccode		= document.getElementById('ccode').value;
        txtValue1 		= document.getElementById(arg2).value;
		if(txtValue=="")
		{
			qstr 	= 'p=' + escape(process) + '&comments=' + escape(txtValue) + '&ccode' + escape(txtValue1) + '&check=' + null;  
		    
		    
		}
		else
		{
			qstr 	= 'p=' + escape(process) + '&comments=' + escape(txtValue) + '&ccode=' + escape(txtValue1) ;  
		}


		
		xmlhttpPost('http://www.franchiseindia.com/includes/common_ajax.php',divname,qstr);
		document.getElementById("comments").value = '';
	    document.getElementById("ccode").value = '';
    }else 
	
	if(process == 'Interviewcomment')
	{
		
		txtValue	= document.getElementById(arg1).value;
		ccode		= document.getElementById('ccode').value;
        txtValue1 		= document.getElementById(arg2).value;
		if(txtValue=="")
		{
			qstr 	= 'p=' + escape(process) + '&comments=' + escape(txtValue) + '&ccode' + escape(txtValue1) + '&check=' + null;  
		    
		    
		}
		else
		{
			qstr 	= 'p=' + escape(process) + '&comments=' + escape(txtValue) + '&ccode=' + escape(txtValue1) ;  
      	}
  	xmlhttpPost('http://www.franchiseindia.com/includes/common_ajax.php',divname,qstr);
	

    }else 
	
	if(process == 'Postvoting')
	{
	  
		// txtValue	= document.getElementById(arg1).value;
		// myname	= document.getElementById(arg2).value;
         document.getElementById('pollques').style.display = 'none'; 
     
			qstr 	= 'p=' + escape(process) + '&optionID=' + escape(arg1)+ '&pollId=' + escape(arg2);  
	
		
	
       xmlhttpPost('http://www.franchiseindia.com/includes/common_ajax.php',divname,qstr);
		
	}

}


function xmlhttpPost(strURL,divname,qstr)
 {	

   var xmlHttpReq = false;
    var self = this;
    
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
	
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	
    self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
		  updatePage(self.xmlHttpReq.responseText,divname);
       	   }
    }
    self.xmlHttpReq.send(qstr);	 
}



function updatePage(txtvalue,divname)
{ 

	if(divname){
		document.getElementById(divname).innerHTML="";
		document.getElementById(divname).innerHTML=txtvalue;
	}
}
