// Add chevrons to each call to action link.
$(document).ready(function() {
  var illustrations = new Array("i3","i6","i7","i9","i10","i11","i12","i13","i14");
 $(".container").addClass(illustrations[Math.floor(Math.random()*illustrations.length)]);
});


// Add chevrons to each call to action link.
$(document).ready(function() {
	$("p.call-to-action a").each (function () {
		var color = $(this).css("color");
		$(this).after("<span style='color:" + color +"'>&nbsp;&#187;</span>");
	});
});

$(document).ready(function() {
  $("#page-content a[@href$=pdf], #home-features a[@href$=pdf]").each (function() {
    $(this).after("<span class='pdf'>&nbsp;</span>");
  });
});


// // Unobtrusively add animation for the supergraphics.
// $(document).ready(function() {
// 
//   /*
//   Add an overlay on top of the supergraphic.
//   Then we extract the path to the image file to check to see if it is loaded.
//   */
//   if ($("#home-lead").length > 0) {
//     $("#home-lead").prepend("<div id='inner-page-wrapper'></div>")
//     var imagePath = $("#home-lead").css("background-image").replace(/^url\(/,'').replace(/\)$/,'').replace(/"/g,'');
//     setTimeout(function() {
//      $("#inner-page-wrapper").fadeTo(750,0)
//       }, 750); 
//   }
//   else if ($("#page-wrapper").length > 0) {
//     $("#page-wrapper").prepend("<div id='inner-page-wrapper'></div>")
//     var imagePath = $("#page-wrapper").css("background-image").replace(/^url\(/,'').replace(/\)$/,'').replace(/"/g,'');
//     setTimeout(function() {
//      $("#inner-page-wrapper").fadeTo(750,0)
//       }, 750); 
//   }
// 
//   /*
//   Since we can't tell whether a css background-image is loaded or not:
//   1. Create a new image
//   2. Assign the image path as its source.
//   3. Check to see if the new image is loaded.
//   4. After a delay, slowly fade the opacity of the overlay to 0 to reveal the image.
//   */
// 
//   // var imageObj = new Image();
//   // $(imageObj).attr("src",imagePath).load( function() {
//   //     setTimeout(function() {
//   //      $("#inner-page-wrapper").fadeTo(750,0)
//   //       }, 750); 
//   // });
// });
// 
// 
