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);

function checkBrowser(){
	this.ver=navigator.appVersion
	this.dom=document.getElementById?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
	return this
}

bw=new checkBrowser()

timSpeed=50

contWidth=582

function makeScrollObj(obj,nest){
	nest=(!nest) ? '':'document.'+nest+'.'										
	this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0;
	this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0;		
	this.width=bw.ns4?this.css.document.width:this.el.offsetWidth
	this.moveIt=moveIt; this.x; this.y;
	this.left=b_getleft										
	return this
}

function moveIt(x,y){
	this.x=x;this.y=y
	this.css.left=this.x
	this.css.top=this.y
}

function b_getleft(){
	var gleft=(bw.ns4 || bw.ns5) ? eval(this.css.left):eval(this.css.pixelLeft);
	return gleft;
}

var altura=0;
var scrollTim;
var active=0;

function scroll(speed){
	clearTimeout(scrollTim)
	way=speed>0?1:0
	if((!way && oScroll[active].left()>-oScroll[active].width+contWidth) || (oScroll[active].left()<0 && way)){
		oScroll[active].css.left= oScroll[active].left()+speed;
		scrollTim=setTimeout("scroll("+speed+")",timSpeed)
	}
}

function noScroll(){
	clearTimeout(scrollTim)
}

function changeActive(num){
	oScroll[active].css.visibility='hidden'
	active=num
	oScroll[active].moveIt(0,0)
	oScroll[active].css.visibility='visible'
}

function scrollInit(){
	oScroll=new Array()
	
	oScroll[0]=new	makeScrollObj('divScroll1','divCont')
	oScroll[0].css.visibility='visible'
	oControl=new makeScrollObj('divControl')
	oControl.css.visibility='visible'
	
	for (i=0;i<=0;i++) {
	oScroll[i]=new	makeScrollObj('divScroll'+ (i + 1),'divCont')
	}

}

function newWindow(theURL,winName,features) { 
window.open(theURL,winName,features);
}




/* preload images */

var imgPath = "images/"; 

var iNames = new Array( 
    "mn_vendas_up.jpg",
    "mn_contato_up.jpg",
    "mn_arquitetos_up.jpg",
    "mn_quintas_up.jpg",
    "mn_casas_up.jpg",
    "mn_chales_up.jpg",
    "mn_sitios_up.jpg",
    "mn_lazer_up.jpg",
    "mn_area_up.jpg",
    "mn_apart_up.jpg",
    "mn_reserva_up.jpg",
    "mn_local_up.jpg",
    "mn_home_up.jpg",
    "mn_fotos_up.jpg",
    "id_mmn_vendas_up.jpg",
    "id_mmn_contato_up.jpg",
    "id_mmn_arquitetos_up.jpg",
    "id_mn_quintas_up.jpg",
    "id_mn_casas_up.jpg",
    "id_mn_chales_up.jpg",
    "id_mn_sitios_up.jpg",
    "id_mn_lazer_up.jpg",
    "id_mn_area_up.jpg",
    "id_mn_apart_up.jpg",
    "id_mn_reserva_up.jpg",
    "id_mn_local_up.jpg",
    "id_mn_fotos_up.jpg"

); 

var imgs = new Array(iNames.length); 

for (i=0; i<iNames.length; i++) { 
    imgs[i] = new Image(); 
    imgs[i].src = imgPath + iNames[i]; 
} 

/* Menu up na pagina atual */
var mn_Name = "mn_" + unidmn;
        
function MnPrintUp(unidmn, mn_Name) {

    document.images[mn_Name].src = "images/" + mn_Name + "_up.jpg";
}


/* 1= up/jpg - 0=dn/gif */
function onMouseGJ(over, img_name, gj) { 
 document.images[img_name].src = 
 "images/" + img_name + ( (over) ? "_up" : "_dn" ) + ( (gj) ? ".jpg" : ".gif" ); 
} 

/* 1= up/jpg - 0=dn/gif */
function ChImage(img_name, img_nmNew, gj) { 
 document.images[img_name].src = 
 "images/" + img_nmNew + ( (gj) ? ".jpg" : ".gif" ); 
} 

function NovaJanela() {
	var _arqt = window.open(
		"arquitetos.html",
		"_arqt",
		"width=314,height=200,dependent=no,directories=no,location=no,menubar=no,resizable=no,scrollbars=no,status=no,titlebar=yes,toolbar=no"
	);
	_arqt.focus();
    
}

function NJapart(win_htm, win_Name) {
	var _apart = window.open(
		win_htm,
		win_Name,
		"width=630,height=386,dependent=no,directories=no,location=no,menubar=no,resizable=no,scrollbars=no,status=no,titlebar=yes,toolbar=no"
	);
	_apart.focus();
    
}

