function splitURL(varURL){
	
	temp = split("/", varURL);
	
}

function formatosSistema(src, mask){
	var i = src.value.length;
	var saida = mask.substring(0,1);
	var texto = mask.substring(i)
	if (texto.substring(0,1) != saida){
        src.value += texto.substring(0,1);
	}
}


function exibePullDownSelect(varID, valida){
	
	var d;
	var valida;
	d = document;
	
	if(valida == true){
		d.getElementById(varID).style.display = 'block';
		valida = false;
	}else{
		d.getElementById(varID).style.display = 'none';
		valida = true;
	}
	
	
}


//Função responsável por submeter a busca
function submeterBusca(){
	
	var d;
	d = document;
	
	q = d.frmBuscaTopo.query.value;
	
	q = q.replace(" ", "+");
	
	//alert(q);
	location.href = "../buscar/"+q;
	
	
}

function focaCampoFormulario(n){
	
	document.getElementById(n).focus();
	
}

$(document).ready(function(){
	$('#atendimento').click(function(){
	
		var width = 400;
		var height = 540;
		var left = (screen.width - width) / 2;
		var top = ((screen.height - height) / 2) - 30;
	
		var w = window.open('/atendimento/cliente/index.php', 'at',  'height=' +height+ ', width=' +width+ ',status=no, toolbar=no, resizable=no, scrollbars=no, minimizable=no, left=' +left+ ', top=' +top);

	});
});

function carregarChat(){
	
	$.ajax({
		type: 'post',
		url: '/atendimento/status.php',
		beforeSend: function(){
			$('#box-atendimento').html("Aguarde!");
		},
		success: function(txt){
			$('#box-atendimento').html(txt);
		},
		error: function(txt){
			$('#box-atendimento').html("Ops! Ocorreu um erro durante a requisição do arquivo.");
		}
	});
	
}
	
