function MM_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=MM_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];}}

}


MM_preloadImages('/images/common/drop-down-bg-over-bot.gif','/images/common/drop-down-bg-bot.gif','/images/common/drop-down-bg-over-top.gif','/images/common/drop-down-bg-top.gif','/images/solutions/banks-over.gif','/images/solutions/credit-unions-over.gif','/images/solutions/card-services-over.gif','/images/solutions/payments-over.gif','/images/secondary-navigation/link-last-on-bg.gif','/images/secondary-navigation/link-on-bg.gif');

/* Begin code segment for the rotating partner quotes on the Become A Partner page. */
var randomQuote=new Array() 

randomQuote[0] = '<dt><img src="\/images\/partners\/diebold.gif" alt="Diebold" \/><\/dt><dd class="selfClear"><q>"Today\'s banking customers appreciate having options that allow them to conduct their business, anywhere, at any time. Diebold\'s mobile banking technology literally places these options at their fingertips, which goes a long way in enhancing customer satisfaction and, ultimately, in strengthening relationships."<\/q><cite>Charles E. Ducey, Jr.,<br \/>Senior Vice President, Global Development and Services<\/cite><\/dd>';
randomQuote[1] = '<dt><img src="\/images\/partners\/wausau.gif" alt="WAUSAU" \/><\/dt><dd class="selfClear"><q>"ClairMail has developed the most innovative yet simple and user-friendly solutions in mobile payments, including GreenPayments. By partnering with ClairMail, WAUSAU is further enhancing value for our customers by offering an easily-integrated mobile solution to our industry-leading suite of remittance products."<\/q><cite>Kathy Strasser<br \/>Senior Vice President &ndash; Remittance and Enterprise Content Management Solutions<\/cite><\/dd>';
randomQuote[2] = '<dt><img src="\/images\/partners\/verisign.gif" alt="VeriSign, Inc." \/><\/dt><dd class="selfClear"><q>"We chose to work with ClairMail because their approach met VeriSign\'s stringent requirements for scalability, reliability and security. Together, we can enable financial institutions to develop cost-saving efficiencies, while helping them build loyal, lasting relationships with their customers."<\/q><cite>Brian Matthews<br \/>Vice President, Enterprise Solutions<\/cite><\/dd>';
randomQuote[3] = '<dt><img src="\/images\/partners\/telus.gif" alt="TELUS" \/><\/dt><dd class="selfClear"><q>"When deciding among providers of mobile banking and payment solutions, we chose ClairMail because their approach is unique in its ability to enable competitive differentiation, create efficiencies, and enhanced client satisfaction for our enterprise customers."<\/q><cite>Luc Vilandr&eacute;<br \/>Vice President, TELUS National Application Solutions<\/cite><\/dd>';
randomQuote[4] = '<dt><img src="\/images\/partners\/visa.gif" alt="VISA" \/><\/dt><dd class="selfClear"><q>"Integrating Visa mobile services into ClairMail\'s platform will help consumers to better manage their Visa accounts and has the potential to speed the deployment of these services for Visa issuers."<\/q><cite>Tim Attinger<br /> Head of Product Innovation<\/cite><\/dd>';
randomQuote[5] = '<dt><img src="\/images\/partners\/misys.gif" alt="MISYS" \/><\/dt><dd class="selfClear"><q>"Our partnership with ClairMail significantly enhances our existing mobile solution and provides our bank customers with comprehensive mobile banking and payment functionality, while also providing a new channel for marketing and revenue opportunities."<\/q><cite>Olivier Berthier<br /> Solutions Director, Transaction Banking<\/cite><\/dd>';
randomQuote[6] = '<dt><img src="\/images\/partners\/cashedge.gif" alt="CashEdge" \/><\/dt><dd class="selfClear"><q>"With the increasing adoption of smarter mobile devices, consumers are looking at the mobile channel to move money and take more control of their finances through richer engagement with their financial institution. By teaming with ClairMail, we are able to broaden the scope of our reach and increase usage of Popmoney by integrating across its deep customer network."<\/q><cite>Neil Platt<br /> Senior Vice President and General Manager, US Banking<\/cite><\/dd>';

var R = randomQuote.length;
var whichRandomQuote=Math.round(Math.random()*(R-1));
function showRandomQuote(){document.write(randomQuote[whichRandomQuote]);}
/* End code segment for the rotating partner quotes on the Become A Partner page. */

/* begin - Navigation Primary */
var NavigationPrimary = {
  init: function() {    
		var c = this;
		var n = $('#NavigationPrimary');
		
		// Use bgiframe to fix dropdowns over selects if it's available.
		$.fn.bgiframe && $('li', n).bgiframe();

		// Mark parent elements so that we can style them with CSS
		$('> li', n).each(function() { c.markParents(this); });
  	
  	// Use the hoverintent plugin if it's available
  	// if ($.fn.hoverIntent)
  	//     {
  	//   $('li', n).hoverIntent( {
  	//     sensitivity: 1,
  	//     over: this.mouseenter,
  	//     out: this.mouseleave,
  	//     timeout: 100
  	//   });
  	//     }
  	// else
  	  $('li', n).hover(this.mouseenter, this.mouseleave);
  },
  markParents: function(li) {
    var c = this;
    if ($('> ul', li).size() > 0)
	    $(li).addClass('parent').find('> a').addClass('parent').end().find('> ul li').each( function() { c.markParents(this); });
	},
	mouseenter: function() { $(this).addClass('over').children('a').addClass('over'); },
	mouseleave: function() { $(this).removeClass('over').children('a').removeClass('over'); }
	
};
$(function() { NavigationPrimary.init(); });
/* end - Primary Navigation */

$(document).ready(function() {
	$('ul.careers > li > a').click(
		function(event) {
			$jobID = $(this).attr('href');
			// Hide all jobs
			$('.jobDescription').css('display','none');
			// Display the job that was clicked
			$($jobID).css('display','block');
			// Return false so the browser windows doesn't shift down to the anchor.
			return false;
		}
	);
});

// Convert un-tabbed display into tabbed display and activate tabs
$(document).ready(function() {
	var $tabs = $('div.tabsPreSetup');
	var $tabnav = $tabs.prepend('<ul class="tabNav selfClear"></li>').find('> ul');
	$tabs	.find('> div')
				.each( function(i) {
					var id = this.id;
					var $h2 = $(this).find('h2');
					var title = $h2.html();
					$tabnav.append('<li><a href="#' + id + '" class="noPopup"><span>' + title + '</span></a></li>');
					$h2.remove();
				});
	// Need delay for browsers to get their DOM in order
	setTimeout(function() { $tabs.tabs(); }, 500);

	// Only move to the top of the page when the tabs are present so not to affect real anchor links.
	var tabsPresent = $('div.tabsPreSetup').size(this);
	if (tabsPresent > 0)
	{
		// Move to the top of the page
		window.scrollTo(0,0);
	}

	$tabs.removeClass('tabsPreSetup');
});

/* begin - open new window for external links and pdfs */
	$(function() {
		$('#Wrapper a[href^=http://]')
			.not($('a.noPopup'))
			.not($('#Footer .siteLinks a[href^=http://www.atre.net]'))
			.popupwindow(); // Fully qualified links
		$('#Wrapper a[href^=https://]').not($('a.noPopup')).popupwindow(); // Secure HTTP connection links
		$('#Wrapper a[href$=.pdf],#Wrapper a[href$=.mp3],#Wrapper a[href$=.wmv],a[href*=register.php?rid],a[href*=case-studies/city-bank.php]').popupwindow(); // documents by URL
		$('#Wrapper a.popup').popupwindow(); // specific internal links
		//$('#Wrapper form[action^=https://]').popupwindow();
		
	});
/* end - open new window for external links and pdfs */

// Initialize the search box field behavior
$(function() {
	$('#SearchField').searchField();
});

// Validator email validation setup
if (jQuery.validator) {
		jQuery.validator.addMethod("email_domain", function(value, element) {
			var domains_to_check = [ "gmail\\.com", "hotmail\\.com", "msn\\.com", "opalis\\.com", "optinuity\\.com", "realops\\.com", "yahoo\\.com", "mac\\.com", "aol\\.com", "sonic\\.net" ];
			value = value.toLowerCase();
			for (var i = 0; i < domains_to_check.length; i++) {
				var pattern = new RegExp(domains_to_check[i]);
				if (pattern.test(value)) {
					return false;
				}
			}
			return true;
		}, "Please enter a corporate email address");
		jQuery.validator.addMethod("email_domain_too", function(value, element) {
			var domains_to_check = [ "accesssoftek\\.com", "affinitymobile\\.com", "air2web\\.com", "amazon\\.com", "att\\.net", "billingrevolution\\.com", "blazemobile\\.com", "boku\\.com", "bsgclearing\\.com", "cavionplus\\.com", "celltrust\\.com", "chargeanywhere\\.com", "clareitysecurity\\.com", "clickatell\\.com", "comstarinteractive\\.com", "comstarmail\\.com", "c-sam\\.com", "danal\\.com", "ebay\\.com", "ecommlink\\.com", "firethornmobile\\.com", "firstdata\\.com", "fis\\.com", "fisglobal\\.com", "fiserv\\.com", "fronde\\.com", "fundamo\\.com", "fuze\\.com", "fxfn\\.com", "geezeo\\.com", "gemalto\\.com", "gresham-computing\\.com", "harlandfinancialsolutions\\.com", "infosys\\.com", "insidecontactless\\.com", "intuit\\.com", "ivisionmobile\\.com", "jackhenry\\.com", "konysolutions\\.com", "mcash\\.net", "mcashcard\\.com", "mcashholdings\\.com", "mchek\\.com", "mcom\\.co\\.nz", "mcomfs\\.com", "meafinancial\\.com", "metavante\\.com", "mfoundry\\.com", "mint\\.com", "mobiclear\\.com", "mobilearth\\.com", "mobiletransaction\\.org", "mobilians\\.co\\.kr", "mocapay\\.com", "monitise\\.com", "monitiseamericas\\.com", "moremagic\\.com", "mpayy\\.com", "mpowermobile\\.com", "mshift\\.com", "m-via\\.com", "ncr\\.com", "optonline\\.net", "paymate\\.com", "paymentone\\.com", "paymo\\.com", "paypal\\.com", "pmsyscorp\\.com", "postilion\\.com", "pyxismobile\\.com", "q2software\\.com", "qualcomm\\.com", "s1\\.com", "srmtechnologies\\.com", "sybase\\.com", "tyfone\\.com", "valista\\.com", "vidicom\\.com", "vipera\\.com", "vivotech\\.com", "wesabe\\.com", "yahoo_inc\\.com", "yahoo\\.co\\.id" ];
			value = value.toLowerCase();
			for (var i = 0; i < domains_to_check.length; i++) {
				var pattern = new RegExp(domains_to_check[i]);
				if (pattern.test(value)) {
					return false;
				}
			}
			return true;			
		}, "Please enter a valid email address");
}


/* ***********************BEGIN Transactions Calculator*********************** */
// Start date used for transaction calculations
var transactionsStartDate = new Date(2010, 7, 0);
// Save the jQuery object once we get it to run faster
var $transactionSpan = null;


// Take a date and determine how many transactions
// have been completed since then.
var transactionsToDate = function(aDate)
{
  if (!aDate)
    aDate = new Date();


  var msDiff = aDate.getTime() - transactionsStartDate.getTime();
  // We need to change 6.68 transactions/second into milliseconds which is 6.68/1000
  // then we multiple it by the time difference (in milliseconds) and add the number
  // of transactions in the date difference to the starting number.
  return Math.round((6.68/1000) * msDiff + 142106440);
};


// Add commas to a long number to make it more readable.
var addCommas = function(aNumber)
{
  // Convert our number to an array and reverse it so that
  // we can easily work from most significant digits down
  // to least significant
  var bitsR = (aNumber.toString().split('')).reverse();
  for (var i = bitsR.length - 1; i>2; i--)
    if (i % 3 == 0)
      bitsR.splice(i, 0, ',');
  // Return our array with commas added back to the proper order
  // for display on the screen.
  return bitsR.reverse().join('');
};

// Update the transactions value displayed on the screen.
// This is wrapped in its own function to make it easier
// to call on an interval
var updateTransactions = function()
{
  // Creating an array and joining is faster than string concatenation
  $('#CompletedTransactions').html(addCommas(transactionsToDate()));
};

    // Save the jQuery object for faster access later
    $transactionSpan = $('#CompletedTransactions');
    // Initial display of information
    updateTransactions();
    // Periodic update to refresh the number in milliseconds
    setInterval(updateTransactions, 50);

/* ***********************END Transaction Calculator*********************** */

/* Carousel on customers landing page */
$(document).ready(function() {
	$("#Carousel").jCarouselLite({
		auto: 10000,
		speed: 500,
		visible: 1,
		btnNext: ".next",
		btnPrev: ".previous"
	});
});