<!-- 
window.onerror=null;
var xmlhttp;
/*@cc_on @*/ 
/*@if (@_jscript_version >= 5) 
var ids = ['Msxml2.XMLHTTP.5.0','Msxml2.XMLHTTP.4.0', 'Msxml2.XMLHTTP.3.0','Msxml2.XMLHTTP','Microsoft.XMLHTTP']; 
for(var i=0; !xmlhttp && i<ids.length; i++) { 
	try{ xmlhttp = new ActiveXObject(ids[i]); } 
	catch(ex) { xmlhttp = false; } 
} 
@end @*/ 
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
	try {xmlhttp = new XMLHttpRequest();} 
	catch (e) {	xmlhttp=false }
}
//************
function msgPrecosHoteis(){
x="Preços de diárias de hotéis são meramente referenciais\n";
x=x+"e correspondem a diária de 1 pessoa apto. standard.\n\n";
x=x+"Aparecem aqui como: (baixa temporada/alta temporada)\n\n";
x=x+"Alta Temporada: Sextas, Sábados, Feriados, Feriadões,\n";
x=x+" Julho, Dezembro e Eventos Especiais.";
alert(x);
}
//************
function myZoomFlash(ID,percent) {
	o = eval('window.document.'+ID);
	percent = (parseInt(percent));
	loaded = o.PercentLoaded();
	if (loaded<100) {
		alert("Aguarde até o mapa carregar.");
		return;
	}
	if (isNaN(percent)) {
		percent=50;
	}
	o.Zoom(percent);
}
//************
function showhide(dv) {
	o=document.getElementById(dv);
	t=o.style.display;
	if (t=='none') {
		o.style.display='block';
	}else {
		o.style.display='none';
	}
}
//************
function windowMaximize() {
	window.moveTo(0,0);
	window.resizeTo(window.screen.availWidth,window.screen.availHeight);
}
//************
function worldmap() { 
	divworldmap.style.visibility='visible';
	flashworldmap.play();
}
//************
function clearpass(o) {
	o.value='';
}
//************
function clearit(xindex,xoptions,xname) {
	x='adminForm.new_'+xname;
	if (eval(x)) {
		z=eval(x);
		z.value='';
	}
}

function ow(url,w,h,s,namewindow) {popupWin= null;
if (w==null) 
   w="450";
if (h==null)
   h="380";
if (s==null)
   s="1";
if (namewindow==null)
   namewindow="w";

	popupWin=window.open(url,namewindow,'toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=yes,scrollbars='+s+',width='+w+',height='+h);
	popupWin.onBlur="close()";
	if ( (navigator.appName != "Microsoft Internet Explorer") && (navigator.appVersion.substring(0,1) == "3") )
     popupWin.focus();
}
//************
function slide(obj,ini,fim,ximgname,ximg) {
p=obj.src.lastIndexOf("/");
if (p<0 || p<obj.src.length-4) 
   obj.src=obj.src+'/01';
p=obj.src.lastIndexOf("/");
s=obj.src.substr(0,p+1);
w=obj.src.substr(p+1,2); // (p+3,+4)
n=eval(w)+1;
if (ximg) 
   sn=ximg
else 
  sn=n;
if (sn>fim) sn=ini;
if (sn<10) sn="0"+sn;
obj.src=(s+sn);

eval("flg"+ximgname+"("+sn+")");
}
//************
function goTema(xTema) {
  carregando();
  if (top.contents.centro) {
     top.contents.centro.location.src="/grsite/geral?pg=DisplayDicaCapa&NumDica="+xTema;
  }
  top.menu.voltar=-1;
}
//************
function openWin(url, name,larg,alt) {
        popupWin= null;
        popupWin=window.open(url,name,'toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=no,scrollbars=1,width='+larg+',height='+alt);
                popupWin.focus();
        }
//************
function openMainWin(url, name,larg,alt) {
 xpopupWin= null;
 xpopupWin=window.open(url,name,'toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=no,scrollbars=0,width='+larg+',height='+alt);
 xpopupWin.focus();
}
//************
function abreupload(url, name,larg,alt) {
 upopupWin= null;
 upopupWin=window.open(url,name,'toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=yes,scrollbars=1,width='+larg+',height='+alt);
 upopupWin.focus();
}
//************
fonte='<font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#ffffff"><b>';
fimfonte='</b></font>';
//************
function carrega(frame1,page1,frame2,page2,titsecao) {
alert("Tirar layer [carrega]");
}
//************
function carregando(titsecao) {
  top.menu.TurnLayer("centro","Carregando","visible");
}
//************
function out() {
document.texto.src='http://www.gramadosite.com.br/transparent.gif';
}
//************
function over(imagem) { 
document.texto.src=imagem;
}
//************
function linkmenu(op) {
  top.menu.voltar=-2;
  top.menu.proximapaginalnk="";
  top.menu.paginaatual=op;
  top.menu.proximapagina=top.menu.paginaatual+1;

  if (top.menu.proximapagina>12) {
     top.menu.proximapagina=1
     };

  op =op-1;

  // Atualizar o frame do MENU a direita
  TurnLayer("topicos","Carregando","visible");

  top.contents.topicos.location="http://www.gramadosite.com.br/grsite/menudir?pg="+top.menu.opl[op];
  x="http://www.gramadosite.com.br/";
  return (x+top.menu.opsCentro[op]+'&menu='+top.menu.opl[op]);
}
//************
function menudir(op) {
  top.menu.voltar=-2;
  top.menu.proximapaginalnk="";
  top.menu.paginaatual=op;
  top.menu.proximapagina=top.menu.paginaatual+1;

  if (top.menu.proximapagina>11) {
     top.menu.proximapagina=1
     };

  op =op-1;

  // Atualizar o frame do MENU a direita
  TurnLayer("topicos","Carregando","visible");

   top.contents.topicos.src="/grsite/menudir?pg="+top.menu.opl[op];
}
//************
function TurnLayer(frame,layer,state) {
  xe="false";
  if (document.all) {
     if (top.contents) {
        if (top.contents.centro) {
           yy=top.contents.centro.document.body.scrollTop;
           xp=".style.pixelTop="+yy;
           xe="top.contents."+frame+".document.all['"+layer+"']";
           xs=".style.visibility='"+state+"'";
        }
     }
     }
  else {
     if (top.contents.centro) {
        yy=top.contents.centro.window.pageYOffset;
        xp=".top="+yy;
        xe="top.contents."+frame+".document.layers['"+layer+"']";
        xs=".visibility='"+state+"'"
     }
  };
  if ( eval(xe) ) {
     eval(xe+xp);
     eval(xe+xs); }
  else {
     if ( (!top.frames[2]) ) {
        this.location="/VoceEstaNaGramadoSite.htm";
     }
  }
}
//************
function ajuda() {
   if (top.contents.topicos) {
      top.contents.topicos.location="http://www.gramadosite.com.br/ajuda/dir.htm";
   }
   if (top.contents.centro) {
      top.contents.centro.location="http://www.gramadosite.com.br/ajuda/ajuda.htm";
   }
}
//************
	function screenObject()	{
		this.bottom = function(){
			if (document.body.scrollHeight) return document.body.scrollHeight;
		}
		this.height = function() {
			if (document.body.offsetHeight) return document.body.offsetHeight;
		}
		this.visHeight = function() {
			if (window.innerHeight) return window.innerHeight;
			if (document.body.clientHeight) return document.body.clientHeight;
		}
		this.width = function() {
			if (document.body.offsetWidth) return document.body.offsetWidth;
		}
		this.scrollTop = function() {
			if(document.body.scrollTop) return document.body.scrollTop
			if (window.pageYOffset) return window.pageYOffset;
			else return 0;
		}
	}
//************
// Funções para autoresize window
// você pode chamar assim: 
// <a href="testeresizeWin.html" onclick="return !window.open(this.href,'','scrollbars=1,height=100,width=100');">open a popup that resizes to fit unknown content</a>
function getRefToDivMod( divID, oDoc ) {
	if( !oDoc ) { oDoc = document; }
	if( document.layers ) {
		if( oDoc.layers[divID] ) { return oDoc.layers[divID]; } else {
			for( var x = 0, y; !y && x < oDoc.layers.length; x++ ) {
				y = getRefToDivNest(divID,oDoc.layers[x].document); }
			return y; } }
	if( document.getElementById ) { return oDoc.getElementById(divID); }
	if( document.all ) { return oDoc.all[divID]; }
	return oDoc[divID];
}
function resizeWinTo( idOfDiv ) {
	var oH = getRefToDivMod( idOfDiv ); if( !oH ) { return false; }
	alreadyresized=1;
	var x = window; 
	var myW = 0, myH = 0, d = x.document.documentElement, b = x.document.body;
	x.resizeTo( screen.availWidth, screen.availWidth );
	var oW = oH.clip ? oH.clip.width : oH.offsetWidth;
	var oH = oH.clip ? oH.clip.height : oH.offsetHeight; if( !oH ) { return false; }
	x.resizeTo( oW + 200, oH + 200 );
	if( x.innerWidth ) { myW = x.innerWidth; myH = x.innerHeight; }
	else if( d && d.clientWidth ) { myW = d.clientWidth; myH = d.clientHeight; }
	else if( b && b.clientWidth ) { myW = b.clientWidth; myH = b.clientHeight; }
	if( window.opera && !document.childNodes ) { myW += 16; }
	//second sample, as the table may have resized
	var oH2 = getRefToDivMod( idOfDiv );
	var oW2 = oH2.clip ? oH2.clip.width : oH2.offsetWidth;
	var oH2 = oH2.clip ? oH2.clip.height : oH2.offsetHeight;
	x.resizeTo( oW2 + ( ( oW + 200 ) - myW ), oH2 + ( (oH + 200 ) - myH ) );
}
function getxmlPage(datadiv,search_handler,loadingdiv) {
	if (loadingdiv) {
		opencarregando(loadingdiv);
	}
	divdados = document.getElementById(datadiv);
	var agt = navigator.userAgent.toLowerCase();
	var is_ie = (agt.indexOf('msie') != -1);
	var is_ie5 = (agt.indexOf('msie 5') != -1);
	function handle_do_search () {
		if (xmlhttp.readyState == 4) {//request completed
			if (xmlhttp.status == 200) {//request successful
				try {
					if (loadingdiv) {
						closecarregando(loadingdiv);
					}
					divdados.innerHTML = xmlhttp.responseText;
					//divdados.innerHTML = xmlhttp.getResponseHeader('X-eventos');
				}catch (e) {
					//alert('too fast bro!');
				}
			}else {
				alert ('Não foi possível contactar\na GramadoSite.com');
			}
			xmlpageloading=false;
		}
	}
	var xmlhttp = null;
	if (is_ie) {
		var control = (is_ie5) ? 'Microsoft.XMLHTTP' : 'Msxml2.XMLHTTP';
		try {
			xmlhttp = new ActiveXObject(control);
			xmlhttp.onreadystatechange = handle_do_search;
		} catch(e) {
			alert('Por favor, ative scripts e controles activeX em seu navegador!');
		}
	} else {
		xmlhttp = new XMLHttpRequest();
		xmlhttp.onload = handle_do_search;
		xmlhttp.onerror = handle_do_search;
	}
	if (xmlpageloading) {
		return;
	}
	xmlpageloading=true;
	xmlhttp.open('GET', search_handler, true);
	xmlhttp.send(null);
}
//-->