/*
	site.js - Generic web site support for modernca

Updates:
01/25/07 - Change 70 to 75.
06/12/03 - Change text and link colors to make reading easier.
05/20/01 - Added welcomeLink and framedWelcomeLink.
05/10/01 - Creation.
*/


function moderncasite_openBODY(writerObject) {
	writerObject.writeln('<BODY bgcolor="#000000" text="#FFFFFF" vlink="#c0FFc0" link="#FFFFFF" alink="#c0FFc0" leftmargin="3" rightmargin="3">')
}


function moderncasite_writeH1H2(writerObject, H2String) {
	writerObject.writeln(
		'<CENTER><H1>' +
		' <FONT COLOR="00FFFF">Modern</FONT>' +
		' <FONT COLOR="FF00FF">Cellular</FONT>' +
		' <FONT COLOR="FFFF00">Automata</FONT>' +
		'</H1></CENTER>')
	if (H2String != null) {
		writerObject.writeln('<CENTER><H2>' + H2String + '</H2></CENTER>')
	}
}

function moderncasite_setupSignatureCa(ca)
{
//	ca.rule = '50 * 235/45 + 25 * 23456/, 4'
	ca.rule = '12 * 235/45 + 1 * 23456/, 4'
	ca.resetGeneration = '300-500'
	ca.maximumRate = '10-20'
}

function moderncasite_getFramedBackLink()
{
	if (window.parent.history.length == 0) {
		return ''
	}

	if (navigator.appName.indexOf('Microsoft') < 0) {
		return 'Back'.link('javascript: window.parent.history.go(-1)')
	}
	else {
		return 'Back'.link('javascript: window.parent.history.go(-1)')
	}
}

function moderncasite_getNavigationLinks()
// Provides a link to the entrance and a back link
{
	var result = 'Modern CA Entrance'.link('./welcome.html')
	result += ' / ' + 'Map'.link('./map.html')
	var backlink = history.length == 0 ? '' : 'Back'.link('javascript: window.history.go(-1)')
	if (backlink.length) {
		result += ' / ' + backlink
	}
	return result
}

function moderncasite_getFramedNavigationLinks()
// For a framed window, provides a link to the entrance and a back link
{
	var result = '<A HREF="./welcome.html" TARGET="_parent">Modern CA Entrance</A>'
	result += ' / <A HREF="./map.html" TARGET="_parent">Map</A>'
	var backlink = moderncasite_getFramedBackLink()
	if (backlink.length) {
		result += ' / ' + backlink
	}
	return result
}

function Site() {
// public:
	this.openBODY = moderncasite_openBODY
	this.writeH1H2 = moderncasite_writeH1H2
	this.setupSignatureCa = moderncasite_setupSignatureCa
	this.getNavigationLinks = moderncasite_getNavigationLinks
	this.getFramedNavigationLinks = moderncasite_getFramedNavigationLinks
}

var site = new Site()


var kRate = 'Rate'
var kZoom = 'Zoom'
var zooms = new Array(1, 2, 3, 4, 5, 6, 7, 8)
var rates = new Array('fast', 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 15, 20, 30, 40, 50, 60, 75, 100)

