$(document).ready(function() {
 
 $('#article').highlight('Website Leasing');
 $('#article p').first().css('font-weight', 'bold');
 
 $('h2').highlight('IMPORTANCE');
 
  
 	$("img:not([title])").each(function() {
  		if($(this).attr("alt") != '') $(this).attr("title", $(this).attr("alt"))
  		else $(this).attr("title", $(this).attr("src"))
  	})
 
$('.rightHead').hide().delay(1200).fadeIn(600);
$('h2').hide().delay(400).fadeIn(800);
$('h3').hide().delay(800).fadeIn(800);
$('#testBox').hide().delay(1400).fadeIn(600);
});

Cufon.replace('h1', { fontFamily: 'GLS' });
Cufon.replace('h2', { fontFamily: 'GLS' });
Cufon.replace('h4', { fontFamily: 'GLS' });
Cufon.replace('h5', { fontFamily: 'GLS' });
Cufon.replace('h3', { fontFamily: 'moanHand' });



jQuery.fn.highlight = function(pat) {

 function innerHighlight(node, pat) {
  var skip = 0;
  if (node.nodeType == 3) {
   var pos = node.data.toUpperCase().indexOf(pat);
   if (pos >= 0) {
    var spannode = document.createElement('span');
    spannode.className = 'color';
    var middlebit = node.splitText(pos);
    var endbit = middlebit.splitText(pat.length);
    var middleclone = middlebit.cloneNode(true);
    spannode.appendChild(middleclone);
    middlebit.parentNode.replaceChild(spannode, middlebit);
    skip = 1;
   }
  }
  else if (node.nodeType == 1 && node.childNodes && !/(script|style)/i.test(node.tagName)) {
   for (var i = 0; i < node.childNodes.length; ++i) {
    i += innerHighlight(node.childNodes[i], pat);
   }
  }
  return skip;
 }
 return this.each(function() {
  innerHighlight(this, pat.toUpperCase());
 });
};

