function change_status(id,key_name,table_name,path)
{
	//alert(path+"/ajax_handler.php");
	var status_img_array=new Array("<img src='/images/inactive.gif'>","<img src='/images/active.gif'>");
	var temp;
	var temp_img;
	temp = 'status'+id;
	temp_img = 'status_show'+id;
	var status_val = document.getElementById(temp);
	var status_img_show = document.getElementById(temp_img);
	
	
	//switch_link_status(id,status_val,status_img_show);
	///**********************************************************/

	var new_value;
	if(status_val.value==0)
			{
				new_value =1;
			}
		else
			{
				new_value = 0;
			}

	$.ajax({
		method: "get",url: path+"/ajax_handler.php",data: "SWITCH_STATUS=1&id="+id+'&key_name='+key_name+'&table_name='+table_name+'&status='+status_val.value,
		beforeSend: function(){$(".loading").show("slow");}, //show loading just when link is clicked
		complete: function(){ $(".loading").hide("slow");}, //stop showing loading when the process is complete
		success: function(html){ //so, if data is retrieved, store it in html
		
		if(html==1)
		{	
			
			status_val.value=new_value;	
			var status_arr_index = status_val.value;
			status_img_show.innerHTML=status_img_array[new_value];
			
		}		
		else
		{
			alert('Problem in operation');
			//message=get_message('Problem in operation','1');			
			//document.getElementById('add_rot_msg').innerHTML=message;	
		}
		
		
		
			   }// end success:
			}
		); //close $.ajax(

	//***********************************************************/

	

}// end function




