// stores the reference to the XMLHttpRequest object
// retrieves the XMLHttpRequest object
            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 findproduct(val)
		{
			
		//alert(val);	
			
	  iNh = "<table id=\"Table1\" align=\"center\" border=\"0\" bordercolor=\"#FFFFFF\" cellpadding=\"0\" cellspacing=\"0\" height=\"200\" width=\"250\"><tbody><tr><td align=\"center\" valign=\"middle\" width=\"100%\"><font color=\"White\" face=\"Arial\" size=\"2\"><br><img src='includes/images/ajax_loader.gif'/>&nbsp;<br>Loading, please wait...  </font></td></tr></tbody></table>";
	   
				obj=document.getElementById('product2');
				//obj1=document.getElementById('mb__product');
				var str1="ajax_section.php?"+val;
				obj.innerHTML = iNh;
				xmlHttp= createXmlHttpRequestObject(); 
				xmlHttp.open("GET",str1,true);
				xmlHttp.onreadystatechange=function()
				{
				if (xmlHttp.readyState == 4) 
				{
				  obj.innerHTML=xmlHttp.responseText;
				  document.getElementById('product1').style.display='block';
	              document.getElementById('product2').style.display='block';
				  
				}
					
					//obj.innerHTML=xmlHttp.responseText;
				}
				xmlHttp.send(null);
			
			
       }
	   
	   
	   function findfreeproduct(val)
	   {
	  iNh = "<table id=\"Table1\" align=\"center\" border=\"0\" bordercolor=\"#FFFFFF\" cellpadding=\"0\" cellspacing=\"0\" height=\"200\" width=\"250\"><tbody><tr><td align=\"center\" valign=\"middle\" width=\"100%\"><font color=\"White\" face=\"Arial\" size=\"2\"><br><img src='includes/images/ajax_loader.gif'/>&nbsp;<br>Loading, please wait...  </font></td></tr></tbody></table>";
	   
				obj=document.getElementById('product4');
				var str1="ajax_section.php?"+val;
				obj.innerHTML = iNh;
				xmlHttp= createXmlHttpRequestObject(); 
				xmlHttp.open("GET",str1,true);
				xmlHttp.onreadystatechange=function()
				{
				if (xmlHttp.readyState == 4) 
				{
				  obj.innerHTML=xmlHttp.responseText;
				  document.getElementById('product3').style.display='block';
	              document.getElementById('product4').style.display='block';
				  
				}
					
					//obj.innerHTML=xmlHttp.responseText;
				}
				xmlHttp.send(null);
			
			
       }
	   
	     
	  function checkNumeric(value)
	  {
		  var anum=/(^\d+$)|(^\d+\.\d+$)/
		  if (anum.test(value))
		  return true;
		  return false;
      }
	   
	   function updateLimit(val,id)
	   {
		var errLimit='saveLimit'+id; 
		var limit='limit'+id;
	    var limitBox=document.getElementById(limit);
		if(checkNumeric(limitBox.value)==false)
		{
		   document.getElementById(errLimit).innerHTML='<span style="color:#FF0000;">Upload limit should be numeric.</span>';
		   limitBox.value='';
		   limitBox.focus();
		   return false;
		}
	   $('#saveLimit'+id).html('Loading...');
		$.ajax({
		   type: "GET",
		   url: "ajax_savelimit.php",
		   data: "value="+val+"&id="+id,
		   success: function(msg){
			 $('#saveLimit'+id).html(msg);
		   }
		 });
		limitBox.value='';
       }
	   
	 function webSiteUrl(kid)
	 {
	       $.ajax({
		   type: "POST",
		   url: "/ajax_websiteurl.php",
		   data: "kid="+kid,
		   success: function(html){ 
		   
		    window.location.href=html;
		   
		   	//window.open(html);
		   }
		 });
		
	 }
	 
	 function f1(id,khomehlayerid)
     {
		  $.ajax({
		   type: "POST",
		   url: "/videohomeajax.php",
		   data: "kid="+id +"&khomehlayerid="+khomehlayerid,
		   success: function(scource){ 
			 $('#topVideo').html(scource);
		   	
		   }
		 });

	 }

	   
	   
	   
	   
