// JavaScript Document



	function GetTestimonialsInfo(page)
	{
		var page= page;		
		//var sid = document.getElementById("txtcustomerid").value;
       var xmlhttp1 = new cl_xmlHttpObject();
    	xmlhttp1.open("get","testimonials_list.php?page="+page,true);
        xmlhttp1.onreadystatechange = function()
    	{
    		
			 if (xmlhttp1.readyState <4) {
 
                      document.getElementById('home_id').innerHTML = "<img src='images/working.gif'>Loading......";
					  //display_info(xmlhttp1.responseText);
  
                  }
				  else if(xmlhttp1.readyState ==4)
						{
							if(xmlhttp1.status==200)
							{
								//clear_message();
								display_info(xmlhttp1.responseText);
								
							}
							else
							{
							display_info("An Error Occured:"+ xmlhttp1.statusText);
							}
						}
    	};
    xmlhttp1.send(null);
	}
	
function EditTestimonialsInfo(id)
	{   			
       	var id= id;
		//alert(id);
		var xmlhttp1 = new cl_xmlHttpObject();				
		xmlhttp1.open("GET","edit_testimonials.php?id="+id,true);
        xmlhttp1.onreadystatechange = function()
    	{
    		 if (xmlhttp1.readyState <4) {
 
                     document.getElementById('home_id').innerHTML = "<img src='images/working.gif'>Loading......";
					  //display_info(xmlhttp1.responseText);
  
                  }
				  else if(xmlhttp1.readyState ==4)
						{
							if(xmlhttp1.status==200)
							{
								clear_message();
								display_info(xmlhttp1.responseText);
							}
							else
							{
							display_info("An Error Occured:"+ xmlhttp1.statusText);
							}
						}
    	};

    xmlhttp1.send(null);
	}
	
	
	
	function UpdateTestimonialsInfo(id)
	{   
		//var sid = document.getElementById("txtcustomerid").value;		
       var xmlhttp1 = new cl_xmlHttpObject();
	  		if(id)
			{
				var id= id;
				var mode = "Edit";		
				var rating = document.getElementById("txtrating").value;
				var description = document.getElementById("txtdescription").value;
				var writtenby = document.getElementById("txtwrittenby").value;
				xmlhttp1.open("POST","add_testimonials_submit.php?id="+id+"&mode="+mode+"&title="+title+"&description="+description+"&writtenby="+writtenby+"&rating="+rating,true);
				//xmlhttp1.open("POST","add_video_submit.php?id="+id+"&mode="+mode+"&category="+category+"&title="+title+"&description="+description+"&statusedition="+statusedition+"&statusprocess="+statusprocess+"&statuscharged="+statuscharged+"&addresslink="+addresslink+"&assignedprice="+assignedprice+"&alerts="+alerts+"&video_date_captured="+video_date_captured+"&video_date_edited="+video_date_edited+"&video_date_filed="+video_date_filed,true);
			
			}
			else
			{
				var mode = "Add";				
				var rating = document.getElementById("txtrating").value;
				var description = document.getElementById("txtdescription").value;
				var writtenby = document.getElementById("txtwrittenby").value;				
				xmlhttp1.open("POST","add_testimonials_submit.php?mode="+mode+"&description="+description+"&writtenby="+writtenby+"&rating="+rating,true);
				
				//xmlhttp1.open("POST","add_news_submit.php?mode="+mode+"&title="+title+"&description="+description+"&news_date="+news_date,true);
			}
			
			
       xmlhttp1.setRequestHeader('Content-Type','multipart/form-data;');

        xmlhttp1.onreadystatechange = function()
    	{
    		
			
			if (xmlhttp1.readyState <4) {
 
                      document.getElementById('home_id').innerHTML = "<img src='images/working.gif'>Loading......";
					  //display_info(xmlhttp1.responseText);
  
                  }
				  else if(xmlhttp1.readyState ==4)
						{
							if(xmlhttp1.status==200)
							{
								get_message(xmlhttp1.responseText)
								//clear_message();
								GetTestimonialsInfo();
								//display_info(xmlhttp1.responseText);								
							}
							else
							{
							display_info("An Error Occured:"+ xmlhttp1.statusText);
							}
						}
						
    	};

    xmlhttp1.send(null);
    }
	
	
	
	function AddTestimonialsInfo()
	{   			
       	var xmlhttp1 = new cl_xmlHttpObject();				
		xmlhttp1.open("GET","edit_testimonials.php",true);
        xmlhttp1.onreadystatechange = function()
    	{
    		
			if (xmlhttp1.readyState <4) {
 
                      document.getElementById('home_id').innerHTML = "<img src='images/working.gif'>Loading......";
					  //display_info(xmlhttp1.responseText);
  
                  }
				  else if(xmlhttp1.readyState ==4)
						{
							if(xmlhttp1.status==200)
							{
								clear_message();
								display_info(xmlhttp1.responseText);
							}
							else
							{
							display_info("An Error Occured:"+ xmlhttp1.statusText);
							}
						}
    	};

    xmlhttp1.send(null);
}
	
	
	function CallTestimonialsCancel()
	{  // alert(url);			
       	/*var URL; 
		if(url == user)
		{
			URL = 'user_list.php';	
		}	*/
		
		var xmlhttp1 = new cl_xmlHttpObject();				
		xmlhttp1.open("GET","testimonials_list.php",true);
        xmlhttp1.onreadystatechange = function()
    	{
    		if (xmlhttp1.readyState <4) {
 
                      document.getElementById('home_id').innerHTML = "<img src='images/working.gif'>Loading......";
					  //display_info(xmlhttp1.responseText);
  
                  }
				  else if(xmlhttp1.readyState ==4)
						{
							if(xmlhttp1.status==200)
							{
								//get_message(xmlhttp1.responseText)
								clear_message();
								GetTestimonialsInfo();
								//display_info(xmlhttp1.responseText);
							}
							else
							{
							display_info("An Error Occured:"+ xmlhttp1.statusText);
							}
						}
    	};

    xmlhttp1.send(null);
    }
