<!--  
//BROWSER DETECTION
var browser_name,browser_version,roll;
browser_name = navigator.appName;
browser_version = parseFloat(navigator.appVersion); 
if (browser_name == "Netscape" && browser_version < 2.0)
	roll = 'false';
else if (browser_name == "Netscape" && browser_version == 2.0)
	roll = 'false';
else if (browser_name == "Netscape" && browser_version >= 3.0)
	roll = 'true';
else if (browser_name == "Microsoft Internet Explorer" && browser_version <= 2.0)
	roll = 'false';
else if (browser_name == "Microsoft Internet Explorer" && browser_version >= 3.0)
	roll = 'true';
else if (browser_version >= 4.0) 
	roll = 'true';
else
	roll = 'false';
//*************************************************************************************
//IMAGE ROLLOVER FUCTIONS
function jsRollover(what,name){
	if (roll == 'true') {
		if (browser_name == "Netscape")
			document.images[what].src = name.src;
		else
			what.src = name.src;
	}	
}
function jsRollout(what,name){
	if (roll == 'true'){
		if (browser_name == "Netscape")
			document.images[what].src = name.src;
		else
			what.src = name.src;
		}	
}
//*************************************************************************************
//PRELOAD IMAGE FUNCTION
function jsPreloadImages(imgFiles) { 
  if (document.images) {
   var name;
    name = new Image;
     name.src = imgFiles;
    return name;
   }
}function jsGoback() {

	if (history.length == 1 && browser_name == 'Netscape'){
		parent.back();
	} 
	else {
		history.back();
	}
}
//*************************************************************************************
// FORM VALIDATION FUNCTIONS
//
// Purpose: Validate Text Box value.
// Inputs :
// sName  : name of the input
// sLabel : label to display, if label = "" then use sName instead
// iMin, iMax: Minimum & Maximum characters allowed respectively
//  bRequired : True/False, is required value?
// Return : Write the Text Box Validation script to the client browser
// ----------------------------------------------------------------
function jsTextValidation(sName, sLabel, iMin, iMax, bRequired)
{
	
	if (bRequired) 
	{
		if (sName.value == "")
		{
			alert("Please enter a value for the " + sLabel + " field.");
			sName.focus();
			return (false);
		}
	}
	if (sName.value != "")
	{
		if (sName.value.length < iMin)
		{
			 alert("Please enter at least " + iMin + " characters in the " + sLabel + " field.");
			sName.focus();
			return (false);
		}
		if (sName.value.length > iMax)
		{
			alert("Please enter at most " + iMax + " characters in the " + sLabel + " field.");
			sName.focus();
			return (false);
		}
	}
		
	return (true);
}
// ----------------------------------------------------------------
// Purpose: Validate Both Password field, usually used for new registration.
// Inputs :
// sPassword1 : name of the first password input box
// sPassword2 : name of the 2nd   password input box
// iMin, iMax: Minimum & Maximum characters allowed respectively
//  bRequired : True/False, is required value?
// usually, always TRUE

function jsPasswordValidation(sPassword1,sPassword2, iMin, iMax, bRequired)
{
	if ( ! jsTextValidation(sPassword1, "Password", iMin, iMax, bRequired))
	{
		return(false);
	}
	if ( ! jsTextValidation(sPassword2, "Verify Password", iMin, iMax, bRequired))
	{
		return(false);
	}
    if (sPassword1.value != sPassword2.value)
	{
		alert("Both Password fields must has the same value.");
		sPassword2.focus();
		return (false);
	}
	
	return (true);
}
// ----------------------------------------------------------------
//Purpose: Validate e-mail input, usually used for new registration.
// Inputs :
// sName  : name of the input, usually: "email"
//sLabel : label to display, if label = "" then use sName instead
// iMin, iMax: Minimum & Maximum characters allowed respectively
//  bRequired : True/False, is required value?
//  usually, always TRUE

function jsEmailValidation(sName, sLabel, iMin, iMax, bRequired)
{

	if ( ! jsTextValidation(sName, sLabel, iMin, iMax, bRequired))
	{
		return(false);
	}

	var emailStr=sName.value
	var emailPat=/^(.+)@(.+)$/
	var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
	var validChars="\[^\\s" + specialChars + "\]"
	var quotedUser="(\"[^\"]*\")"
	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
	var atom=validChars + '+'
	var word="(" + atom + "|" + quotedUser + ")"
	// The following pattern describes the structure of the user
	var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")

	/* Begin with the coarse pattern to simply break up user@domain into
	   different pieces that are easy to analyze. */
	var matchArray=emailStr.match(emailPat)
	if (matchArray==null) {
	  /* Too many/few @'s or something; basically, this address doesn't
	     even fit the general mould of a valid e-mail address. */
		alert("Email address seems incorrect (check @ and .'s)")
	    sName.focus();
		return false
	}
	var user=matchArray[1]
	var domain=matchArray[2]

	// See if "user" is valid 
	if (user.match(userPat)==null) {
	    // user is not valid
	    alert("Email username doesn't seem to be valid.")
	    sName.focus();
	    return false
	}

	/* if the e-mail address is at an IP address (as opposed to a symbolic
	   host name) make sure the IP address is valid. */
	var IPArray=domain.match(ipDomainPat)
	if (IPArray!=null) {
	    // this is an IP address
		  for (var i=1;i<=4;i++) {
		    if (IPArray[i]>255) {
		        alert("Email destination IP address is invalid!")
			    sName.focus();
				return false
		    }
	    }
	    return true
	}

	// Domain is symbolic name
	var domainArray=domain.match(domainPat)
	if (domainArray==null) {
		alert("Email domain name doesn't seem to be valid.")
	    sName.focus();
	    return false
	}

	/* domain name seems valid, but now make sure that it ends in a
	   three-letter word (like com, edu, gov) or a two-letter word,
	   representing country (uk, nl), and that there's a hostname preceding 
	   the domain or country. */

	/* Now we need to break up the domain to get a count of how many atoms
	   it consists of. */
	var atomPat=new RegExp(atom,"g")
	var domArr=domain.match(atomPat)
	var len=domArr.length
	if (domArr[domArr.length-1].length<2 || 
	    domArr[domArr.length-1].length>3) {
	   // the address must end in a two letter or three letter word.
	   alert("Email address must end in a three-letter domain, or two letter country.")
	   sName.focus();
	   return false
	}

	// Make sure there's a host name preceding the domain.
	if (len<2) {
	   var errStr="Email address is missing a hostname!"
	   alert(errStr)
	   sName.focus();
	   return false
	}

	// If we've gotten this far, everything's valid!
	return true;


}
 // ----------------------------------------------------------------
 function jsPhoneValidation(sName,sLabel,iMin,iMax,bRequired)
 {
	var checkOK = "0123456789-- \t\r\n\f";
	var checkStr = sName.value;
	var allValid = true;
	
	if ( ! jsTextValidation(sName, sLabel, iMin, iMax, bRequired))
	{
		return(false);
	}
	if ( sName.value != "" )
	{
	for (i = 0;  i < checkStr.length;  i++)
	{
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
	    if (ch == checkOK.charAt(j))
	      break;
		if (j == checkOK.length)
		{
		 allValid = false;
			break;
		}
	}
	if (!allValid)
	{
		alert("Please enter only digit, whitespace and \"-\" characters in the '" + sLabel + "' field.");
		sName.focus();
		return (false);
	}
  }
	return(true);
}
function jsCheckNumeric(sName,sLabel,iMin,iMax,bRequired)
{
var checkOK = "0123456789";
  var checkStr = sName.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  if ( ! jsTextValidation(sName, sLabel, iMin, iMax, bRequired))
	{
		return(false);
	}
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digit characters in the '" + sLabel + "' field.");
    iNumber.focus();
    return (false);
  }
  return(true);
 }
 function jsWhichButton(theForm,sButton,sButtonName) 
 {
  sButton.value=sButtonName;
  return theForm.submit();
   
}
var imagename;
var imageDir = "/images/global/";
var imageButtonDir = "/images/global/buttons/";
var imageHeaderDir = "/cit_template/images/headers/";
var citImageDir = "/cit_template/images/gifs/";

function over(imgsuffix, buttonimg, descimg, photoimg) {
	if(document.images)  {
		if(buttonimg !='') {document['but_' + imgsuffix].src = citImageDir + buttonimg + '.gif';}
		if(photoimg !='') {document['ph_' + imgsuffix].src = imageHeaderDir + 'header_photo_' + photoimg + '.gif';}
		if(descimg !='') {document['copy_text'].src = imageDir + descimg + '.gif';}
		window.status = 'Im working with ' + imgsuffix ;
	}
}
function out(imgsuffix, buttonimg, descimg, photoimg) {
	if(document.images)  {
		if(buttonimg !='') {document['but_' + imgsuffix].src = citImageDir + buttonimg + '.gif';}
		if(photoimg!='') {document['ph_' + imgsuffix].src = imageHeaderDir + 'header_photo_' + photoimg + '.gif';}
		if(descimg!='') {document['copy_text'].src = imageDir + descimg + '.gif';}
		window.status = '';
	}
}
function over2(imgsuffix, buttonimg) {
	if(document.images)  {
		if(buttonimg !='') {document['but_' + imgsuffix].src = imageButtonDir + buttonimg + '.gif';}
	}
}
function out2(imgsuffix, buttonimg) {
	if(document.images)  {
		if(buttonimg !='') {document['but_' + imgsuffix].src = imageButtonDir + buttonimg + '.gif';}
	}
}
function valid_select(frm) {
	//alert(frm.urlpage.length);
	for(i=0;i < frm.urlpage.length; i++) {
		if(frm.urlpage[i].checked) { return true }
	}
	return false;
}
function loadpage(s)  {
	var d = s.options[s.selectedIndex].value;
	if (d != '') {
		document.location.href = d;
	}
	return false;
}
 
var newwin;
function openWin(strURL) {
 var xx,yy,wfeatures;
 var newwin;
 
 xx=screen.availwidth-200;
 yy=screen.availheight-300;
 wfeatures='toolbar=yes,resizable=yes,scrollbars=yes,status=yes,menubar=yes,width='+xx+',height='+yy;
 newwin = window.open(strURL,"",wfeatures);

   
}

function searchCentral(){
 var newwin;
 var winparam='width=270,height=430,status=no,toolbar=no,scrollbars=no';
 if(top.window) {
   top.window.location.href='http://www.cit.com';
   newwin=top.window.open('http://www.cit.com/search/default.asp','SearchCentral',winparam);
   }else{
   window.location.href='http://www.cit.com';
   newwin=window.open('http://www.cit.com/search/default.asp','SearchCentral',winparam);
   }
}

// -->