/*
 * "border.js" -- rotate speaker image borders
 *
 * with a 15 second timer:
 *   rotate border colors 8x at 0.1 second intervals
 */
var border_colors_left = new Array (
	"#c0b080 #8a4000 #975c20 #a58050",
	"#a58050 #c0b080 #8a4000 #975c20",
	"#975c20 #a58050 #c0b080 #8a4000",
	"#8a4000 #975c20 #a58050 #c0b080" )

var border_colors_right = new Array (
	"#c0b080 #a58050 #975c20 #8a4000",
	"#a58050 #975c20 #8a4000 #c0b080",
	"#975c20 #8a4000 #c0b080 #a58050",
	"#8a4000 #c0b080 #a58050 #975c20" )

var bcindex = 0
var restart_interval = 15000
var short_interval = 100
var bcmax = border_colors_left.length
var rotate_count = 0
var rotate_max = 8


function mod_border_colors()
{
	var funcstr

	if (++bcindex >= bcmax)
		bcindex = 0
	document.images.lspkr.style.borderColor = border_colors_left[bcindex]
	document.images.rspkr.style.borderColor = border_colors_right[bcindex]

	if (++rotate_count >= rotate_max) {
		funcstr = "restart_borders()"
		rotate_count = 0
	}
	else
		funcstr = "mod_border_colors()"
	window.setTimeout(funcstr, short_interval)
}


function restart_borders()
{
	var bcs = "black"
	document.images.lspkr.style.borderColor = bcs
	document.images.rspkr.style.borderColor = bcs
	window.setTimeout("mod_border_colors()", restart_interval)
}

window.setTimeout("mod_border_colors()", restart_interval)


/*
 * 
 */
function cinfo()
{
	var off, modstr, value, alt, sign = 1
	var one = "V78=+nun2\214.3=.)f-D/9vA\"F,p}3<9/0*l$40>2"
	var two = "J\36_+<*/5B0B*D17 >17:/mA*9ujBVN\214E><.`t9g"
	var str = one + two

	modstr = ""
	for (off = 0; off < str.length; off++) {
		sign *= -1
		alt = sign * ((off + 4) % 0xf)
		value = 0x9f + alt - str.charCodeAt(off)
		modstr += String.fromCharCode(value)
	}
	document.writeln("<span class=yr>" + modstr + "</span>")
}


/*
 *
 */
var allsize = 100
var spkw = 60
var spkh = 150

function resize(factor)
{
	allsize = Math.round(allsize * factor)
	document.body.style.fontSize = allsize + "%"

	spkw = Math.round(spkw * factor)
	spkh = Math.round(spkh * factor)
	lspkr.style.width  = rspkr.style.width  = spkw + "px";
	lspkr.style.height = rspkr.style.height = spkh + "px";
}

function larger()  { resize(1.1) }
function smaller() { resize(0.9) }

