$(document).ready(function() {
 
 
$.fn.preload = function() {
    this.each(function(){
        $('<img/>')[0].src = "/images/"+this;
    });
}

// Usage:

$(['']).preload();



$("#navButs li").mouseover(function (){
								 $("#navButs img").stop(true);
						        $("#navButs img").fadeTo(400, 0.5 );
								 $(this).find("img").stop(true);
								    $(this).find("img").fadeTo(400, 1.0 );
									var imgloc=$(this).find("img").attr("src");
									var imgloc2=(imgloc.replace(".png", "2.png"));
									 $(this).find("img").attr("src",imgloc2);
	
  							  });

$("#navButs li").mouseout(function (){
								 $("#navButs img").stop(true);
						        $("#navButs img").fadeTo(300, 1 );
									var imgloc=$(this).find("img").attr("src");
									var imgloc2=(imgloc.replace("2.png", ".png"));
									$(this).find("img").attr("src",imgloc2);
  							  });

 
 $('#article').highlight('Website Leasing');
 $('#article p').first().css('font-weight', 'bold');
 
 $('h1').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);
$('h1').hide().delay(400).fadeIn(800);
$('h3').hide().delay(800).fadeIn(800);
$('#testBox').hide().delay(1400).fadeIn(600);

$('.hoverClick').click(
  function () {

    $('.dropContent').slideToggle();
	return false;
  }
);



		  $(".hoverFade").mouseover(function (){
								  $(this).stop();
						         $(this).fadeTo(300, 0.5 )
  							  });
				  $(".hoverFade").mouseout(function (){
					  			  $(this).stop();
						         $(this).fadeTo(200, 1 )
  							  });
							  
							  
$('.fader').quovolver();
$('.fader2').quovolver();


function hideTabs(selDiv){

	 $('div.sel1_content').hide();
	 $('div.sel2_content').hide();
	 $('div.sel3_content').hide(); 
	 $('div.sel4_content').hide();
	 $('div.' + selDiv+'_content').fadeIn();
	 
	 	$('#navTabs').removeClass('sel1');
	 	$('#navTabs').removeClass('sel2');
	 	$('#navTabs').removeClass('sel3');
	 	$('#navTabs').removeClass('sel4');
		$('#navTabs').addClass(selDiv);
}
hideTabs('sel1');
  
$('#navTabs a').click(
  function () {
	  
	 	  selDiv=this.className;
			hideTabs(selDiv);
			return false;
	    }
		
	
);


});




Cufon('h1', {
	color: '-linear-gradient(#f6d3ae, #b0722b)',
	textShadow: '#000 1px 1px, #000 -1px -1px',
	hover: {
		color: '#ffffff'
	}
});


Cufon('h2', {

	textShadow: '#000 1px 1px, #000 -1px -1px',
	hover: {
		color: '#ffffff'
	}
});


Cufon.replace('h4');
Cufon.replace('h5');
Cufon.replace('h3');
Cufon.replace('h3');
Cufon.replace('.frLink');
Cufon.replace('.medFLtxt');
Cufon.replace('.frontHead');
Cufon.replace('.largeTxt');
Cufon.replace('.limoTitle');


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());
 });
};

