idx=0;
var imgs = new Array() 
var links = new Array() 

imgs[0]="0-webdoor-lagoa-nova-2.jpg"
links[0]="http://www.planoeplano.com.br/quartierlagoanova/conheca"


imgs[1]="6-crttohomeclub.jpg"
links[1]="http://www.planoeplano.com.br/certtohomeclub/conheca"


imgs[2]="1-inmare2.jpg"
links[2]="http://www.inmare.com.br"

imgs[3]="2-NovoStillo.jpg"
links[3]="http://www.planoeplano.com.br/novosttilo"

imgs[4]="3-Vita2.jpg"
links[4]="http://www.planoeplano.com.br/vitaresidencialclube/conheca"

imgs[5]="4-lacqua.jpg"
links[5]="http://www.planoeplano.com.br/lacqua/conheca"

imgs[6]="5-infinity.jpg"
links[6]="http://www.planoeplano.com.br/infinity/conheca"


setTimeout("goprox();",2500);

function fechar(){
	document.getElementById("modal").style.display="none"
}

function abrir(){
	scroll(0,0)
	document.getElementById("modal").style.display="block"
}

function goprox(){
		total=imgs.length
		
		if(idx==(total-1))
		{
			idx=0
		}
		else{
			idx=(idx+1)
		}
		setTimeout("goprox2();",2500);
}
function desmarcaTodos(){
	for(u=0; u < imgs.length; u++){
		document.getElementById("td"+u).src="util/images/tt3.png"
	}
}

function goprox2(){
	txt="<a href='" + links[idx] + "'><img src='util/images/"+imgs[idx]+"'></a>";
	document.getElementById("webdoor-content").innerHTML=txt
	desmarcaTodos()
	document.getElementById("td"+idx).src="util/images/tt4.png"
	setTimeout("goprox();",2500);
}




/*GO TO URL*/
function gotourl() {
  var i, args=gotourl.arguments; document.tv1_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function goAway(){
	document.getElementById("floater_empreendimento").style.display = 'none';
}

function corretorOnline(tipoBanner,objEmpreendimento){
	var nWidth = 480;
	var nHeight = 645;
	var nTop = (screen.height - nHeight) / 2
	var nLeft = (screen.width - nWidth) / 2
	if(typeof objEmpreendimento == 'number') {
		window.open('http://www.planoeplano.com.br/corretoronline.php?tipoBanner='+tipoBanner+'&emp='+ objEmpreendimento +'','popCorretor', 'width='+nWidth+', height='+nHeight+', top='+nTop+', left='+nLeft+',location=no,resizable=no,scrollbars=no,statusbar=yes');
	} else {
		window.open('http://www.planoeplano.com.br/'+objEmpreendimento+'/corretoronline/'+tipoBanner,'popCorretor', 'width='+nWidth+', height='+nHeight+', top='+nTop+', left='+nLeft+',location=no,resizable=no,scrollbars=no,statusbar=yes');
	}
	
	// redir de lacqua
	if(objEmpreendimento==15) {
		window.location = "http://planoeplano/lacqua/conheca/";
	}
}

//mostra popup de corretores
function MostraDiv(){
	document.getElementById("divTopLeftDHTML").style.display = 'block';
}

function getFloatPosition(elemID){
    var offsetTrail = document.getElementById(elemID);
    var offsetLeft = 0;
    var offsetTop = 0;
    while (offsetTrail) {
        offsetLeft += offsetTrail.offsetLeft;
        offsetTop += offsetTrail.offsetTop;
        offsetTrail = offsetTrail.offsetParent;
    }
    if (navigator.userAgent.indexOf("Mac") != -1 && 
        typeof document.body.leftMargin != "undefined") {
        offsetLeft += document.body.leftMargin;
        offsetTop += document.body.topMargin;
    }
    return {left:offsetLeft, top:offsetTop};
}

function IEVersion(obj_return){
	var _n=navigator,_w=window,_d=document;
	var version="NA";
	var na=_n.userAgent;
	var ieDocMode="NA";
	var ie8BrowserMode="NA";
	if(/msie/i.test(na) && (!_w.opera)){
		if(_w.attachEvent && _w.ActiveXObject){		
			version = (na.match( /.+ie\s([\d.]+)/i ) || [])[1];
			if(parseInt(version)==7){				
				if(_d.documentMode){
					version = 8;
					if(/trident\/\d/i.test(na)){
						ie8BrowserMode = "Compat Mode";
					}else{
						ie8BrowserMode = "IE 7 Mode";
					}
				}
			}else if(parseInt(version)==8){
				if(_d.documentMode){ ie8BrowserMode = "IE 8 Mode";}
			}
			ieDocMode = (_d.documentMode) ? _d.documentMode : (_d.compatMode && _d.compatMode=="CSS1Compat") ? 7 : 5;//default to quirks mode IE5				   			
		}
	}
	
	var retorno = '';
	if(obj_return == 'version'){
		retorno = version;
	}
				 
	return retorno;
	/*
	{
		"UserAgent" : na,
		"Version" : version,
		"BrowserMode" : ie8BrowserMode,
		"DocMode": ieDocMode
	}
	*/
}

function chathome(objEmpreendimento){
	var nWidth = 480;
	var nHeight = 660;
	var nTop = (screen.height - nHeight) / 2
	var nLeft = (screen.width - nWidth) / 2
	if(typeof objEmpreendimento == 'number') {
		window.open('http://www.planoeplano.com.br/chathome.php?emp='+ objEmpreendimento +'','popCorretor', 'width='+nWidth+', height='+nHeight+', top='+nTop+', left='+nLeft+',location=no,resizable=no,scrollbars=no,statusbar=yes');
	} else {
		window.open('http://www.planoeplano.com.br/'+objEmpreendimento+'/corretoronline','popCorretor', 'width='+nWidth+', height='+nHeight+', top='+nTop+', left='+nLeft+',location=no,resizable=no,scrollbars=no,statusbar=yes');
	}
}

function simulador(){
	var nWidth = 480;
	var nHeight = 550;
	var nTop = (screen.height - nHeight) / 2
	var nLeft = (screen.width - nWidth) / 2
	window.open('/simuladordacaixa','popCorretor', 'width='+nWidth+', height='+nHeight+', top='+nTop+', left='+nLeft+',location=no,resizable=no,scrollbars=no,statusbar=yes');
}

function clickbanner(obj_banner){
	pageTracker._trackPageview('/banner_' + obj_banner);
}

function indiqueImovel(objEmpreendimento){
	var nWidth = 480;
	var nHeight = 600;
	var nTop = (screen.height - nHeight) / 2
	var nLeft = (screen.width - nWidth) / 2
	if(typeof objEmpreendimento == 'number') {
		window.open('http://www.planoeplano.com.br/indiqueimovel.php?emp='+ objEmpreendimento +'','popIndique', 'width='+nWidth+', height='+nHeight+', top='+nTop+', left='+nLeft+',location=no,resizable=no,scrollbars=no,statusbar=yes');
	} else {
		window.open('/'+objEmpreendimento+'/indiqueimovel','popIndique', 'width='+nWidth+', height='+nHeight+', top='+nTop+', left='+nLeft+',location=no,resizable=no,scrollbars=no,statusbar=yes');
	}
}

/*PEGAR POSIÇÃO DO ELEMENTO*/
function getPosicaoElemento(elemID){
    var offsetTrail = document.getElementById(elemID);
    var offsetLeft = 0;
    var offsetTop = 0;
    while (offsetTrail) {
        offsetLeft += offsetTrail.offsetLeft;
        offsetTop += offsetTrail.offsetTop;
        offsetTrail = offsetTrail.offsetParent;
    }
    if (navigator.userAgent.indexOf("Mac") != -1 && 
        typeof document.body.leftMargin != "undefined") {
        offsetLeft += document.body.leftMargin;
        offsetTop += document.body.topMargin;
    }
    return {left:offsetLeft, top:offsetTop};
}

function alinhaSky(){
	var obj_siteleft = getPosicaoElemento("base").left;
	document.getElementById("sky").style.top = 145 + 'px';
	document.getElementById("sky").style.left = obj_siteleft + 790 + 'px';
	document.getElementById("sky").style.display = 'inline';
}

function faleConosco(objEmpreendimento){
	var nWidth = 480;
	var nHeight = 600;
	var nTop = (screen.height - nHeight) / 2
	var nLeft = (screen.width - nWidth) / 2	
	if(typeof objEmpreendimento == 'number') {
		window.open('/faleconosco.php?emp='+ objEmpreendimento +'','popCorretor', 'width='+nWidth+', height='+nHeight+', top='+nTop+', left='+nLeft+',location=no,resizable=no,scrollbars=no,statusbar=yes');
	} else {
		window.open('/'+objEmpreendimento+'/faleconosco','popCorretor', 'width='+nWidth+', height='+nHeight+', top='+nTop+', left='+nLeft+',location=no,resizable=no,scrollbars=no,statusbar=yes');
	}
}
function faleConoscoRelacionamento(objEmpreendimento){
	var nWidth = 480;
	var nHeight = 600;
	var nTop = (screen.height - nHeight) / 2
	var nLeft = (screen.width - nWidth) / 2
	window.open('/faleconosco.php?emp='+ objEmpreendimento +'','popCorretor', 'width='+nWidth+', height='+nHeight+', top='+nTop+', left='+nLeft+',location=no,resizable=no,scrollbars=no,statusbar=yes');
}

function showFlash(objW, objH, objSwf){
	document.write("<OBJECT classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width='"+ objW +"' height='"+ objH +"'>")
	document.write("<PARAM name='movie' value='"+ objSwf +"'>")
	document.write("<PARAM name='quality' value='high'>")
	document.write("<PARAM name='wmode' value='transparent'>")
	document.write("<EMBED src='"+ objSwf +"' quality='high' wmode='transparent' width='"+ objW +"' height='"+ objH +"' align='middle' allowscriptaccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'>")
	document.write("</OBJECT>")
}

function carregaBairro(f) {
	var param = 'id='+f.options[f.selectedIndex].value;
	var el = $('bairro_select');
	el.options.length = 0; // limpa todas as opções
	el.options[0] = new Option("Selecione","0");
	new Ajax.Request('/util/inc/bairro.php', {
	  method: 'post',
	  parameters: param,
	  onSuccess: function(reponse) {
		try { // se json estiver errado, não faz nada
			var txt = reponse.responseText.evalJSON();
			for(i=0;i<=txt.length;i++) {
				// adiciona as Option no Select
				el.options[i+1] = new Option(txt[i][0].bairro,txt[i][0].id);
			}
		} catch(e) {
			
		}
	  }
	});
}

function carregaDorms(g) {
	var aparam = 'id='+g.options[g.selectedIndex].value;
	var ael = $('dormitorio_select');
	ael.options.length = 0; // limpa todas as opções
	ael.options[0] = new Option("Selecione","0");

if(aparam=="id=0")
{
	carregaDormPorCidade(document.getElementById("cidade_2"))
	carregaFasePorCidade(document.getElementById("cidade_2"))
}
else
{
	new Ajax.Request('http://www.planoeplano.com.br/util/inc/dorms.php', {
		  method: 'post',
		  parameters: aparam,
		  onSuccess: function(response) {
	
			try { // se json estiver errado, não faz nada
				var atxt = response.responseText.evalJSON();
				for(a=0;a<=atxt.length;a++) {
					// adiciona as Option no Select
					ael.options[a+1] = new Option(atxt[a][0].dormitorio,atxt[a][0].id);
				}
			} catch(e) {
				
			}
		  }
		});
}
}

function carregaDormPorCidade(g)
{
	var aparam = 'id='+g.options[g.selectedIndex].value;
	var ael = $('dormitorio_select');
	ael.options.length = 0; // limpa todas as opções
	ael.options[0] = new Option("Selecione","0");
	new Ajax.Request('/util/inc/dormsCidades.php', {
	  method: 'post',
	  parameters: aparam,
	  onSuccess: function(response) {

		try { // se json estiver errado, não faz nada
		//alert(response.responseText)
			var atxt = response.responseText.evalJSON();
			for(a=0;a<=atxt.length;a++) {
				// adiciona as Option no Select
				ael.options[a+1] = new Option(atxt[a][0].dormitorio,atxt[a][0].id);
			}
		} catch(e) {
			
		}
	  }
	});
}


function carregaFasePorCidade(g)
{
	var aparam = 'id='+g.options[g.selectedIndex].value;
	var ael = $('fase_2');
	ael.options.length = 0; // limpa todas as opções
	ael.options[0] = new Option("Selecione","0");
	new Ajax.Request('/util/inc/fasesCidades.php', {
	  method: 'post',
	  parameters: aparam,
	  onSuccess: function(response) {

		try { // se json estiver errado, não faz nada
		//alert(response.responseText)
			var atxt = response.responseText.evalJSON();
			for(a=0;a<=atxt.length;a++) {
				// adiciona as Option no Select
				ael.options[a+1] = new Option(atxt[a][0].fase,atxt[a][0].id);
			}
		} catch(e) {
			
		}
	  }
	});
}

function carregaFasePorBairro(g)
{
	var aparam = 'id='+g.options[g.selectedIndex].value;
	var ael = $('fase_2');
	ael.options.length = 0; // limpa todas as opções
	ael.options[0] = new Option("Selecione","0");
	new Ajax.Request('/util/inc/fasesBairros.php', {
	  method: 'post',
	  parameters: aparam,
	  onSuccess: function(response) {

		try { // se json estiver errado, não faz nada
		//alert(response.responseText)
			var atxt = response.responseText.evalJSON();
			for(a=0;a<=atxt.length;a++) {
				// adiciona as Option no Select
				ael.options[a+1] = new Option(atxt[a][0].fase,atxt[a][0].id);
			}
		} catch(e) {
			
		}
	  }
	});
}
function printFlash(obj_arquivo, obj_flashvars, obj_w, obj_h){
	var obj_flash = "";
	obj_flash = obj_flash + "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='"+ obj_w +"' height='"+ obj_h +"' id='plano_flash_mestre_2' align='middle'>";
	obj_flash = obj_flash + "<param name='allowScriptAccess' value='sameDomain' />";
	obj_flash = obj_flash + "<param name='allowFullScreen' value='false' />";
	if(obj_flashvars!=''){
	    obj_flash = obj_flash + "<PARAM NAME='FlashVars' VALUE='"+ obj_flashvars +"'>";
	}
	obj_flash = obj_flash + "<param name='movie' value='"+ obj_arquivo +"' />";
	obj_flash = obj_flash + "<param name='quality' value='high' /><param name='wmode' value='transparent' />";
	obj_flash = obj_flash + "<embed src='"+ obj_arquivo +"' FlashVars='"+ obj_flashvars +"' quality='high' wmode='transparent' width='"+ obj_w +"' height='"+ obj_h +"' name='plano_flash_mestre_2' align='middle' allowScriptAccess='sameDomain' allowFullScreen='false' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />";
	obj_flash = obj_flash + "</object>";
	document.write(obj_flash);
}
function printFlashBase(obj_arquivo, obj_flashvars, obj_w, obj_h){
	var obj_flash = "";
	obj_flash = obj_flash + "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='"+ obj_w +"' height='"+ obj_h +"' id='plano_flash_mestre_2' align='middle'>";
	obj_flash = obj_flash + "<param name='allowScriptAccess' value='sameDomain' />";
	obj_flash = obj_flash + "<param name='allowFullScreen' value='false' />";
	if(obj_flashvars!=''){
	    obj_flash = obj_flash + "<PARAM NAME='FlashVars' VALUE='"+ obj_flashvars +"'>";
	}
	obj_flash = obj_flash + "<param name='base' value='/' />";
	obj_flash = obj_flash + "<param name='movie' value='"+ obj_arquivo +"' />";
	obj_flash = obj_flash + "<param name='quality' value='high' /><param name='wmode' value='transparent' />";
	obj_flash = obj_flash + "<embed base='/' src='"+ obj_arquivo +"' FlashVars='"+ obj_flashvars +"' quality='high' wmode='transparent' width='"+ obj_w +"' height='"+ obj_h +"' name='plano_flash_mestre_2' align='middle' allowScriptAccess='sameDomain' allowFullScreen='false' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />";
	obj_flash = obj_flash + "</object>";
	document.write(obj_flash);
}

/* modo antigo dos Select
// carrega os forms da busca
function carregaCidade() {

	var el = $("form_select_list_cidade");
	url = 'util/inc/cidadeEstado.php';
	new Ajax.Request(url, {
	  method: 'get',
	  onSuccess: function loadCidade(transport) {
	  //alert(transport.responseText);
	    var a = transport.responseText.evalJSON();
		$("cidade_select").setValue(a[0][0].cidade); // preenche com o primeiro resultado
		var i = 0;
		var list = '';
		while(i <= a.length) {
			el2 = new Element('a',{ href:"#", id:"cidade", title:a[i][0].cidade , onclick:"setaForm(this," + a[i][0].id + "); return false;" });
			el3 = new Element('br');
			el2.appendChild(document.createTextNode(a[i][0].cidade));
			el.appendChild(el2);
			el.appendChild(el3);
			i++;
		}
		carregaBairro(a[0][0].id);
	  }
	});
	// cria o efeito para o botão
	$("select_img_cidade").observe("click", function() {
		Effect.BlindDown('form_select_list_cidade', { duration: 1.0 });
	});
}

function carregaBairro(id) {

	var url = 'util/inc/bairro.php';
	var param = 'id='+id;
	var el = $("form_select_list_bairro");
	
	new Ajax.Request(url, {
	  method: 'post',
	  parameters: param,
	  onSuccess: function(transport) {
	    var a = transport.responseText.evalJSON();
		$("bairro_select").setValue(a[0]); // preenche com o primeiro resultado
		//$("form_select_list_bairro").innerHTML = '';
		
		var i = 0;
		var list = '';
		while(i < a.length) {
			el2 = new Element('a',{ href:"#", id:"bairro", title:a[i], onclick:"setaForm(this,''); return false;" });
			el3 = new Element('br');
			el2.appendChild(document.createTextNode(a[i]));
			el.appendChild(el2);
			el.appendChild(el3);
			i++;
		}
		//$("form_select_list_bairro").innerHTML = list;
	  }
	});
	// cria o efeito para o botão
	$("select_img_bairro").observe("click", function() {
		Effect.BlindDown('form_select_list_bairro', { duration: 1.0 });
	});
}

function setaForm(f,id) {
alert('a');
	var el = 'form_select_list_' + f.id;
	Effect.SlideUp(el, { duration: 1.0 });
	el = f.id + '_select';
	$(el).setValue(f.title);
	
	if(f.id=='cidade') {
		carregaBairro(id);
	}
	
}

function formInit() {
	// faz um pré-preenchimento dos forms
	carregaCidade();
	
	$("select_img_dorm").observe("click", function() {
		Effect.BlindDown('form_select_list_dorm', { duration: 1.0 });
	});
	
	// carrega fase da obra
	var url = 'util/inc/fase.php';
	var el = $("form_select_list_fase");
	new Ajax.Request(url, {
	  method: 'get',
	  onSuccess: function(transport) {
	    var a = transport.responseText.evalJSON();
		$("fase_select").setValue(a[0]); // preenche com o primeiro resultado
		//$("form_select_list_bairro").innerHTML = '';
		
		var i = 0;
		var list = '';
		while(i < a.length) {
			el2 = new Element('a',{ href:"javascript:void(0);", id:"fase", title:a[i], onclick:"alert('a'); return false;" });
			el3 = new Element('br');
			el2.appendChild(document.createTextNode(a[i]));
			el.appendChild(el2);
			el.appendChild(el3);
			i++;
		}
	  }
	});
	$("select_img_fase").observe("click", function() {
		Effect.BlindDown('form_select_list_fase', { duration: 1.0 });
	});
}
*/

function checkForm(objCampo,objAcao){
	if(objAcao=='on'){
		document.getElementById("form_" + objCampo).className = 'form_on';
	}else{
		document.getElementById("form_" + objCampo).className = 'form_off';
	}
}

function jumpForm(objCampoEsta,objCampoQtde,objCampoVai){
	if(objCampoEsta.value.length == objCampoQtde){
		objCampoVai.select();
		objCampoVai.focus(); 
	}
}
	
function somenteNumeros(e){
	var tecla = event.keyCode;

	if (tecla > 45 && tecla < 58 && tecla != 47 && tecla != 46) // numeros de 0 a 9
		return true;
	else{
		if (tecla != 8) // backspace
			event.keyCode = 0;
		else
			return true;
	}	

}

function mascaraTelefone(objTelefone){
	var campo = objTelefone.value;
	var campoCount = campo.length;
	var itemAgora = '';

	for (i = 1 ; i < campoCount+1 ; i++){
		if(itemAgora.length < 9){
			itemAgora = itemAgora + campo.substring(i-1,i);
			if(i==4){
			itemAgora = itemAgora + '-';
			}
		}else{
			return false;
		}
	}
	objTelefone.value = itemAgora.replace('--','-');	
}

function selecionaForm(objCampoVai){
	document.getElementById(objCampoVai).focus();
	document.getElementById(objCampoVai).select = true;
}

function checkMail(mail){
	var er = new RegExp(/^[A-Za-z0-9_\-\.]+@[A-Za-z0-9_\-\.]{2,}\.[A-Za-z0-9]{2,}(\.[A-Za-z0-9])?/);
	if(typeof(mail) == "string"){
		if(er.test(mail)){
			return true;
		}
		}else if(typeof(mail) == "object"){
			if(er.test(mail.value)){ 
				return true; 
			}
		}else{
		return false;
	}
}

function validaCPF(cpf)   
{   
  erro = new String;   
  
    if (cpf.value.length == 11)   
    {     
            cpf.value = cpf.value.replace('.', '');   
            cpf.value = cpf.value.replace('.', '');   
            cpf.value = cpf.value.replace('-', '');   
  
            var nonNumbers = /\D/;   
       
            if (nonNumbers.test(cpf.value))   
            {   
                    erro = "A verificacao de CPF suporta apenas números!";   
            }   
            else   
            {   
                    if (cpf.value == "00000000000" ||   
                            cpf.value == "11111111111" ||   
                            cpf.value == "22222222222" ||   
                            cpf.value == "33333333333" ||   
                            cpf.value == "44444444444" ||   
                            cpf.value == "55555555555" ||   
                            cpf.value == "66666666666" ||   
                            cpf.value == "77777777777" ||   
                            cpf.value == "88888888888" ||   
                            cpf.value == "99999999999") {   
                               
                            erro = "Número de CPF inválido!"   
                    }   
       
                    var a = [];   
                    var b = new Number;   
                    var c = 11;   
  
                    for (i=0; i<11; i++){   
                            a[i] = cpf.value.charAt(i);   
                            if (i < 9) b += (a[i] * --c);   
                    }   
       
                    if ((x = b % 11) < 2) { a[9] = 0 } else { a[9] = 11-x }   
                    b = 0;   
                    c = 11;   
       
                    for (y=0; y<10; y++) b += (a[y] * c--);   
       
                    if ((x = b % 11) < 2) { a[10] = 0; } else { a[10] = 11-x; }   
       
                    if ((cpf.value.charAt(9) != a[9]) || (cpf.value.charAt(10) != a[10])) {   
                        erro = "Número de CPF inválido.";   
                    }   
            }   
    }   
    else   
    {   
        if(cpf.value.length == 0)   
            return false   
        else   
            erro = "Número de CPF inválido.";   
    }   
    if (erro.length > 0) {   
            alert(erro);   
            cpf.focus();   
            return false;   
    }     
    return true;       
}   
  
//envento onkeyup   
function maskCPF(CPF) {   
    var evt = window.event;   
    kcode=evt.keyCode;   
    if (kcode == 8) return;   
    if (CPF.value.length == 3) { CPF.value = CPF.value + '.'; }   
    if (CPF.value.length == 7) { CPF.value = CPF.value + '.'; }   
    if (CPF.value.length == 11) { CPF.value = CPF.value + '-'; }   
}   
  
// evento onBlur   
function formataCPF(CPF){
	var teste = CPF.length;  
	//alert(teste);
	
    with (CPF)   
    {   
		retiraFormatacao(CPF);
        value = value.substr(0, 3) + '.' +   
                value.substr(3, 3) + '.' +   
                value.substr(6, 3) + '-' +   
                value.substr(9, 2);   
    }   
}   
function retiraFormatacao(CPF)   
{   
    with (CPF)   
    {   
        value = value.replace (".","");   
        value = value.replace (".","");   
        value = value.replace ("-","");   
        value = value.replace ("/","");   
    }   
}
/*
function f_clientWidth() {
	return f_filterResults (
		window.innerWidth ? window.innerWidth : 0,
		document.documentElement ? document.documentElement.clientWidth : 0,
		document.body ? document.body.clientWidth : 0
	);
}
function f_clientHeight() {
	return f_filterResults (
		window.innerHeight ? window.innerHeight : 0,
		document.documentElement ? document.documentElement.clientHeight : 0,
		document.body ? document.body.clientHeight : 0
	);
	
	alert(f_filterResults);
}
function f_scrollLeft() {
	return f_filterResults (
		window.pageXOffset ? window.pageXOffset : 0,
		document.documentElement ? document.documentElement.scrollLeft : 0,
		document.body ? document.body.scrollLeft : 0
	);
}
function f_scrollTop() {
	return f_filterResults (
		window.pageYOffset ? window.pageYOffset : 0,
		document.documentElement ? document.documentElement.scrollTop : 0,
		document.body ? document.body.scrollTop : 0
	);
}
function f_filterResults(n_win, n_docel, n_body) {
	var n_result = n_win ? n_win : 0;
	if (n_docel && (!n_result || (n_result > n_docel)))
		n_result = n_docel;
	return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}
*/
function f_scrollTop() {
		x = document.body.scrollHeight;
		y = document.body.offsetHeight;
}
window.onscroll = f_scrollTop ;

window.onload = function(){
	
}
