//<!--
function browsercheck () {
var agt			= navigator.userAgent.toLowerCase();
this.major		= parseInt(navigator.appVersion);
this.minor		= parseFloat(navigator.appVersion);
this.ns			= ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1) && (agt.indexOf('hotjava')==-1));
this.ns4		= (this.ns && (this.major == 4));
this.ns6		= (this.ns && (this.major == 5));
this.ie			= ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
this.ie4		= (this.ie && (this.major == 4) && (agt.indexOf("msie 5")==-1) );
this.ie5		= (this.ie && (this.major == 4) && (agt.indexOf("msie 5.0")!=-1));
this.ie5_5		= (this.ie && (this.major == 4) && (agt.indexOf("msie 5.5") !=-1));
// *** PLATFORM ***
this.win		= ((agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1));
this.win95		= ((agt.indexOf("win95")!=-1) || (agt.indexOf("windows 95")!=-1));
this.win98		= ((agt.indexOf("win98")!=-1) || (agt.indexOf("windows 98")!=-1));
this.mac		= (agt.indexOf("mac")!=-1);
}
var is	= new browsercheck();

function preloadImage (src) {
	var img = new Image();
	img.src = src;
	return img;
}
function rollImg (name, state) { document.images[name].src = eval(name+'_'+state).src; }

function rollDivImg (div,img,state) {
	if (is.ns4) eval(docObj + div + 'Div' + innerObj + img +'.src='+ img +'_'+ state +'.src');
	else eval(docObj + img + q + '.src='+ img +'_'+ state +'.src');
}

function dimImg (name, dim, meas) {
	eval ("document.images['"+name+"Img']."+dim+"="+meas);
}

var docObj		= (is.ns4)? 'document.' : 'document.getElementById("';
var styleObj	= (is.ns4)? '' : '").style';
var divWidth	= (is.ns4)? '.clip.width' : '.offsetWidth';
var divHeight	= (is.ns4)? '.clip.height' : '.offsetHeight';
/*
var divWidth	= (is.ns4)? '.clip.width' : '.clientWidth';
var divHeight	= (is.ns4)? '.clip.height' : '.clientHeight';
var divWidth	= (is.ns4)? '.clip.width' : '.style.pixelWidth';
var divHeight	= (is.ns4)? '.clip.height' : '.style.pixelHeight';
*/
var divLeftR	= (is.ns4)? '.left' : '.offsetLeft';
var divTopR		= (is.ns4)? '.top' : '.offsetTop';
var divLeft		= (is.ns4)? '.left' : '.left';
var divTop		= (is.ns4)? '.top' : '.top';

var imgX		= (is.ns4)? '.x' : '.offsetLeft';
var imgY		= (is.ns4)? '.y' : '.offsetTop';

var	q			= (is.ns4)? '' : '")';
var innerObj	= (is.ns4)? '.document.' : '").';
var visible		= (is.ns4)? '"show"' : 'visible';
var hidden		= (is.ns4)? '"hide"' : 'hidden';
var setVis		= '.visibility=';

var	windowWidth	= (is.ns)? 'self.innerWidth' : 'document.body.clientWidth';
var	windowHeight= (is.ns)? 'self.innerHeight' : 'document.body.clientHeight';

/*
var	windowW2	= (is.ns)? eval('self.innerWidth') : eval('document.body.clientWidth');
var	windowH2	= (is.ns)? eval('self.innerHeight') : eval('document.body.clientHeight');
*/

function reload() {	if(is.ns4)location.reload();	}

function getViz (div,parent) {
	if (parent==null) parent='';
	vizzy = eval(docObj+parent+div+'Div'+styleObj+'.visibility');
	if (vizzy==eval(visible)) return true;
	else return false;
}

function toggleViz (div) {
	if (getViz(div)) hideDiv(div);
	else showDiv(div);
}

function showDiv (div,parent) {
	if (parent==null) parent='';
	if (is.ns4)	eval (docObj+parent+div+'Div'+styleObj+setVis+visible);
	else		eval (docObj+div+'Div'+styleObj+setVis+visible);
}
function hideDiv (div, parent, yap) {
	if (parent==null) parent='';
	if (is.ns4)	eval (docObj+parent+div+'Div'+styleObj+setVis+hidden);
	else {
		if (yap) alert (docObj+div+'Div'+styleObj+setVis+hidden);
		else eval (docObj+div+'Div'+styleObj+setVis+hidden);
	}
}

function getDivLeft (div,parent) {
	if (parent==null) parent='';
	if (is.ns4)	return eval(docObj + parent + div + 'Div' + q + divLeftR);
	else		return eval(docObj + div + 'Div' + q + divLeftR);
}

/* */

function getDivTop (div,parent) {
	if (parent==null) parent='';
//	alert ('getting div top');
//	alert(docObj + div + 'Div' + q + divTopR);
	if (is.ns4)	return eval(docObj + parent + div + 'Div' + q + divTopR);
	else		return eval(docObj + div + 'Div' + q + divTopR);
}

function getDivWidth (div,parent) {
	if (parent==null) parent='';
	if (is.ns4)	return parseInt(eval(docObj + parent + div + 'Div' + q + divWidth));
	else		return parseInt(eval(docObj + div + 'Div' + q + divWidth));
}
function getDivHeight (div,parent) {
	if (parent==null) parent='';
	if (is.ns4)	return parseInt(eval(docObj + parent + div + 'Div' + q + divHeight));
	else		return parseInt(eval(docObj + div + 'Div' + q + divHeight));
}

function moveDivLeftTo (div,pos,parent) {
	if (parent==null) parent='';
	if (is.ns4)	eval (docObj+parent+div+'Div'+styleObj+divLeft+'='+pos);
	else		eval (docObj+div+'Div'+styleObj+divLeft+'='+pos);
}
function moveDivTopTo (div,pos,parent) {
//	alert ('moveDivTopTo: '+div)
	if (parent==null) parent='';
	if (is.ns4)	eval (docObj+parent+div+'Div'+styleObj+divTop+'='+pos);
	else		eval (docObj+div+'Div'+styleObj+divTop+'='+pos);
}

function moveDivLeftBy (div,dis,parent) {
	if (parent==null) parent='';
	if (is.ns4)	moveDivLeftTo(div, getDivLeft(div,parent)+dis, parent);
	else		moveDivLeftTo(div, getDivLeft(div)+dis);
}
function moveDivTopBy (div,dis,parent) {
	if (parent==null) parent='';
	if (is.ns4)	moveDivTopTo(div, getDivTop(div,parent)+dis, parent);
	else		moveDivTopTo(div, getDivTop(div)+dis);
}

/* */

function moveDiv (div,x,y,parent) {
	if (parent==null) parent='';
//	alert('crazy steven')
	if (is.ns4)	{ moveDivLeftTo(div,x,parent); moveDivTopTo(div,y,parent); showDiv(div,parent); }
	else		{ moveDivLeftTo(div,x); moveDivTopTo(div,y); showDiv(div); }
}

function doBlurb (id) {
	moveDivLeftTo ('blurb'+id, mouseX);
	moveDivTopTo ('blurb'+id, mouseY);
	showDiv('blurb'+id);
}

function popWin(url,w,h) {
	poppedWin = window.open(url,'newWindow','scrollbars=no,width='+w+',height='+h);
	poppedWin.focus();
}

function popScroll(url,w,h) {
	poppedWin = window.open(url,'newWindow','scrollbars=yes,width='+w+',height='+h);
	poppedWin.focus();
}

function fieldFocus(field) {	eval (docObjForm+field+'.focus()');	}

function resort (array) {
	n = array.length;

	for(i=0; i<n; i++) {
		x = Math.floor(Math.random()*n);
		y = Math.floor(Math.random()*n);
		temp = array[x];
		array[x] = array[y];
		array[y] = temp;
	}
}

function clearDivs() {
	divArray = document.getElementsByTagName('div');
	for (i=0; i<divArray.length; i++) eval (docObj+divArray[i].id+styleObj+setVis+hidden);
}

function dumdum() {
	alert ('hey! i am not a dummy!');
}

function timer (funktion, ms) {
//	alert (funktion);
	timeOutId = setTimeout(funktion, ms);
}

/************************************************	CONTENT SLIDE	****/
var slide = ''
var max = 0
var min = -340
var content_window_h = 360

function scrollContent (dir) {
	id = hot_id
//	alert(id)
	
	if (dir<0)	doit = (getDivTop('content'+id) > -(getDivHeight('content'+id)+min))? true : false
	else		doit = (getDivTop('content'+id) < max)? true : false
	
	if (doit) {
		moveDivTopBy('content'+id,dir)
		slide = setTimeout("scrollContent("+dir+")",1)

	} else {
		clearTimeout(slide)
		tizop = getDivTop('content'+id)
		if (tizop>max) moveDivTopTo('content'+id,max)
//		else if (tizop<min) moveDivTopTo('content'+id,min)
	}
}

function negSlide() {
	clearTimeout(slide)
}

function display_content(id) {
	hot_id = id
//	alert('id: '+id+'\nhot_id: '+hot_id)

	for (i=0; i<contents.length; i++) hideDiv('content'+contents[i])
	hideDiv('scrollUp')
	hideDiv('scrollDown')

	moveDivTopTo('content'+id,max)
	showDiv('content'+id)

	if (getDivHeight('content'+id) > content_window_h) {
		showDiv('scrollUp')
		showDiv('scrollDown')
	}
}

/***********************************************************************/

function reloadPage() {
	location.href='<?=$PHP_SELF?>'
}

var offLinks = 1;
function rollOffLinks() { offLinks = setTimeout("hideDiv('links')",1000) }
function rollOnLinks() { clearTimeout(offLinks) }

/***************************** DYNduo **********************************/
// CSS Function
// returns CSS syntax for generated layers
// 19990326

// Copyright (C) 1999 Dan Steinman
// Distributed under the terms of the GNU Library General Public License
// Available at http://www.dansteinman.com/dynapi/

function css(id,pos,left,top,width,height,color,vis,z,other) {
	if (id=="START") return '<STYLE TYPE="text/css">\n'
	else if (id=="END") return '</STYLE>'
	var str = '#'+id+'Div '
	str += (pos=='abs')? '{position:absolute; ' : '{position:relative; '
	str += (left!=null && top!=null)? 'left:'+left+'px; top:'+top+'px;' : ''

	if (arguments.length>=5 && width!=null) str += ' width:'+width+'px;'
	if (arguments.length>=6 && height!=null) {
		str += ' height:'+height+'px;'
		if (arguments.length<10 || other.indexOf('clip')==-1) str += ' clip:rect(0px '+width+'px '+height+'px 0px);'
	}
//	if (arguments.length>=7 && color!=null) str += (color)? ' background-color:'+color+';' : ''
	if (arguments.length>=7 && color!=null && color!=0) str += (document.layers)? ' layer-background-color:'+color+';' : ' background-color:'+color+';'

	if (arguments.length>=8 && vis!=null) str += (vis)? ' visibility:'+eval(visible)+';' : ' visibility:'+eval(hidden)+';'
	if (arguments.length>=9 && z!=null) str += ' z-index:'+z+';'
	if (arguments.length==10 && other!=null) str += ' '+other
	str += '}\n'
	return str
}
function writeCSS(str,showAlert) {
	str = css('START')+str+css('END')
	document.write(str)
	if (showAlert) alert(str)
}

// use below

/***************************** DYNduo **********************************/

//-->
