/*var $j=jQuery.noConflict();
var message = "Please be advised that you are leaving The Farmers and Merchants State Bank's website. This link is provided as a courtesy. The Farmers and Merchants State Bank does not endorse or control the content of third party websites.";
var url = window.location.pathname;

$j(document).ready(function(){
	var slideSpeed = 500;
	
	if( $j('a.warn').length > 0 ){
		$j('a.warn').click( function(){
			alert( message );
		});
	}
	
	if( $j('a.confirm').length > 0 ){
		$j('a.confirm').click( function( event ){
			event = new Event(event);
			if( confirm(message) ) {
				return true;
			} else {
				event.stop();
				return false;
			}
		});
	}
	
	$j("a.confirm").attr("target", "_blank"); 
	 
	$j("#quickLinksDownstream a").tooltip( {
		showURL: false
		}
	);

	$j("#featuredProduct, #secondaryProducts ul li, #secondaryPages ul li").click(function(){
		window.location=$j(this).find("a").attr("href");
	});
	
	if ($j.browser.msie && !($j.browser.version.substr(0,1) < 7) || !($j.browser.msie)){
  $j('#primaryNav h2 a').blend();
	}
	
	if ($j.browser.msie && !($j.browser.version.substr(0,1) < 8) || !($j.browser.msie)){
  $j('#primaryNav .nthTier-2 li.inPath h3 a.inPath').css({backgroundPosition: 'right -74px'});
	}

	// select skin
	if ($j.browser.msie && !($j.browser.version.substr(0,1)) || !($j.browser.msie)){
	 $j("#Destination").select_skin();
	}
	
	// select styling for certain pages
	$j('#aboutUs.individualPage p:last, #corpGov.individualPage p:last, #fmStock.individualPage p:last').css({borderBottom: '1px solid #E5E5E5', margin: '0 0 1.4em 0', padding: '0 1em 1.4em 1em'});
	
	$j('#financialCalculators.individualPage').parent().css({minHeight : '30.5em'});

	$j('#reportLostStolen.individualPage p.textVariant1:last').css({paddingBottom: '0'});
	
	$j('#sendToFriend').parent().parent().css({minHeight : '430px'});

	$j("#obNav li:lt(3)").css({display: "list-item"});

	$j("ul#obNav li.nthChild-2").hide();
	$j("ul#obNav li.nthChild-4").hide();
	$j('#Logon input[name="loginTo"]').change(function() {
		if ($j(this).val() == 'Personal') {
			$j('form#Logon').attr('action','https://web6.secureinternetbank.com/pbi_pbi1961/pbi1961.asp?Rt=041207341&LogOnBy=connect3&PRMACCESS=Account');
			$j('form#Logon label[for="nmUID"]').attr('for','AccessID');
			$j('form#Logon input#nmUID').attr('name','AccessID').attr('id','AccessID');
			$j("ul#obNav li.nthChild-2").hide("slow");
			$j("ul#obNav li.nthChild-4").hide("slow");
			$j("ul#obNav li.nthChild-3").show("slow");
		} else {
			$j('form#Logon').attr('action','https://web6.secureinternetbank.com/ebc_ebc1961/ebc1961.asp?wci=process&wce=request&rid=3000&rtn=041207341&rt=041207341&mfa=2');
			$j('form#Logon label[for="AccessID"]').attr('for','nmUID');
			$j('form#Logon input#AccessID').attr('name','nmUID').attr('id','nmUID');
			$j("ul#obNav li.nthChild-3").hide("slow");
			$j("ul#obNav li.nthChild-2").show("slow");
			$j("ul#obNav li.nthChild-4").show("slow");
		}
	});

});

Cufon.set("selector", jQuery);
Cufon.replace("#kasasa #featuredProductSummary h1");*/

var $j=jQuery.noConflict();
var message = "Please be advised that you are leaving The Farmers and Merchants State Bank's website. This link is provided as a courtesy. The Farmers and Merchants State Bank does not endorse or control the content of third party websites.";
var url = window.location.pathname;

$j(document).ready(function(){
	var slideSpeed = 500;
	
	if( $j('a.warn').length > 0 ){
		$j('a.warn').click( function(){
			alert( message );
		});
	}
	
	if( $j('a.confirm').length > 0 ){
		$j('a.confirm').click( function( event ){
			event = new Event(event);
			if( confirm(message) ) {
				return true;
			} else {
				event.stop();
				return false;
			}
		});
	}
	
	$j("a.confirm").attr("target", "_blank"); 
	 
	$j("#quickLinksDownstream a").tooltip( {
		showURL: false
		}
	);

	$j("#featuredProduct, #secondaryProducts ul li, #secondaryPages ul li").click(function(){
		window.location=$j(this).find("a").attr("href");
	});
	
	/*if ($j.browser.msie && !($j.browser.version.substr(0,1) < 7) || !($j.browser.msie)){
  $j('#primaryNav h2 a').blend();
	}*/
	
	if ($j.browser.msie && !($j.browser.version.substr(0,1) < 8) || !($j.browser.msie)){
  $j('#primaryNav .nthTier-2 li.inPath h3 a.inPath').css({backgroundPosition: 'right -74px'});
	}
	
	
	// select skin
/*	if ($j.browser.msie && !($j.browser.version.substr(0,1)) || !($j.browser.msie)){
	 $j("#Destination").select_skin();
	}*/
	
	// select styling for certain pages
	$j('#aboutUs.individualPage p:last, #corpGov.individualPage p:last, #fmStock.individualPage p:last').css({borderBottom: '1px solid #E5E5E5', margin: '0 0 1.4em 0', padding: '0 1em 1.4em 1em'});
	
	$j('#financialCalculators.individualPage').parent().css({minHeight : '30.5em'});

	$j('#reportLostStolen.individualPage p.textVariant1:last').css({paddingBottom: '0'});
	
	$j('#sendToFriend').parent().parent().css({minHeight : '430px'});
	
	
	$j("#obNav li:lt(3)").css({display: "list-item"});
	
	/* Start old online banking login form */
if ((url.indexOf("home.html") == -1 )) {
		$j("form#businessLoginForm, #obNav li:gt(2)").css({display: "none"});
		// personal and business show and hide
		$j("#loginToPersonal").click(function(){
			$j("form#personalLoginForm").show("slow");
			$j("#obNav li:lt(3)").css({display: "list-item"});
			$j("#obNav li:gt(2)").css({display: "none"});
			$j("form#businessLoginForm").hide("slow"); 
			$j("#personalLoginForm #personalUserName").attr("value", $j("#businessLoginForm #personalUserName").attr("value"));
			}
		);
		
		$j("#loginToBusiness").click(function(){
			$j("form#businessLoginForm").show("slow"); 
			$j("#obNav li:gt(2)").css({display: "list-item"});
			$j("#obNav li:lt(3)").css({display: "none"});
			$j("form#personalLoginForm").hide("slow");
			$j("#businessLoginForm #personalUserName").attr("value", $j("#personalLoginForm #personalUserName").attr("value"));
			}
		);
	};
	/* End old online banking login form */

});

Cufon.set("selector", jQuery);
Cufon.replace("#kasasa #featuredProductSummary h1");