// convert all characters to lowercase to simplify testing
var agt=navigator.userAgent.toLowerCase();

// *** BROWSER VERSION ***
    // Note: On IE5, these return 4, so use is_ie5up to detect IE5.
    var is_major = parseInt(navigator.appVersion);
var is_minor = parseFloat(navigator.appVersion);

// Note: Opera and WebTV spoof Navigator.  We do strict client detection.
    // If you want to allow spoofing, take out the tests for opera and webtv.
    var is_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));
var is_nav2 = (is_nav && (is_major == 2));
var is_nav3 = (is_nav && (is_major == 3));
var is_nav4 = (is_nav && (is_major == 4));
var is_nav4up = (is_nav && (is_major >= 4));
var is_navonly      = (is_nav && ((agt.indexOf(";nav") != -1) ||
				  (agt.indexOf("; nav") != -1)) );
var is_nav6 = (is_nav && (is_major == 5));
var is_nav6up = (is_nav && (is_major >= 5));
var is_gecko = (agt.indexOf('gecko') != -1);


var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
var is_ie3    = (is_ie && (is_major < 4));
var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf("msie 5")==-1) && (agt.indexOf("msie 6")==-1) && (agt.indexOf("msie 7")==-1) && (agt.indexOf("msie 8")==-1));
var is_ie4up  = (is_ie  && (is_major >= 4));
var is_ie5    = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
var is_ie5_5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.5") !=-1));
var is_ie5up  = (is_ie  && !is_ie3 && !is_ie4);
var is_ie5_5up =(is_ie && !is_ie3 && !is_ie4 && !is_ie5);


// KNOWN BUG: On AOL4, returns false if IE3 is embedded browser
    // or if this is the first browser window opened.  Thus the
    // variables is_aol, is_aol3, and is_aol4 aren't 100% reliable.
    var is_aol   = (agt.indexOf("aol") != -1);
    var is_aol3  = (is_aol && is_ie3);
    var is_aol4  = (is_aol && is_ie4);

    var is_opera = (agt.indexOf("opera") != -1);
        var is_opera4 = (agt.indexOf("opera 4") != -1);
        var is_opera5 = (agt.indexOf("opera 5") != -1);
        var is_opera5up = (is_opera && (is_major >=4));

    var is_webtv = (agt.indexOf("webtv") != -1); 

        
    var is_TVNavigator = ((agt.indexOf("navio") != -1) || (agt.indexOf("navio_aoltv") != -1)); 
        var is_AOLTV = is_TVNavigator;

    var is_hotjava = (agt.indexOf("hotjava") != -1);
    var is_hotjava3 = (is_hotjava && (is_major == 3));
    var is_hotjava3up = (is_hotjava && (is_major >= 3));

    // set DOM flag
    if (is_nav6up || is_nav6 || is_gecko || is_ie5up) {
	is_dom = true;
     } else {
	is_dom = false;
     }

function set_layer_pos(layerid,x,y) {
    if (is_dom || is_ie4up) {
	layerid.style.pixelTop = y;
	layerid.style.pixelLeft=x;
    } else if (is_nav4up) {
	layerid.pixelTop = y;
	layerid.pixelLeft=x;
    }
}
function nav_on (id) {
	layerid=document.getElementById('navigationon');
	if (id==1) {
		xpos=197;
		ypos=174;
	} else if (id==2) {
		xpos=228;
		ypos=216;
	} else if (id==3) {
		xpos=261;
		ypos=258;
	} else if (id==4) {
		xpos=283;
		ypos=301;
	}
    if (is_dom || is_ie4up) {
		layerid.style.pixelLeft = xpos;
		layerid.style.pixelTop = ypos;
		layerid.style.visibility="visible";
    } else {
		layerid.moveTo(xpos,ypos);
		layerid.visibility="show";
    }
   	
}
function nav_off() {
		layerid=document.getElementById('navigationon');
		 if (is_dom || is_ie4up) {
			layerid.style.visibility="hidden";
   		 } else {
			layerid.visibility="hide";
   		 }
}
var timerID=new Array(0,0,0,0);
var x=new Array(0,0,0,0);
var pos=new Array(0,0,0,0);
var slidelayerid=new Array(0,0,0,0);
var increment=new Array(0,0,0,0);

function slide_layer_index0() {
slide_layer_to(0,0,0,0);
}
function slide_layer_index1() {
slide_layer_to(0,0,0,1);
}
function slide_layer_index2() {
slide_layer_to(0,0,0,2);
}
function slide_layer_index3() {
slide_layer_to(0,0,0,3);
}

function slide_layer_to(flayerid,fx,fpos,colour) {
if(timerID[colour]=='') {
x[colour]=fx;
pos[colour]=fpos;
slidelayerid[colour]=flayerid;
//increment[colour]=((fx-fpos)/(30*colour)+30);
//increment[colour]=((fx-fpos)/70 );
increment[colour]=10;
}
    if (pos[colour] >= x[colour])
	return false;
    if (pos[colour] < x[colour]-increment[colour]) {
	pos[colour]=pos[colour]+increment[colour];
    } else {
	pos[colour]=x[colour];
    }
    if (is_dom || is_ie4up) {
	slidelayerid[colour].style.pixelLeft = pos[colour];
    } else {
	slidelayerid[colour].moveTo(x[colour],slidelayerid[colour].pixelTop);
    }
    timerID[colour]=setTimeout("slide_layer_index"+colour+"()",10);
}
function pop_up_pics(url) {
	newWindow=window.open(url,'',"menubar,scrollbars,HEIGHT=400,WIDTH=500");
	newWindow.focus();
}

function pop_up_image_verification_help() {
	newWindow=window.open('/imageverificationhelp.html','',"menubar,scrollbars,HEIGHT=400,WIDTH=700");
	newWindow.focus();
}