// Correctly handle PNG transparency in Win IE 5.5 or higher.
// http://homepage.ntlworld.com/bobosola. Updated 02-March-2004
function correctPNG() {
	var img;
	var imgName;
	var imgID;
	var imgClass;
	var imgTitle;
	var strNewHTML;
	for ( var i = 0; i < document.images.length; i++ ) {
		img = document.images[i];
		imgName = img.src.toUpperCase();
		if ( imgName.substring(imgName.length-3, imgName.length ) == "PNG") {
			imgID = (img.id) ? "id='" + img.id + "' " : "";
			imgClass = (img.className) ? "class='" + img.className + "' " : "";
			imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";
			var imgStyle = "display:inline-block;" + img.style.cssText 
			if ( img.align == "left" )
				imgStyle = "float:left;" + imgStyle;
			if ( img.align == "right" )
				imgStyle = "float:right;" + imgStyle;
			if ( img.parentElement.href )
				imgStyle = "cursor:hand;" + imgStyle;
			strNewHTML = "<span " + imgID + imgClass + imgTitle
			+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
			+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
			+ "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
			img.outerHTML = strNewHTML;
			i = i - 1;
		} //if
	} //Fim do for
}

window.attachEvent("onload", correctPNG);


function toolhover()
{
	if(!document.getElementById || !document.createTextNode){return;}
	var t=document.getElementById('tools');
	if(!t){return;}
	var lis=t.getElementsByTagName('li');
	for(var i=0;i<lis.length;i++)
	{
		lis[i].onmouseover=function(){
			this.className='cur';
		}
		lis[i].onmouseout=function(){
			this.className='';
		}
		lis[i].getElementsByTagName('a')[0].onfocus=function(){
			this.parentNode.className='cur';
		}
		lis[i].getElementsByTagName('a')[0].onblur=function(){
			this.parentNode.className='';
		}
		lis[i].onclick=function(){
			self.location.href=this.getElementsByTagName('a')[0].href;
		}
	}
	var h2s=document.getElementsByTagName('h2');
	for(i=0;i<h2s.length-1;i++)
	{
		h2s[i].className='parent';
		h2s[i].nextSibling.className='hide';
		var newa=document.createElement('a');
		var oldtxt=h2s[i].firstChild.nodeValue;
		newa.appendChild(document.createTextNode(oldtxt));
		newa.href='#'+h2s[i].nextSibling.id;
		newa.onmouseover=function()
		{
			this.parentNode.className='hov';
		}
		newa.onmouseout=function()
		{
			var other=this.parentNode.nextSibling;
			if(other.className.indexOf('hide')==-1)
			{
				this.parentNode.className='open';
			} else {
				this.parentNode.className='parent';
			}
		}
		newa.onclick=function()
		{
			var other=this.parentNode.nextSibling;
			if(other.className.indexOf('hide')==-1)
			{
				other.className='hide';
			} else {
				other.className='show';
			}
			return false;
		}
		h2s[i].replaceChild(newa,h2s[i].firstChild);
	}
	var as=document.getElementsByTagName('a');
	var safeas=as;
	for(var i=0;i<as.length;i++)
	{
		if(safeas[i].className=='back2')
		{
			safeas[i].parentNode.removeChild(safeas[i]);
		}
	}
	var nav=document.getElementById('nav');
	nav.parentNode.removeChild(nav);
	var g=document.getElementById('google');
	if(g){g.style.display='inline';}
	// var last=document.getElementsByTagName('h2')[document.getElementsByTagName('h2').length-1];
	// last.className='open';
	// last.nextSibling.className='';
}
window.onload=toolhover;


function changeView(){
    document.ptviewer.newPanoFromList(document.form1.select1.selectedIndex)
}

function exibir(a){ document.ptviewer.newPanoFromList(a)}

function MM_jumpMenu(targ,selObj,restore){
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function popup(pag, titulo, largura, altura)
	{var Wnd = window.open(pag,titulo,"toolbar=no,location=no,directories=no,scrollbars=yes,resizable=no,width="+largura+"px,height="+altura+"px,status=no,left=0,top=1");
		Wnd.focus();
}