$(document).ready(function(){$('#flash_message').fadeOut(8000);});
function users(com,grid)
{
	if (com=='Delete')
        {
           if($('.trSelected',grid).length>0){
		   if(confirm('Delete ' + $('.trSelected',grid).length + ' items?')){
            var items = $('.trSelected',grid);
            var itemlist ='';
        	for(i=0;i<items.length;i++){
				itemlist+= items[i].id.substr(3)+",";
			}
			$.ajax({
			   type: "POST",
			   dataType: "text",
			   url: siteroot+"Setup/delete_country",
			   data: "items="+itemlist,
			   success: function(text){
			   	
			  	alert(" Total affected rows: "+$('.trSelected',grid).length);
			   $("#flex1").flexReload();
			   }
			 });
			}
			} else {
				return false;
			} 
        }
    else if (com=='Add')
        {
           
            
           window.location.href="add_users.php";
        }
		else if(com == 'Edit')
		{
			
			if($('.trSelected',grid).length>0){
				var items = $('.trSelected',grid);
				var itemlist ='';
        	for(i=0;i<items.length;i++){
				itemlist+= items[i].id.substr(3)+"-";
			}
			alert(itemlist);
				//window.location.href=siteroot+"Setup/Edit_Country/"+itemlist;
			}
		}            
}
function company(com,grid)
{
	
     if (com=='Add')
        {
           
            
           window.location.href="admin_add_company.php";
        }
		         
}
function single_delete(val,url)
{
	
	if(confirm('Are You Sure You Want To Delete This Records!'))
	{
		$.ajax({
				   type: "POST",
				   dataType: "text",
				   url: url,
				   data: "items="+val,
				   success: function(text){
				   $("#flex1").flexReload();
				   alert('Record has been sucessfully deleted');
				   }
				 });
	}
}

function job_delete(val,url)
{
	
	if(confirm('Do you want to delete the your jobs!'))
	{
		$.ajax({
				   type: "POST",
				   dataType: "text",
				   url: url,
				   data: "items="+val,
				   success: function(text){
					
					
				   $("#flex1").flexReload();
				   }
				 });
	}
}

function nothing()
{
}

