



function createRequestObject() {
       var ro;
       if (navigator.appName == "Microsoft Internet Explorer") {
               ro = new ActiveXObject("Microsoft.XMLHTTP");
       } else {
               ro = new XMLHttpRequest();
       }
       return ro;
       }


 var http1 = createRequestObject();
 var http2 = createRequestObject();
 var http3 = createRequestObject();
 var http4 = createRequestObject();
 var http5 = createRequestObject();
 var http6 = createRequestObject();
 var http7 = createRequestObject();
 var http8 = createRequestObject();
 var http9 = createRequestObject();
 var http10 = createRequestObject();
 var http11 = createRequestObject();
 var http12 = createRequestObject();

  var d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12;
                  
 var st;
    var date; var date2,dd;    var c;
    var inn=0;
    
   
       var x=0,y,z=0,g=0,last=0; 
             
    function go(){
              
            //  document.getElementById('shortcut').value ='';    
            
              dd=new Date();   
              z=z+1;  
              y= document.getElementById('q').value;
             // b= document.getElementById('findb').value;
              x= y.length;
              // if(last==x){g=g+1;}
              c = c + ", " + x;
            
              
             
            if(last!=(y+'~~'+b)){
                 document.getElementById('d2').innerHTML  = c;
                 setTimeout('ask(x,y,last,b)',450); 
                
                 last=y+'~~'+b;  
            } else{
                 last=y+'~~'+b; 
            }
             
               
              
        }
                 
    function gon(){
              
            //  document.getElementById('shortcut').value ='';    
            
              dd=new Date();   
              z=z+1;  
              y= document.getElementById('q').value;
             // b= document.getElementById('findb').value;
              x= y.length;
              // if(last==x){g=g+1;}
              c = c + ", " + x;
            

            if(last!=(y+'~~'+b)){
                 document.getElementById('d2').innerHTML  = c;
                 setTimeout('askl(x,y,last,b)',250); 
                 last=y+'~~'+b;  
            } else{
                 last=y+'~~'+b; 
            }
             
               
              
        }
    var tot;
    var b;
    var de;
     var searching_yes;   
   var searching_no;   
    var last_search;
   function ask(stx,ax,lastx,bx) {        dd1=new Date();                       //    if(lastx==stx)
                                          var y5= document.getElementById('q').value;
                                          var x5= y5.length;  
                                          
                                             
                                              //  if(stx==de){
                                                         dd1=(dd1-dd);                                                             //|| x5!=stx) || (x5==stx && y5==searching_yes)
                                                            if(dd1<300 || searching_yes==(ax+'~~'+bx)){
                                                                        tot='<br>'+ax+' , '+bx+'  no  '+(dd1)+tot; 
                                                            }else{       
                                                                 var xx=0; 
                                                                 
                                                                  document.getElementById('act').innerHTML =  '<table border=0 width="100%"><tr><td width="80" align=center id="ac"><img src="activity.gif" height="35"></td></tr></table>';
                                                                      
                                                                  xx=send_url('');
                                                                      
                                                                                                                                                     //     <td>   .. search .. <font style="color:#4d4d4d;"><b>'+y+'</b></font> ... <font style="text-decoration:line-through;color:#4d4d4d;"><b>'+bx+'</b></font></td>
                                                                     if(xx==5){ 
                                                                        build(stx,ax,bx);
                                                                        tot='<br>'+ax+' , '+bx+'  -  yes  '+(dd1)+tot;  
                                                                        searching_yes =ax+'~~'+bx;
                                                                        last_search=y5;  
                                                                     }  
                                                                        
                                                            }
                                                 de=stx;
                                                 // document.getElementById('d'+stx).innerHTML  = "done3"; 
                                                   document.getElementById('d1').innerHTML  = tot; 
                                                   inn=0;
                                }  
    function askl(stx,ax,lastx,bx) {      buildl(stx,ax,bx);                             
                               
                                }                               
  function build(st2,a,b) { d5 = new Date(); http5.open('get', 'search.php?q=' + encodeURIComponent(a)+'&findb=' + encodeURIComponent(b));http5.onreadystatechange = handleResponse5;http5.send(null);
                       }
  function buildl(st2,a,b) {  window.location = '?q=' + encodeURIComponent(a);
                       }
  

       var id_e;
     function edit(){
              
              id_e = document.getElementById('id_sc').value;  
              val_sc=document.getElementById('shortcut').value 
              url_sc=document.getElementById('url_sc').value 
               previ=id_e;
              previous=val_sc;
              http7.open('get', 'edit.php?id_sc=' + encodeURIComponent(id_e)+'&val_sc=' + encodeURIComponent(val_sc)+'&url_sc=' + encodeURIComponent(url_sc));http7.onreadystatechange = handleResponse7;http7.send(null);
             // document.getElementById('sc_'+id_e).innerHTML =  '<font color="#44aa44">'+val_sc+'</font>'; 
     }
  
            var previ=0;
            var previous=0;
    function edit_sc(id,h,url){
              document.getElementById('sc_'+previ).innerHTML = '<font color="#22cc22">'+previous+'</font>';  
              document.getElementById('sc_'+id).innerHTML = '<input type="text" value="'+h+'" name="shortcut" autocomplete="off" id="shortcut" size="2" style="text-align:center;font-size: 10pt; font-family: serif; color: #606060" onkeyup="edit();" onchange="edit();">';  
              previ=id;
              previous=h;
            document.getElementById('id_sc').value=id;  
             document.getElementById('url_sc').value =url;
            // document.getElementById('sc_'+id_e).style.border='1px sold #3d3d3d';  
           //  document.getElementById('sc_'+id).style.background = "url(cursorn.gif)";;  
              document.getElementById('shortcut').focus(); 
    }
  
      function show_sc(){
      
            http8.open('get', 'search.php?id_sc=all');http8.onreadystatechange = handleResponse8;http8.send(null);
  
    }
      function edit_com(st2,a,b) { d5 = new Date(); 
                       }
  
  
  
  
  
  
  
  
  
                                 
  function ask5(stx,ax,lastx) {                               //    if(lastx==stx)
                                          var y5= document.getElementById('q').value;
                                          var x5= y5.length;      
                                              //  if(stx==de){
                                                            
                                                            if(x5!=stx || (x5==stx && y5==searching_yes)){
                                                                        tot=tot+'<b>stx: </b>'+stx+' - '+x5+' - lastx: '+lastx+'  ax:- '+ax+'  no<br>'; 
                                                            }else{
                                                                        tot=tot+'<b>stx: </b>'+stx+' - '+x5+' - lastx: '+lastx+'  ax:- '+ax+'  yes<br>';  
                                                                        searching_yes =ax;
                                                            }
                                                 de=stx;
                                                 // document.getElementById('d'+stx).innerHTML  = "done3"; 
                                                   document.getElementById('d1').innerHTML  = tot; 
                                                   inn=0;
                                }       
   
                           /*
              if(inn==0){        date = new Date();
                                 
                                 inn=1;
                        }else{ 
                              var curDate = new Date();
                              var di=curDate-date;
                              if(di> 500) ask1(,document.getElementById('finda').value);                   
                        
                        }        */       
                                
                                

                       /*      function ask2(st2,a) { var curDate = null;  do { curDate = new Date(); } while(curDate-date < 2000);    if(st2==st)document.getElementById('d'+st2).innerHTML  =  "<br>st2: "+st2+"  st: "+st; }
    function ask3(st2,a) { var curDate = null;  do { curDate = new Date(); } while(curDate-date < 2000);    if(st2==st)document.getElementById('d'+st2).innerHTML  =  "<br>st2: "+st2+"  st: "+st; }
    function ask4(st2,a) { var curDate = null;  do { curDate = new Date(); } while(curDate-date < 2000);    if(st2==st)document.getElementById('d'+st2).innerHTML  =  "<br>st2: "+st2+"  st: "+st; }
    function ask5(st2,a) { var curDate = null;  do { curDate = new Date(); } while(curDate-date < 2000);    if(st2==st)document.getElementById('d'+st2).innerHTML  =  "<br>st2: "+st2+"  st: "+st; }
    function ask6(st2,a) { var curDate = null;  do { curDate = new Date(); } while(curDate-date < 2000);    if(st2==st)document.getElementById('d'+st2).innerHTML  =  "<br>st2: "+st2+"  st: "+st; }
    function ask7(st2,a) { var curDate = null;  do { curDate = new Date(); } while(curDate-date < 2000);    if(st2==st)document.getElementById('d'+st2).innerHTML  =  "<br>st2: "+st2+"  st: "+st; }
    function ask8(st2,a) { var curDate = null;  do { curDate = new Date(); } while(curDate-date < 2000);    if(st2==st)document.getElementById('d'+st2).innerHTML  =  "<br>st2: "+st2+"  st: "+st; }
    function ask9(st2,a) { var curDate = null;  do { curDate = new Date(); } while(curDate-date < 2000);    if(st2==st)document.getElementById('d'+st2).innerHTML  =  "<br>st2: "+st2+"  st: "+st; }
    function ask10(st2,a) { var curDate = null;  do { curDate = new Date(); } while(curDate-date < 2000);    if(st2==st)document.getElementById('d'+st2).innerHTML  =  "<br>st2: "+st2+"  st: "+st; }
            if(st2==st){
                /*    //  if(st==0){document.getElementById('d1').innerHTML ='xx&nbsp;';}    if(st2==1){d1 = new Date(); http1.open('get', 'search.php?finda=' + encodeURIComponent(a));http1.onreadystatechange = handleResponse1;http1.send(null);}
                      if(st2==2){d2 = new Date(); http2.open('get', 'search.php?finda=' + encodeURIComponent(a));http2.onreadystatechange = handleResponse2;http2.send(null);}
                      if(st2==3){d3 = new Date(); http3.open('get', 'search.php?finda=' + encodeURIComponent(a));http3.onreadystatechange = handleResponse3;http3.send(null);}
                      if(st2==4){d4 = new Date(); http4.open('get', 'search.php?finda=' + encodeURIComponent(a));http4.onreadystatechange = handleResponse4;http4.send(null);}
                      if(st2==5){d5 = new Date(); http5.open('get', 'search.php?finda=' + encodeURIComponent(a));http5.onreadystatechange = handleResponse5;http5.send(null);}
                      if(st2==6){d6 = new Date(); http6.open('get', 'search.php?finda=' + encodeURIComponent(a));http6.onreadystatechange = handleResponse6;http6.send(null);}
                      if(st2==7){d7 = new Date(); http7.open('get', 'search.php?finda=' + encodeURIComponent(a));http7.onreadystatechange = handleResponse7;http7.send(null);}
                      if(st2==8){d8 = new Date(); http8.open('get', 'search.php?finda=' + encodeURIComponent(a));http8.onreadystatechange = handleResponse8;http8.send(null);}
                      if(st2==9){d9 = new Date(); http9.open('get', 'search.php?finda=' + encodeURIComponent(a));http9.onreadystatechange = handleResponse9;http9.send(null);}
                      if(st2==10){d10 = new Date(); http10.open('get', 'search.php?finda=' + encodeURIComponent(a));http10.onreadystatechange = handleResponse10;http10.send(null);}
                      if(st2==11){d11 = new Date(); http11.open('get', 'search.php?finda=' + encodeURIComponent(a));http11.onreadystatechange = handleResponse11;http11.send(null);}
                      if(st2==12){d12 = new Date(); http12.open('get', 'search.php?finda=' + encodeURIComponent(a));http12.onreadystatechange = handleResponse12;http12.send(null);}       
            }else{
                      document.getElementById('d'+st2).innerHTML  =  " exit -  "; 
            }
    
                                                                                                                                                                                         */
                                                                                                                                                                                         
                function handleResponse1() { if (http1.readyState == 4) { 
                                                                    var e = new Date();
                                                                    f=e-d1;
                                                                    document.getElementById('d1').innerHTML  =   http1.responseText;  }
                                            }

 
                function handleResponse2() {if (http2.readyState == 4) {       
                                                                    var e = new Date();
                                                                    f=e-d2;
                                                                    document.getElementById('d2').innerHTML =  http2.responseText;  } 
                                                                        }
 
 
                function handleResponse3() {if (http3.readyState == 4) {              
                                                                    var e = new Date();
                                                                    f=e-d3;
                                                                    document.getElementById('d3').innerHTML =  http3.responseText;  } 
                                             }
                 
                 
                 
function handleResponse4() {if (http4.readyState == 4) {     var e = new Date();
                        f=e-d4; document.getElementById('d4').innerHTML =  http4.responseText;  } }
function handleResponse5() {if (http5.readyState == 4) {      var e = new Date();
                        f=e-d5;document.getElementById('d5').innerHTML =  http5.responseText;   } }
function handleResponse6() {if (http6.readyState == 4) {      var e = new Date();
                        f=e-d6;document.getElementById('d6').innerHTML =  http6.responseText;  } }
function handleResponse7() {if (http7.readyState == 4) {      var e = new Date();
                       } }
function handleResponse8() {if (http8.readyState == 4) {      var e = new Date();document.getElementById('q').value='';document.getElementById('q').focus();
                         f=e-d5;document.getElementById('d5').innerHTML =  http8.responseText;   } } 
function handleResponse9() {if (http9.readyState == 4) {      var e = new Date();
                        f=e-d9;document.getElementById('d9').innerHTML =  http9.responseText;  } }
function handleResponse10() {if (http10.readyState == 4) {      var e = new Date();
                        f=e-d10;document.getElementById('d10').innerHTML =  f+"<br>  -  "+http10.responseText;  } }
function handleResponse11() {if (http11.readyState == 4) {      var e = new Date();
                        f=e-d11;document.getElementById('d11').innerHTML =  f+"<br>  -  "+http11.responseText;  } }
function handleResponse12() {if (http12.readyState == 4) {      var e = new Date();
                        f=e-d12;document.getElementById('d12').innerHTML =  f+"<br>  -  "+http12.responseText;  } }


