//AJi - ixf passa a ser o nome da form para a BlueZone
function openWinPostA( windowURL, windowName, width, height, ixf ) {
largura=0
altura=0
if (!document.all){
largura=window.innerWidth
altura=window.innerHeight
}else{
largura=screen.width
altura=screen.height
}
esquerda=(largura/2)-(width/2)
topo=(altura/2)-(height/2)
comScroll="0"
argv = openWinPostA.arguments
//alert("argv.length="+argv.length)
if (argv.length>=5) comScroll="1"
//indexForm=0
argv = openWinPostA.arguments
if (argv.length>=5) indexForm=argv[4]
//alert("indexForm="+indexForm)
windowFeatures="width="+width+",height="+height+",left="+esquerda+",top="+topo+",toolbar=0,location=0,directories=0,status=0,menuBar=1,scrollBars="+comScroll+",resizable=0"
var janela = window.open('',windowName,windowFeatures);
janela.focus();
document.forms[indexForm].method='POST';
document.forms[indexForm].action=windowURL;
document.forms[indexForm].target=windowName;
document.forms[indexForm].submit();
}
//AJf
function openWinPost( windowURL, windowName, width, height, indexForm, scroll) {
largura=0
altura=0
if (!document.all){
largura=window.innerWidth
altura=window.innerHeight
}else{
largura=screen.width
altura=screen.height
}
esquerda=(largura/2)-(width/2)
topo=(altura/2)-(height/2)
windowFeatures="width="+width+",height="+height+",left="+esquerda+",top="+topo+",toolbar=0,location=0,directories=0,status=0,menuBar=1,scrollBars="+scroll+",resizable=0"
var janela = window.open('',windowName,windowFeatures);
janela.focus();
document.forms[indexForm].method='POST';
document.forms[indexForm].action=windowURL;
document.forms[indexForm].target=windowName;
document.forms[indexForm].submit();
}
function abreJanela( windowURL, windowName, width, height ) {
largura=0
altura=0
if (!document.all){
largura=780
altura=window.innerHeight
}else{
largura=780
altura=screen.height
}
esquerda=(largura/2)-(width/2)
topo=(altura/2)-(height/2)
comScroll="0"
argv = abreJanela.arguments
if (argv.length==5) comScroll="1"
windowFeatures="width="+width+",height="+height+",left="+esquerda+",top="+topo+",toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars="+comScroll+",resizable=1"
janela=window.open( windowURL, windowName, windowFeatures )
janela.focus()
}
//esta função trata os links que são inseridos no Publishing
function escreveLinkPublishing(link,texto) {
var linkExterior=false;
var abreJanela=false;
if (link!=null){
if (link.indexOf("http://")!=-1) linkExterior=true;
if (link.indexOf("#1")!=-1 ) abreJanela=true;
link=link.substring(0,link.indexOf("#"));
if (!linkExterior && !abreJanela){
//ajsilva - 20030814 -i
// PERMITIR O POSICIONAMENTO RELATIVO NUMA PÁGINA SUBSTITUINDO % POR #
// PORQUE O # JÁ ERA USADO PARA OUTRAS COISAS
ajre=RegExp('%','gi'); //(global search, ignore case) - ver final
link=link.replace(ajre,'#');
//alert (link);
//ajsilva - 20030814 -f
document.write(""+texto+"")
}
if (linkExterior && !abreJanela){
document.write(""+texto+"")
}
if (!linkExterior && abreJanela){
document.write(""+texto+"")
}
if (linkExterior && abreJanela){
document.write(""+texto+"")
}
}
}
//ajsilva - 20021115 -i
// VALIDAÇÕES DE CAMPOS OBRIGATÓRIOS (field_required)
function validate()
{
x=document.forms[1];
submitOK = true;
msg="Os campos seguintes são de preenchimento obrigatório:";
separador="\n==> ";
//x.hora[1].checked=true;
//alert(x.hora[1].checked);
//alert (x.elements.hora[0].type);
for (var j=0; j<(x.elements.length); j++)
{
//alert(x.elements[j].value);
indx = x.elements[j].name.indexOf('_required');
if (indx != -1)
{
//fieldname=x.elements[j].name.substring(0,indx);
fieldname=x.elements[j].id;
if (x.elements[j].value.length == 0)
{
//alert(fieldname);
msg = msg + separador + fieldname;
//j = (x.elements.length);
submitOK = false;
}
}
/* código para RADIO buttons
Valida 2 radio buttons colocados consecutivamente na form
*/
if (x.elements[j].type.toUpperCase() == "RADIO" )
{
y=x.elements[j];
z=x.elements[j+1];
//alert (y.checked);
indx = y.name.indexOf('_required');
if (indx != -1)
{
fieldname=y.id;
if (!(y.checked || z.checked))
{
//alert("fieldname NOT CHECKED");
msg = msg + separador + fieldname;
submitOK = false;
}
}
j++;
}
}
/*
Valida enderço de email
O name do campo tem de ser emailFrom
*/
if (x.emailFrom.value.length==0){
msg = msg + separador + x.emailFrom.id;
submitOK = false;
}
if (!submitOK){
alert(msg)
}else{
at=x.emailFrom.value.indexOf("@")
if (at==-1)
{
alert("Endereço de e-mail inválido (Ex: name@domain)!")
submitOK = false
}
}
return submitOK;
}
//ajsilva - 20021115 - f
//ajsilva - 20030814 - i
/*
RegExp Object
=============
Description
Contains a regular expression pattern used when searching strings for character combinations.
Syntax
Syntax 1
/pattern/[switch]
Syntax 2
new RegExp("pattern",["switch"])
Parameters
pattern The regular expression pattern to use
switch Optional. Available switches are:
i (ignore case)
g (global search for all occurrences of pattern)
m (multiline)
gi (global search, ignore case)
*/
//ajsilva - 20030814 - f