// Left trim method: strltrim
function strltrim()
{
//Match spaces at beginning of text and replace with a null string
return this.replace(/^\s+/,'');
}
  

// Right trim method: strrtrim
function strrtrim()
{
//Match spaces at end of text and replace with a null string
return this.replace(/\s+$/,'');
}

//Trim method: strtrim

function strtrim()
{
//Match spaces at beginning and end of text and replace
//with null strings
return this.replace(/^\s+/,'').replace(/\s+$/,'');
}
String.prototype.ltrim = strltrim;
String.prototype.rtrim = strrtrim;
String.prototype.trim  = strtrim;

// Manejo de Ventanas

function CloseWindow()
{
    close();
}

function OpenProcura( Page)
{

pop_up = window.open(Page,'','location=no,scrollbars=yes,resizable=no,height=5,width=5,top=0,left=0');

}

function OpenWindow( Page, Winheight, Winwidth )
{

var hauteur_popup = Winheight;
var H = (screen.availHeight - hauteur_popup) / 2;
var largeur_popup = Winwidth;
var L = (screen.availWidth - largeur_popup) / 2;

pop_up = window.open(Page,'','location=no,scrollbars=yes,resizable=no,height=' + hauteur_popup + ',width=' + largeur_popup + ',top=' + H + ',left=' + L);
pop_up.focus();

}

function OpenWindowEx( Page, Winheight, Winwidth, top, left )
{

var hauteur_popup = Winheight;
var H = top;
var largeur_popup = Winwidth;
var L = left;

pop_up = window.open(Page,'','location=no,scrollbars=yes,resizable=no,height=' + hauteur_popup + ',width=' + largeur_popup + ',top=' + H + ',left=' + L);
pop_up.focus();

}

function OpenWindowNotScroll( Page, Winheight, Winwidth )
{

var hauteur_popup = Winheight;
var H = (screen.availHeight - hauteur_popup) / 2;
var largeur_popup = Winwidth;
var L = (screen.availWidth - largeur_popup) / 2;

pop_up = window.open(Page,'','location=no,scrollbars=no,resizable=no,height=' + hauteur_popup + ',width=' + largeur_popup + ',top=' + H + ',left=' + L);
pop_up.focus();

}

// Voltamos uma pagina para atras
function Volver()
{
    history.go(-1);
}

