function openSquareWindow(the_url, the_length)
{
	var the_features =' scrollbars=0 ,top=0,left=0 , width=550 , height= 430 ';
	var the_window = window.open(the_url, "", the_features);
	the_window.creator=self ; 
}
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
var TRange = null;
var win = null;
var frameval = false;
var nom = navigator.appName.toLowerCase();
var agt = navigator.userAgent.toLowerCase();
var is_major  = parseInt(navigator.appVersion);
var is_minor  = parseFloat(navigator.appVersion);
var is_ie     = (agt.indexOf("msie") != -1);
var is_ie4up  = (is_ie && (is_major >= 4));
var is_nav    = (nom.indexOf('netscape')!=-1);
var is_nav4   = (is_nav && (is_major == 4));
var is_mac    = (agt.indexOf("mac")!=-1);
var is_gecko  = (agt.indexOf('gecko') != -1);

var is_rev=0
if (is_gecko) {
temp = agt.split("rv:")
is_rev = parseFloat(temp[1])
}

var frametosearch1 = self

function search(whichform, whichframe) {

if (is_ie4up && is_mac) return;

if (is_gecko && (is_rev <1)) return;

if(whichform.findthis.value!=null && whichform.findthis.value!='') {


       str = whichform.findthis.value;
       if(whichframe!=self)
       frameval=true;  
       win = whichframe;    
}

else return;  

var strFound;

if(is_nav4 && (is_minor < 5)) {
   
  strFound=win.find(str); 
	}

if (is_gecko && (is_rev >= 1)) {
   
    if(frameval!=false) win.focus(); // force search in specified child frame
    strFound=win.find(str, false, false, true, false, frameval, false);

}

 if (is_ie4up) {

    if (TRange!=null) {
    TRange.collapse(false)
    strFound=TRange.findText(str)
    if (strFound) TRange.select();
 
  }
  if (TRange==null || strFound==0) {
    TRange=win.document.body.createTextRange()
    strFound=TRange.findText(str)
    if (strFound) TRange.select();

  }
 }

  if (!strFound) alert ("O estabelecimento '"+str+"' não consta em nosso cadastro,verifique se digitou corretamente e sem acento!") 

        
}

