//////////////////////////////////////////////////////////////////////
// Direitos Autorais sobre: startup01.js
//
// Este banco de funções é protegido pela lei de direitos autorais
// e marcas internacionais. A reprodução ou distribuição não autorizada,
// ou qualquer parte dele, resultará na imposição de rigorosas penas
// civis e criminais e os infratores serão objeto de ação judicial
// promovida na máxima extensão possível nos termos da lei.
//
// © Copyright 2002-2003, StartUp Informática Ltda.
// Todos os direitos reservados. (All rights reserved.)
//////////////////////////////////////////////////////////////////////

function getbodyheight()
{
	return document.body.clientHeight;
}

function setstatus(text)
{
	window.status=text
	return true
}

function clearstatus()
{
	return setstatus("")
}

function copyright(home)
{
	if(home)
		document.writeln("&copy; 2001-2012 Tradimpex Importa&ccedil;&atilde;o Exporta&ccedil;&atilde;o Ltda.<br>All rights reserved. Todos los derechos reservados.");
	else
		document.writeln("&copy; 2001-2012 Tradimpex Importa&ccedil;&atilde;o Exporta&ccedil;&atilde;o Ltda. All rights reserved. Todos los derechos reservados.");
}

function showlink(idLink, colorLink, underlineLink)
{
	var thisLink=eval("document.all."+idLink+".style")
	if(document.all)
	{
		thisLink.color=colorLink;
		if(underlineLink)
			thisLink.textDecoration="underline";
		else
			thisLink.textDecoration="none";
	}
}

function openpopup(url, width, height, scrollbars)
{
	var xMax, yMax, xOffset, yOffset
	if(document.all)
	{
		xMax=screen.width;
		yMax=screen.height;
	}
	else
	{
		if(document.layers)
		{
			xMax=window.outerWidth;
			yMax=window.outerHeight;
		}
		else
		{
			xMax=640;
			yMax=480;
		}
	}
	xOffset=(xMax - width)/2
	yOffset=(yMax - height)/2

//	window.open(url,"","width=363,height=290,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no")
	if(scrollbars)
		window.open(url,"","width="+width+",height="+height+",screenX="+xOffset+",screenY="+yOffset+",top="+yOffset+",left="+xOffset+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no");
	else
		window.open(url,"","width="+width+",height="+height+",screenX="+xOffset+",screenY="+yOffset+",top="+yOffset+",left="+xOffset+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no");
}

function ObjDataHora()
{
	var agora = new Date();
	this.dia = agora.getDate();
	this.mes = agora.getMonth();
	this.ano = agora.getFullYear();
	this.hor = agora.getHours();
	this.min = agora.getMinutes();
	this.sem = agora.getDay();
	this.pad = function(s, n){s='0000'+s;return(s.substring(s.length - n, s.length));
	
	}
	this.NomeSem = function() {
		var aDia = new Array( 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' );
		return aDia[this.sem];
	}
	this.NomeMes = function() {
		var aMes = new Array( 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'Dezember' );
		return aMes[this.mes];
	}
	this.MostraData = function() {
		document.write(this.NomeSem() + ', ' + this.NomeMes() + ' ' + this.dia + ', ' + this.pad(this.ano, 4)+'');
	}
	this.MostraHorario = function() {
		document.write(this.pad(this.hor, 2) + ':' + this.pad(this.min, 2) + ' h');
	}
	this.MostraSaudacao = function() {
		if(this.hor >= 0 && this.hor < 12)
			document.write('Bom dia');
		else if(this.hor >= 12 && this.hor < 18)
			document.write('Boa tarde');
		else if(this.hor >= 18)
			document.write('Boa noite');
	}
	return this;
}
var oDataHora = new ObjDataHora;

//////////////////////////////////////////////////////////////////////
// Height & Width Functions

var pageheight=screen.height;

function setpageheight(height)
{
	pageheight=height;
}

function getpageheight()
{
	return pageheight;
}

function getscreenheight()
{
	if(document.body.clientHeight < pageheight)
		return pageheight;
	return document.body.clientHeight;
}

