
function validaCod(){
var codigo=document.codigo.cod.value;//Form é o nome do form e pswd nome do campo da codigo
var id=document.codigo.id.value;//id= software curso / codigo (mes criação = xx)(diainicial + diafinal)
if(id=="pvelite" && codigo=="190102")//codigo é a codigo que será aceita e id também
{abre_pvelite();}
else{
	if(id=="primavera" && codigo=="071113")//codigo é a codigo que será aceita e id também
	{abre_primavera();}
	else{
		if(id=="cadworx" && codigo=="080810" )//codigo é a codigo que será aceita e id também
		{abre_coade();}
		else{
		    if(id=="stei031" && codigo=="1251040" )//codigo é a codigo que será aceita e id também
		    {abre_codecalc();}
		    else{
		        if(id=="" || codigo=="" )//codigo é a codigo que será aceita e id também
                 {alert('[ ID e/ou CÓDIGO não informados ]');}
			            else{
			            alert('[ ID ou CÓDIGO incorreto ]');
			            alert('Verifique letras digitadas em MAIÚSCULAS');
						     }
		        }
	        }
		 }
	 }
	               }

function abre_primavera()
{
winwidth = 424; // width of the new window
winheight = 320; // height of the new window
winleft  = 200; // just dummie values (nao alterar)
wintop    = 200; // just dummie values (nao alterar)
 
if(parseInt(navigator.appVersion)>=4)
{winleft = (screen.width / 2) - (winwidth / 2); // center the window right to left
wintop = (screen.height / 2) - (winheight / 2); // center the window top to bottom
// the values get inserted into the features parameter of the window.open command...
}
window.open('treinamento_primavera.htm', '_blank', 'top=' + wintop + ',left=' + winleft + ',height=' + winheight + ',width=' + winwidth); 
}

function abre_primavera2()
{
winwidth = 424; // width of the new window
winheight = 320; // height of the new window
winleft  = 200; // just dummie values (nao alterar)
wintop    = 200; // just dummie values (nao alterar)
 
if(parseInt(navigator.appVersion)>=4)
{winleft = (screen.width / 2) - (winwidth / 2); // center the window right to left
wintop = (screen.height / 2) - (winheight / 2); // center the window top to bottom
// the values get inserted into the features parameter of the window.open command...
}
window.open('treinamentoprimavera.htm', '_blank', 'top=' + wintop + ',left=' + winleft + ',height=' + winheight + ',width=' + winwidth); 
}

function abre_pvelite()
{
winwidth = 424; // width of the new window
winheight = 320; // height of the new window
winleft  = 200; // just dummie values (nao alterar)
wintop    = 200; // just dummie values (nao alterar)
 
if(parseInt(navigator.appVersion)>=4)
{winleft = (screen.width / 2) - (winwidth / 2); // center the window right to left
wintop = (screen.height / 2) - (winheight / 2); // center the window top to bottom
// the values get inserted into the features parameter of the window.open command...
}
window.open('treinamento_pvelite.htm', '_blank', 'top=' + wintop + ',left=' + winleft + ',height=' + winheight + ',width=' + winwidth); 
}

function abre_caesar()
{
winwidth = 424; // width of the new window
winheight = 320; // height of the new window
winleft  = 200; // just dummie values (nao alterar)
wintop    = 200; // just dummie values (nao alterar)
 
if(parseInt(navigator.appVersion)>=4)
{winleft = (screen.width / 2) - (winwidth / 2); // center the window right to left
wintop = (screen.height / 2) - (winheight / 2); // center the window top to bottom
// the values get inserted into the features parameter of the window.open command...
}
window.open('treinamento_caesar.htm', '_blank', 'top=' + wintop + ',left=' + winleft + ',height=' + winheight + ',width=' + winwidth); 
}

function abre_coade()
{
winwidth = 424; // width of the new window
winheight = 320; // height of the new window
winleft  = 200; // just dummie values (nao alterar)
wintop    = 200; // just dummie values (nao alterar)
 
if(parseInt(navigator.appVersion)>=4)
{winleft = (screen.width / 2) - (winwidth / 2); // center the window right to left
wintop = (screen.height / 2) - (winheight / 2); // center the window top to bottom
// the values get inserted into the features parameter of the window.open command...
}
window.open('treinamento_coade.htm', '_blank', 'top=' + wintop + ',left=' + winleft + ',height=' + winheight + ',width=' + winwidth); 
}

<!-- Abre uma janela centralizada em qualquer navegador. Use o código abaixo na página para abrir a janela:
<!-- <a href="java script: abrir('PAGINA.htm','600','400');">Abrir janela centralizada</a>
function abrir(pagina,largura,altura) {

//pega a resolução do visitante
w = screen.width;
h = screen.height;

//divide a resolução por 2, obtendo o centro do monitor
meio_w = w/2;
meio_h = h/2;

//diminui o valor da metade da resolução pelo tamanho da janela, fazendo com q ela fique centralizada
altura2 = altura/2;
largura2 = largura/2;
meio1 = meio_h-altura2;
meio2 = meio_w-largura2;

//abre a nova janela, já com a sua devida posição
window.open(pagina,'','height=' + altura + ', width=' + largura + ', top='+meio1+', left='+meio2+'');
}
//-->