function GetXmlHttpObject()
{ 
	var objXMLHttp1=null

	if (window.XMLHttpRequest)
	{
		objXMLHttp1=new XMLHttpRequest()
	}
	else if (window.ActiveXObject)
	{
		objXMLHttp1=new ActiveXObject("Microsoft.XMLHTTP")
	}
	return objXMLHttp1
}


function loadPhoto(photo)
{
	
	xmlHttpPhoto=GetXmlHttpObject()
	if (xmlHttpPhoto==null)
	{
		alert ("Sem suporte a HTTP Request")
		return
	} 
	var url="http://www.solardaraucaria.com.br/vis_foto.php";
	url=url+"?ft="+photo+"&"+new Date().getTime()+"&"+Math.random();
	xmlHttpPhoto.onreadystatechange=stateChangedPhoto
	xmlHttpPhoto.open("GET",url,true)
	xmlHttpPhoto.send(null)
}

function stateChangedPhoto() 
{ 
	
    if (xmlHttpPhoto.readyState == 4) 
	{
      
        	if (xmlHttpPhoto.status == 200) 
			{
              	document.getElementById('ajaxFoto').innerHTML = xmlHttpPhoto.responseText;
			}
			
			else 
			{
            	//alert("Houve um problema ao obter os dados:\n" + xmlHttpPhoto.statusText);
       		}
    }
	else 
	{
		document.getElementById('ajaxFoto').innerHTML = '<br /><br /><div align="center"><img src="http://www.solardaraucaria.com.br/js/loader.gif" border="0" /></div>';
	}		
}



var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbars=yes,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}


function fitContent()
{
	var scrWidth = screen.availWidth;
	
	if (scrWidth > 1000)
	{
		document.body.style.overflowX = 'hidden';
	}
}

function MM_openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}
