// Javascript General Purpose module

// Joe Mercy

// -------------------------------------------------------------

var browser     = '';
var version     = '';
var entrance    = '';
var cond        = '';
// BROWSER
if (browser == ''){
	if (navigator.appName.indexOf('Microsoft') != -1)
		browser = 'IE'
	else if (navigator.appName.indexOf('Netscape') != -1)
		browser = 'Netscape'
	else browser = 'NN';
}
// VERSION?
if (version == ''){
	version= navigator.appVersion;
	paren = version.indexOf('(');
	whole_version = navigator.appVersion.substring(0,paren-1);
	version = parseInt(whole_version);
}

// BROWSER & VERSION
if (browser == 'IE' && version >= 4) entrance = 'yes';
if (browser == 'IE' && version < 4) entrance = 'no';
if (browser == 'Netscape' && version >= 2.02) entrance = 'yes';
if (browser == 'Netscape' && version < 2.02) entrance = 'no';

function CheckBrowser() {
	return(entrance=='yes');
}

function lighten(imgName) {
	if (entrance == 'yes'){
	imgOn = eval(imgName + 'b.src');
	document[imgName].src = imgOn;
	}
}
function darken(imgName) {
	if (entrance == 'yes'){
	imgOff = eval(imgName + 'a.src');
	document[imgName].src = imgOff;
	}
}
// -------------------------------------------------------------

function GetMonth(intMonth){
    var MonthArray = new Array("January", "February", "March",
                               "April", "May", "June",
                               "July", "August", "September",
                               "October", "November", "December") 
    return MonthArray[intMonth] 	  	 
    }

function getDateStr(){
// returns the current date
// usage: document.write(getDateStr())

    var today = new Date()
    var year = today.getYear()
    if(year<1000) year+=1900
    var todayStr = GetMonth(today.getMonth()) + " " + today.getDate()
    todayStr += ", " + year
    todayStr += " AD"
    return todayStr
    }

// -------------------------------------------------------------
// scrolling text message

var Text = "mymessage";
var Speed =90;

var Count = 0;
var timerID = null;
var TimerRunning = false;

var i = 0;
while (i ++ < 140)
Text = " " + Text;

function Scroll(){
window.status = Text.substring(Count++, Text.length);
if (Count == Text.length)
Count = 0;
timerID = setTimeout("Scroll()", Speed);
TimerRunning = true;
}

function Start(){
Stop();
Scroll();
}

function Stop(){
if(TimerRunning)
clearTimeout(timerID);
TimerRunning = false;
}

// Escribe el pie de pagina
function WriteFooter(){
	document.write("<DIV ALIGN=CENTER>");
	document.write("<HR>");
	document.write("OpenColonization - Lambda Team<BR>");
	document.write("All logos and trademarks in this site are property of their respective owner. The comments are property of their posters<BR>");
	document.write("</DIV>");

	document.write("<DIV ALIGN=CENTER>");
	document.write("<table border=\"0\" frame=\"box\" cellpadding=\"0\" cellspacing=\"0\" width=\"550\" bordercolor=\"#FFFFFF\" height=\"65\">");
	document.write("<tr>");
	document.write("<td width=\"200\">");
	document.write("<A href=mailto:joe_mercy@users.sourceforge.net><img src=\"../imagenes/lt2.jpg\" border=\"0\"></A>");
	document.write("</td>");

	document.write("<td width=\"*\">");

	// document.write("<DIV ALIGN=CENTER>");
	// document.write("<A href=http://www.sourceforge.net>");
	// document.write("Powered by SourceForgeŽ");
	// document.write("</A><BR>");
	// document.write("<A href=mailto:joe_mercy@users.sourceforge.net>");
	// document.write("Contact Webmaster");
	// document.write("</A>");
	// document.write("</DIV>");

	document.write("</td>");

	document.write("<td width=\"200\">");
	document.write("<DIV align=\"center\">Powered by<BR><a href=\"http://sourceforge.net\"><img src=\"http://sourceforge.net/sflogo.php?group_id=116773&amp;type=4\" width=\"125\" height=\"37\" border=\"0\" alt=\"SourceForge.net Logo\" /></a></DIV>");
	document.write("</td>");
	document.write("</tr>");
	document.write("</table>");
	document.write("</DIV>");

}

// end