function ShowError(){
return true;
}
window.onerror=ShowError;

function abrirventana(pagina,titulo){
w=660;
h=530;
t=(screen.width-w)/2;
l=(screen.height-h)/2-33;
win=window.open(pagina,'','width='+w+',height='+h+',scrollbars=yes,resizable=yes');
win.moveTo(t,l);
win.focus();
}

function abrirventanapop(pagina,titulo){
w=660;
h=530;
t=(screen.width-w)/2;
l=(screen.height-h)/2-33;
win=window.open(pagina,'','width='+w+',height='+h+',scrollbars=yes,resizable=yes');
win.moveTo(t,l);
win.focus();
}


function abrirventana2(pagina,w,h){
t=(screen.width-w)/2;
l=(screen.height-h)/2-33;
win=window.open(pagina,'','width='+w+',height='+h+',scrollbars=no,resizable=no');
win.moveTo(t,l);
win.focus();
}


//var calWin;
var calObject;
function abreCalendario(object){
w=225;
h=270;
l=(screen.width-w)/2;
t=(screen.height-h)/2-33;
calObject=object;
calWin=window.open('calendario/cal.php','cal','width='+w+',height='+h+',left='+l+',top='+t+',scrollbars=no,resizable=no');
calwin.moveTo(t,l);
calwin.focus();
}
function cierraCalendario(dia,mes,anno){
if (calObject=='fechaini') {
document.forms[0].fechainidia.value=dia;
document.forms[0].fechainimes.value=mes;
document.forms[0].fechainianno.value=anno;
} else if(calObject=='fechafin') {
document.forms[0].fechafindia.value=dia;
document.forms[0].fechafinmes.value=mes;
document.forms[0].fechafinanno.value=anno;
}else if(calObject=='fechaentrega') {
document.forms[0].actafechadia.value=dia;
document.forms[0].actafechames.value=mes;
document.forms[0].actafechaanno.value=anno;
}
}
function ObtenerObjeto(n, d) {
var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=ObtenerObjeto(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
var nav4 = window.Event ? true : false;
function acceptNum(evt,obj1,objeto2,lmaxima){
var key = nav4 ? evt.which : evt.keyCode;
if (key >= 48 && key <= 57 && objeto2!=''){
obj2=ObtenerObjeto(objeto2);
if(obj1.value.length>=lmaxima) obj2.focus();
}
return (key <= 13 || (key >= 48 && key <= 57));
}

function favoritosphi(){
if ((navigator.appName=="Microsoft Internet Explorer") && (parseInt(navigator.appVersion)>=4)) {
var url="http://www.phillips.com/";
var titulo="Phillips";
window.external.AddFavorite(url,titulo);
}
else {
if(navigator.appName == "Netscape")
alert ("Presione Crtl+D para agregar este sitio en sus Favoritos");
}
}


