// Modified version of the ultimate client sniff by these guys:
// http://webreference.com/tools/browser/javascript.html
var agt=navigator.userAgent.toLowerCase();
var appVer = navigator.appVersion.toLowerCase();
var is_minor = parseFloat(appVer);
var is_major = parseInt(is_minor);
var iePos  = appVer.indexOf('msie');
if (iePos !=-1) {
 is_minor = parseFloat(appVer.substring(iePos+5,appVer.indexOf(';',iePos)))
 is_major = parseInt(is_minor);
}
var is_win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
var is_mac    = (agt.indexOf("mac")!=-1);
var is_ie   = (iePos!=-1);
var is_ie4   = (is_ie && is_major == 4);
var is_ie4up = (is_ie && is_minor >= 4);
var is_ie5   = (is_ie && is_major == 5);
var is_ie5up = (is_ie && is_minor >= 5);
var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
 && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
 && (agt.indexOf('webtv')==-1));
var is_nav4up = (is_nav && (is_major >= 4));
// http://www.moock.org/webdesign/flash/detection/moockfpi/
var flash5Installed = false;
var showFlash = false;
if(is_ie && is_win){
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('showFlash = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
	document.write('</SCR' + 'IPT\> \n'); // break up end tag so it doesn't end our script
}

function placeFocus() {
if (document.forms.length > 0) {
var field = document.forms[0];
var i;
for (i = 0; i < field.length; i++) {
if ((field.elements[i].type == "text") || (field.elements[i].type == "textarea") || (field.elements[i].type.toString().charAt(0) == "s")) {
document.forms[0].elements[i].focus();
break;
         }
      }
   }
}

/* Open small window */
function openWin(winUrl)	{
	argc = arguments.length;
	h = (argc > 1) ? arguments[1] : 350;
	w = (argc > 2) ? arguments[2] : 400;
	returnVal = (argc > 3) ? arguments[3] : 1;
	scrollbars = (argc > 4) ? arguments[4] : 1;
	if (is_major >= 4)
	{
		x = 100;
		y = 80;
		window.open(winUrl, 'mmnew', 'height='+h+',width='+w+',scrollbars='+scrollbars+',resizable=0,menubar=0,toolbar0,status=0,location=0,directories=0,left=' + x + ',top=' + y + '');
		if(returnVal) {
			return false;
		}
	}
	else
	{
		window.open(winUrl, 'mmnew', 'height='+h+',width='+w+',scrollbars='+scrollbars+',resizable=0,menubar=0,toolbar=0,status=0,location=0,directories=0,left=150,top=80');
		sym.focus;
		if(returnVal) {
			return false;
		}
	}
}

// email hider /////////////////////////////////////////////////////
function MailCustSvc() {
    var name = "customerservice";
    var host = "momoney";
				var ext = ".info";
    var delim = "\@";
    var href = "mailto:";
    var text = "\<a href='" + href + name + delim + host + ext + "'>" + name + delim + host + br + ext + "</a>";
document.write(text);
}

// For autoTab feature of form navigation //////////////////////////
function autoTab( input,len, e ) { 
	var keyCode	= ( isNN ) ? e.which : e.keyCode; 
	var filter	= ( isNN ) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46]; 
	if( input.value.length >= len && !containsElement( filter, keyCode )) { 
	input.value = input.value.slice( 0, len ); 
	input.form[( getIndex( input ) + 1 ) % input.form.length].focus(); 
	} 
	return true; 
} 
 
function containsElement( arr, ele ) { 
	var found = false, index = 0; 
	while( !found && index < arr.length ) 
	if( arr[index] == ele ) { 
		found = true; 
	} else { 
		index++; 
	} 
	return found; 
} 
 
function getIndex( input ) { 
	var index = -1, i = 0, found = false; 
	while ( i < input.form.length && index == -1 ) 
	if ( input.form[i] == input ) { 
		index = i; 
	} else { 
		i++; 
	} 
	return index; 
} 
// End autoTab scripts /////////////////////////////////////////////
 
	
