

// Abrir PopUP em formato ShowModal
function abrirPopModal(url, alt, lar){
		window.showModalDialog(url,this,"dialogHeight:"+alt+"px;dialogWidth:"+lar+"px;center:yes;scroll:no;status:no;edge:sunken;help:no;");
}

// Abre Pop-Up apartir de parametros de tamanaho (Altura / Largura)
function abrirPop(pagina, larg, alt)	{ //Exibe uma janela popUP com o tamanho predefinido
  //window.open("frmAdicionarProdutos.php", "JANELA", "status=yes")
	window.open(pagina,"poprs",toolbar=0,status=0,menubar=0,scrollbars=0,resizable=0,width='+(larg+20)+',height='+(alt+20)+'); 
}	
function abrirJanelaFull(url) {
	window.open(url,"poprs",'toolbar=0,location=0,directories=0,status=0,fullscreen=1, menubar=0,scrollbars=0,resizable=0,width=850,height=600');
}


function somenteNumero(event,obj){
		
		var tecla;
		var valorTexto = obj.value
		var indexVir = valorTexto.indexOf(",")
		var indexPon = valorTexto.indexOf(".")
		var objTeste = /[\.\,]/.test(valorTexto)
		
		if(window.event){
			tecla = event.keyCode;
		}else if(event.which){
			tecla = event.which;
			
		}
		// 44 representa a (",") tecla != 44 && 
		if ( tecla != 46 && tecla != 8 && tecla < 48 || tecla > 57 ){
		return false;
		}
		if ( (tecla == 46) && objTeste ){
		return false;
		}
}

// ----------------- --------------------------------- --------------------------------- --------------------------------- --------------------------------- --------------------------------- ----------------
// Função que aceita somente valores valores numericos
// ----------------- --------------------------------- --------------------------------- --------------------------------- --------------------------------- --------------------------------- ----------------
function SomenteNumero_carac(e){
    if(document.all) // Internet Explorer
        var tecla = event.keyCode;
    else 
        if(document.layers) // Nestcape
            var tecla = e.which;
        if(tecla > 47 && tecla < 58) // numeros de 0 a 9
            return true;
        else{
            if (tecla != 8) // backspace
                return false;
            else
                return true;
        }
}

function resolucao(){	
	
	if (screen.width>=1400) {
		document.getElementById("Layer1").style.left = "331px";
		document.getElementById("Layer2").style.left = "353px";
	}
	else if (screen.width>=1280) {
		document.getElementById("Layer1").style.left = "251px";
		document.getElementById("Layer2").style.left = "273px";
	}
	else if (screen.width>=1152) {
		document.getElementById("Layer1").style.left = "187px";
		document.getElementById("Layer2").style.left = "208px";
	}
	else if (screen.width>=1024) {
		document.getElementById("Layer1").style.left = "121px";
		document.getElementById("Layer2").style.left = "143px";
	}
	else if (screen.width>=800) {
		document.getElementById("Layer1").style.left = "11px";
		document.getElementById("Layer2").style.left = "33px";
	}
	else {
		document.getElementById("Layer1").style.left = "0px";
		document.getElementById("Layer2").style.left = "22px";
	}
}

