var tickertapeform
tt_speed=200
tt_len=20
tt_space="                                                                                                    "
tt_tid = 0;
tt_message="."
tt_c= -tt_len;
function move() {
  cend=Math.min(tt_c+tt_len,tt_message.length)
  if (tt_c <0)
    cstart=0;
  else
    cstart=tt_c;
  if (tt_c < 0)
    tt_f.scroll.value=tt_space.substring(0,-tt_c) + tt_message.substring(cstart,cend)
  else
    tt_f.scroll.value=tt_message.substring(cstart,cend)
  tt_c = tt_c +1;
  if (tt_c == tt_message.length ) tt_c = -tt_len;
  tt_tid=window.setTimeout("move()",tt_speed);
}
function tt_start(x) {
  tt_f=x
  tt_tid=window.setTimeout("move()",tt_speed);
}
function tt_cleartid() {
  window.clearTimeout(tt_tid);
}
function ticker(m)
{
	tt_message=m
	tt_len=20
	tt_speed=200
	document.write('<FORM name=tickertapeform><input name=scroll size=20></FORM>');
	tt_start(document.tickertapeform);
}
function SwapButton(id, state)
{
	if(state == "on")
		eval("document." + id + "Button.src='./images/" + id + "ButtonOn.gif'");
	else if(state == "off")
		eval("document." + id + "Button.src='./images/" + id + "Button.gif'");
}
function DisableContextMenu(e){return false;}
document.oncontextmenu = DisableContextMenu;
		
function mySetHeight()
{
	cspbSetHeight( f_filterResults (
		window.innerHeight ? window.innerHeight : 0,
		document.documentElement ? document.documentElement.clientHeight : 0,
		document.body ? document.body.clientHeight : 0
	)-130);

}

function f_filterResults(n_win, n_docel, n_body) {
	var n_result = n_win ? n_win : 0;
	if (n_docel && (!n_result || (n_result > n_docel)))
		n_result = n_docel;
	return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}

function OpenHome() {
document.cookie = 'TemporaryTestCookie=yes; path=/';
setTimeout('TestIfCookieWasSet()',3000);
}


function TestIfCookieWasSet() {
var testcookie = '';
if(document.cookie.length > 0) {
	var cookiename = 'TemporaryTestCookie=';
	var cookiebegin = document.cookie.indexOf(cookiename);
	var cookieend = 0;
	if(cookiebegin > -1) {
		cookiebegin += cookiename.length;
		cookieend = document.cookie.indexOf(";",cookiebegin);
		if(cookieend < cookiebegin) { cookieend = document.cookie.length; }
		testcookie = document.cookie.substring(cookiebegin,cookieend);
		}
	}
 if(testcookie == 'yes') { 
	if(document.cookie.length > 0) {
		var cookiename = 'visited=';
		var cookiebegin = document.cookie.indexOf(cookiename);
		var cookieend = 0;
		if(cookiebegin > -1) {
			cookiebegin += cookiename.length;
			cookieend = document.cookie.indexOf(";",cookiebegin);
			if(cookieend < cookiebegin) { cookieend = document.cookie.length; }
			var beenbefore = document.cookie.substring(cookiebegin,cookieend);
		}
		if(beenbefore != 'yes') {
			var expdate = new Date(); 
			expdate.setTime(expdate.getTime() + 365*24*60*60*1000);
			document.cookie = 'visited=yes; expires=' + expdate.toGMTString();
			window.open('/home.asp')
		}
	}
 }
}

function LaunchCaption(ref, size)
{
	window.open(ref, "_blank", size);
}


