var lastClicked = ''

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages(a,b) {
	document.images[a].src = b
}

function preloadImages() 
{
	if (document.images) {		
		st_o = newImage("images/home_story_on.gif");
		hi_o = newImage("images/home_history_on.gif");
		re_o = newImage("images/home_research_on.gif");
		md_o = newImage("images/home_media_on.gif");
		mr_o = newImage("images/home_merchandise_on.gif");
		co_o = newImage("images/home_contact_on.gif");
	}
}

function preloadImages_content() 
{
	if (document.images) {		
		st_o = newImage("images/c_story_on.gif");
		hi_o = newImage("images/c_history_on.gif");
		re_o = newImage("images/c_research_on.gif");
		md_o = newImage("images/c_media_on.gif");
		mr_o = newImage("images/c_merchandise_on.gif");
		co_o = newImage("images/c_contact_on.gif");
	}
}



function changeOnMouseOver (item)
{
	changeImages (item, 'images/'+item+'_on.gif')
}

function changeOnMouseOut (item)
{
	if (item==lastClicked)
		;
	else
		changeImages (item, 'images/'+item+'_off.gif')
}

function changeOnMouseDown (item)
{
	changeImages (item, 'images/'+item+'_on.gif')
}

originalColorArray = new Array();

function changeBg(tr) {
	if (isTrMarked(tr)) return;
	var children = tr.childNodes;
	tmpArray = new Array();
	if (tr.children) {
		for (var i=0;i < children.length; i++) {
			tmpArray[i] = tr.children[i].bgColor;
			tr.children[i].bgColor='#e5e5e5';
		}
	}
	originalColorArray[tr.rowIndex] = tmpArray;
}

function resetBg(tr) {
	if (isTrMarked(tr)) return;
	tmpArray = originalColorArray[tr.rowIndex];
	var children = tr.childNodes;
	if (tr.children) {
		for (var i=0;i < children.length; i++) {
			tr.children[i].bgColor=tmpArray[i];
		}
	}	
}

function isTrMarked(tr) {
	
	if (tr.children && tr.children[0].bgColor=='#ffffff') {
		return true;
	}
	return false;
}

	function Is () {   
    var agt=navigator.userAgent.toLowerCase();

    // BROWSER
    this.major = parseInt(navigator.appVersion);
    this.nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
                && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
                && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
    this.nav4 = (this.nav && (this.major == 4));
    this.nav4up = (this.nav && (this.major >= 4));
    this.nav6 = (this.nav && (this.major == 5));
    this.nav6up = (this.nav && (this.major >= 5));

    this.ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
    this.ie3    = (this.ie && (this.major < 4));
    this.ie4    = (this.ie && (this.major == 4) && (agt.indexOf("msie 5")==-1) );
    this.ie4up  = (this.ie  && (this.major >= 4));
    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));
    this.ie5up  = (this.ie  && !this.ie3 && !this.ie4);
    this.ie5_5up =(this.ie && !this.ie3 && !this.ie4 && !this.ie5);

    // PLATFORM
    this.win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
    this.mac    = (agt.indexOf("mac")!=-1);
    this.linux = (agt.indexOf("inux")!=-1);
}
var is = new Is();

function preSubmit(form)
{
	if (form.list.options[form.list.selectedIndex].value!="")
	{
		form.action=form.list.options[form.list.selectedIndex].value; 
		form.submit();
	}
	form.list.selectedIndex = [0]; 
}