
var agt=navigator.userAgent.toLowerCase();
var is_major = parseInt(navigator.appVersion);
var is_minor = parseFloat(navigator.appVersion);

this.ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
this.ie3    = (this.ie && (is_major < 4));
this.ie4    = (this.ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) );
this.ie5up  = (this.ie && !this.ie3 && !this.ie4);

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.nav6up = (this.nav && (is_major >= 5));

this.opera = (agt.indexOf("opera") != -1);

function expandMenu(menu)
{

	var div = "ccai" + menu;

	if (this.ie5up || this.opera || this.nav6up)		// hack for IE 4, problems displaying menus so don't do it
	{

		if (document.all)
		{
			document.all[div].style.visibility = "visible";
		}
		else if (document.layers)
		{
			document.layers[div].visibility = "show";
		}
		else if (document.getElementById)
		{
			document.getElementById(div).style.visibility = "visible";
		}
	}
}
	
function collapseMenu(menu)
{
	var div = "ccai" + menu;

	if (this.ie5up || this.opera || this.nav6up)     // hack for IE 4, problems displaying menus so don't do it
	{
	
		if (document.all)
		{
			document.all[div].style.visibility = "hidden";
		}
		else if (document.layers)
		{
			document.layers[div].visibility = "hide";
		}
		else if (document.getElementById)
		{
			document.getElementById(div).style.visibility = "hidden";
		}
	}
}

function popupWindow(url) {
 var f = window.open(
    url, 
    "f", 
    "toolbar=no, "+
    "location=no, "+
    "directories=no, "+ 
    "status=no, "+
    "menubar=no, "+
    "scrollbars=yes, "+ 
    "resizable=yes, "+
    "width=300, "+
    "height=200");
}

function register(url) {
 var f = window.open(
    url, 
    "f", 
    "toolbar=no, "+
    "location=no, "+
    "directories=no, "+ 
    "status=no, "+
    "menubar=no, "+
    "scrollbars=yes, "+ 
    "resizable=yes, "+
    "width=650, "+
    "height=500");
}

function popupWindow(url, width, height) {
 var w = window.open(
    url, 
    "w", 
    "toolbar=no, "+
    "location=no, "+
    "directories=no, "+ 
    "status=no, "+
    "menubar=no, "+
    "scrollbars=yes, "+ 
    "resizable=yes, "+
    "width="+width+", "+
    "height="+height);
}

function preloadImages() { //v3.0

  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function emailPage(url, mode) {
 var w = window.open(
    "forms/emailPage.asp?mode="+mode+"&ref="+url, 
    "w", 
    "toolbar=no, "+
    "location=no, "+
    "directories=no, "+ 
    "status=no, "+
    "menubar=no, "+
    "scrollbars=yes, "+ 
    "resizable=yes, "+
    "width=500, "+
    "height=450");
}

