var xmlHttp
var xmlHttpbigpic

function GetXmlHttpObject()
{
var xmlHttpt=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttpt=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttpt=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttpt=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttpt;
}

function test1()
{
	alert('asd');
}

function stateChangedUpdate() 
{ 
if (xmlHttp.readyState==1)
   { 
   //document.getElementById("divname").innerHTML="<div align=center><img src=images/loading.gif border=0></div>";
   }
if (xmlHttp.readyState==4)
   { 
   document.getElementById("divname").innerHTML=xmlHttp.responseText;

   }

}

function stateChangedUpdatebigpic() 
{ 
if (xmlHttpbigpic.readyState==1)
   { 
   document.getElementById("divbigpic").innerHTML="<div align=center><img src=images/loading.gif border=0></div>";
   }
if (xmlHttpbigpic.readyState==4)
   { 
   document.getElementById("divbigpic").innerHTML=xmlHttpbigpic.responseText;
   tb_init('a.thickbox');
   

   }

}


function aj_getresult(picid,picnum)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }    

var url 

url="getflashcode.php?fid="+picid+"&picnum="+picnum+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChangedUpdate;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function aj_getbigpic(numofpic,folderid)
{ 

xmlHttpbigpic=GetXmlHttpObject();
if (xmlHttpbigpic==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }    

var url 

url="machines_bigpic.php?np="+numofpic+"&fid="+folderid+"&sid="+Math.random();
xmlHttpbigpic.onreadystatechange=stateChangedUpdatebigpic;
xmlHttpbigpic.open("GET",url,true);
xmlHttpbigpic.send(null);
 

}

//function aj_galgetresult(numofpic,folderid)
function aj_galgetresult(catid,picid)

{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }    

var url 

//url="scripts/gallery_subcat.scp.php?np="+numofpic+"&fid="+folderid+"&sid="+Math.random();
url="new_gallery_subcat.scp.php?catid="+catid+"&picid="+picid+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChangedUpdate;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function aj_galgetbigpic(id)
{ 
xmlHttpbigpic=GetXmlHttpObject();
if (xmlHttpbigpic==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }    

var url
url="new_gallery_bigpic.scp.php?id="+id+"&sid="+Math.random();
xmlHttpbigpic.onreadystatechange=stateChangedUpdatebigpic;
xmlHttpbigpic.open("GET",url,true);
xmlHttpbigpic.send(null);
}

////////////////////////////////////
function get_cutomets_list(divid){
  $.get("scripts/customerslist.php", {sid:Math.random()} ,function (data){
  $("#"+divid).html(data);
  $("#cust-list li").first().addClass('selected');
    var first_id= ($("#cust-list .selected").attr('id'));
    get_cotent(first_id)
  });
}
function get_cotent(id){
$("#cust-list li").removeClass('selected');
$("#cust-list .li"+id).addClass('selected');

  $.get("scripts/customer_details.php", {sid:Math.random(),cid:id} ,function (data){
  $("#content_div").fadeOut('slow',function(){
    $("#content_div").html(data).fadeIn('slow');
  });
  });
}













