
// stores the reference to the XMLHttpRequest object 
var xmlHttp_videof = createXmlHttpRequestObject();

var fetvdofirstlim=0;
var fetvdosecondlim=1;
var fetvdocount=10;

function createXmlHttpRequestObject() 
{ 
// will store the reference to the XMLHttpRequest object 
	var xmlHttp; 
// if running Internet Explorer 
			if(window.ActiveXObject) 
			{ 
					try 
					{ 
							xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); 
					} 
					catch (e) 
					{ 
							xmlHttp = false; 
					} 
			} 
			// if running Mozilla or other browsers 
			else 
			{ 
					try 
					{ 
							xmlHttp = new XMLHttpRequest(); 
							
					} 
					catch (e) 
					{ 
							xmlHttp = false; 
					} 
			} 	
			// return the created object or display an error message 
			if (!xmlHttp) 
					alert("Error creating the XMLHttpRequest object."); 
			else 
					return xmlHttp; 
} 
function processvideo(limitsensor,vidcount) 
{ 

	if(limitsensor == 0)
	{
	//	usersecondlim=userfirstlim;
		fetvdofirstlim=fetvdofirstlim-4;
	}
	if(limitsensor == 1)
	{
		fetvdofirstlim=fetvdofirstlim+4;
	//	usersecondlim=usersecondlim+4;
		
	}
	if(limitsensor == 3)
	{
		fetvdofirstlim=0;
		fetvdosecondlim=4;
	}
	
	
	tempvar1=fetvdofirstlim+4
	fetvdocount=vidcount;	
		/*alert(userfirstlim+ "temp--" +tempvar +"count--" + subcount)*/
	if(fetvdofirstlim==0)
			{
					document.getElementById("img7").disabled= true;
					
			}
			else
			{
					document.getElementById("img7").disabled= false;
			}
			if(fetvdofirstlim>=fetvdocount-1||tempvar1>=fetvdocount)
			{
					document.getElementById("img8").disabled= true;
			
			}
			else
			{
					document.getElementById("img8").disabled= false;
			}
	
// proceed only if the xmlHttp object isn't busy 
			if (xmlHttp_videof.readyState == 4 || xmlHttp_videof.readyState == 0) 
			{ 
				
						
				var url="home_fetured_list_ajx.php?userfirstlim="+fetvdofirstlim+"&usersecondlim="+fetvdosecondlim;
				xmlHttp_videof.open("GET",url,true)
											
						// define the method to handle server responses 
						xmlHttp_videof.onreadystatechange = handleServerResponse2; 
						// make the server request 
						xmlHttp_videof.send(null); 
			} 
			
						// if the connection is busy, try again after one second 
} 


function handleServerResponse2() 
{ 
		
		// move forward only if the transaction has completed 
			if (xmlHttp_videof.readyState == 4) 
			{ 
			// status of 200 indicates the transaction completed successfully 
			
					if (xmlHttp_videof.status == 200) 
					{
							// extract the XML retrieved from the server 
							
							xmlResponse =  xmlHttp_videof.responseText;
							//alert(xmlResponse);
							
								var info=document.getElementById("video_fetured_dispaly");
								info.innerHTML=xmlResponse;
							
							
							
							
							
					} 
					// a HTTP status different than 200 signals an error 
					else 
					{ 
							alert("There was a problem accessing the server: " + xmlHttp_videof.statusText); 
					} 
			} 
} 
