
function deleteContent(str,action){

document.getElementById("delete_content").innerHTML="";

if(action == 'delete_menus'){

var menus_id = str;

if(menus_id){
	var conf = confirm("Are you sure you wish to delete?");
	if(!conf)
	{
		return false;
	}
	xmlhttp=GetXmlHttpObject();
	  if (xmlhttp==null)
        {
          alert ("Your browser does not support XMLHTTP!");
          return;
        }
    var url="ajax.php?menus_id="+menus_id;
	document.getElementById("delete_content").innerHTML="<img src='images/ajax-loader.gif'><span style='color:#3300FF'>Please wait Loading...</span>";
    xmlhttp.onreadystatechange=stateChanged1;
    xmlhttp.open("GET",url,true);
    xmlhttp.send(null);
	}
}



if(action == 'delete_submenus'){

var submenus_id = str;

if(submenus_id){
	var conf = confirm("Are you sure you wish to delete?");
	if(!conf)
	{
		return false;
	}
	xmlhttp=GetXmlHttpObject();
	  if (xmlhttp==null)
        {
          alert ("Your browser does not support XMLHTTP!");
          return;
        }
    var url="ajax.php?submenus_id="+submenus_id;
	document.getElementById("delete_content").innerHTML="<img src='images/ajax-loader.gif'><span style='color:#3300FF'>Please wait Loading...</span>";
    xmlhttp.onreadystatechange=stateChanged2;
    xmlhttp.open("GET",url,true);
    xmlhttp.send(null);
	}
}


if(action == 'delete_content'){

var delete_id = str;

if(delete_id){
	var conf = confirm("Are you sure you wish to delete?");
	if(!conf)
	{
		return false;
	}
	xmlhttp=GetXmlHttpObject();
	  if (xmlhttp==null)
        {
          alert ("Your browser does not support XMLHTTP!");
          return;
        }
    var url="ajax.php?delete_id="+delete_id;
	document.getElementById("delete_content").innerHTML="<img src='images/ajax-loader.gif'><span style='color:#3300FF'>Please wait Loading...</span>";
    xmlhttp.onreadystatechange=stateChanged3;
    xmlhttp.open("GET",url,true);
    xmlhttp.send(null);
	}
}



if(action == 'delete_tabs'){

var deletetab_id = str;

if(deletetab_id){
	var conf = confirm("Are you sure you wish to delete?");
	if(!conf)
	{
		return false;
	}
	xmlhttp=GetXmlHttpObject();
	  if (xmlhttp==null)
        {
          alert ("Your browser does not support XMLHTTP!");
          return;
        }
    var url="ajax.php?deletetab_id="+deletetab_id;
	document.getElementById("delete_content").innerHTML="<img src='images/ajax-loader.gif'><span style='color:#3300FF'>Please wait Loading...</span>";
    xmlhttp.onreadystatechange=stateChanged4;
    xmlhttp.open("GET",url,true);
    xmlhttp.send(null);
	}
}

if(action == 'delete_child_tabs'){

var delete_child_tab_id = str;
//alert(action);
//alert(delete_child_tab_id);
if(delete_child_tab_id){
	var conf = confirm("Are you sure you wish to delete?");
	if(!conf)
	{
		return false;
	}
	xmlhttp=GetXmlHttpObject();
	  if (xmlhttp==null)
        {
          alert ("Your browser does not support XMLHTTP!");
          return;
        }
alert(action);
alert(delete_child_tab_id);
    var url="ajax.php?delete_child_tab_id="+delete_child_tab_id+"&action=delete_child_tab";
	document.getElementById("delete_content").innerHTML="<img src='images/ajax-loader.gif'><span style='color:#3300FF'>Please wait Loading...</span>";
    xmlhttp.onreadystatechange=stateChanged4;
    xmlhttp.open("GET",url,true);
    xmlhttp.send(null);
	}
}
    function stateChanged1()
    {
 
     if (xmlhttp.readyState==4)
     {
	
    document.getElementById("delete_content").innerHTML=xmlhttp.responseText;
	window.setTimeout("sleep_function1();", 1000);
   
     }
 
    }
	
	function stateChanged2()
    {
 
     if (xmlhttp.readyState==4)
     {
	
    document.getElementById("delete_content").innerHTML=xmlhttp.responseText;
	window.setTimeout("sleep_function2();", 1000);
   
     }
 
    }
	
	function stateChanged3()
    {
 
     if (xmlhttp.readyState==4)
     {
	
    document.getElementById("delete_content").innerHTML=xmlhttp.responseText;
	window.setTimeout("sleep_function3();", 1000);
   
     }
 
    }
	
	function stateChanged4()
    {
 
     if (xmlhttp.readyState==4)
     {
	
    document.getElementById("delete_content").innerHTML=xmlhttp.responseText;
	window.setTimeout("sleep_function4();", 1000);
   
     }
 
    }
	

    function GetXmlHttpObject()
   {
      if (window.XMLHttpRequest)
       {
  // code for IE7+, Firefox, Chrome, Opera, Safari
       return new XMLHttpRequest();
   }
      if (window.ActiveXObject)
      {
  // code for IE6, IE5
      return new ActiveXObject("Microsoft.XMLHTTP");
      }
 
    return null;
   }


}


function sleep_function1(){
	window.location="main_menus.php"
}

function sleep_function2(){
	window.location="sub_menus.php"
}

function sleep_function3(){
	window.location="index.php"
}

function sleep_function4(){
	window.location="tab_menus.php"
}

function upload_file(){
	
xmlhttp=GetXmlHttpObject();
  if (xmlhttp==null)
        {
          alert ("Your browser does not support XMLHTTP!");
          return;
        }
    var url="upload_index.php";
	
	document.getElementById("upload_images").innerHTML="<img src='images/ajax-loader.gif'><span style='color:#3300FF'>Please wait Loading...</span>";
    xmlhttp.onreadystatechange=stateChanged;
    xmlhttp.open("GET",url,true);
    xmlhttp.send(null);

    function stateChanged()
    {
 
     if (xmlhttp.readyState==4)
     {

    document.getElementById("upload_images").innerHTML=xmlhttp.responseText;
    
     }
 
    }

    function GetXmlHttpObject()
   {
      if (window.XMLHttpRequest)
       {
  // code for IE7+, Firefox, Chrome, Opera, Safari
       return new XMLHttpRequest();
   }
      if (window.ActiveXObject)
      {
  // code for IE6, IE5
      return new ActiveXObject("Microsoft.XMLHTTP");
      }
 
    return null;
   }


}


function ShowDiv(div){
	
	if(div){
	document.getElementById('mainbody').style.display='block';
	}
	else{
		document.getElementById('mainbody').style.display='';	
	}
	
}

function search_data(){

var search_data = document.getElementById('txt_search').value;
//alert(search_data);

window.location = "http://www.rapidtorc.com/search_result.php?search_data="+search_data;

}


