(function($) {
	$.fn.equalHeights = function(minHeight, maxHeight) {
		var tallest = (minHeight) ? minHeight : 0;
		function addSize(elem,baseHeight,operation) {
			var border_top = parseInt(elem.css('border-top-width'));
			var border_bottom = parseInt(elem.css('border-bottom-width'));
			var padding_top = parseInt(elem.css('padding-top'));
			var padding_bottom = parseInt(elem.css('padding-bottom'));
			if (operation == 'subtract') {
			if (!isNaN(padding_top)) baseHeight -= padding_top;
			if (!isNaN(padding_bottom)) baseHeight -= padding_bottom;
			if (!isNaN(border_top)) baseHeight -= border_top;
			if (!isNaN(border_bottom)) baseHeight -= border_bottom;
			} else {
			if (!isNaN(padding_top)) baseHeight += padding_top;
			if (!isNaN(padding_bottom)) baseHeight += padding_bottom;
			if (!isNaN(border_top)) baseHeight += border_top;
			if (!isNaN(border_bottom)) baseHeight += border_bottom;
			}
			return baseHeight;
		}
		this.each(function() {
			var height = $(this).height();
			height = addSize($(this),height);
			if (height > tallest) tallest = height;
		});
		if((maxHeight) && tallest > maxHeight) tallest = maxHeight;
			return this.each(function() {
			tallest2 = addSize($(this),tallest,'subtract')
			$(this).height(tallest2);
		});
	}
})(jQuery);
FC.dropdown = function(){
	var topNav = $(".navigation li a span");
	var navigation = $(".navigation");
	topNav.hoverIntent(
		function(){
			//find the drop down for this link
			var dd = $(this).parent().parent().find(".drop-down");
			//hide the existing customer box	
			$("div.existingCustomerArea").hide();
			//Hide the shared function alt nav areas and set hover colour back to #333
			$(".navigation ul li.alt a").css({"background":"#333"});
			$(".extra-content-area").hide();
			$(".extra-content-area .col").show();
	      

			//if there is a drop down for this link
			if(dd.length>0){
				//if the drop down for this link is NOT already open
				var act = dd.hasClass("active");
				if(act == false){
				
					//Remove any currently open drop downs and remove any active link classes
					var curr = $(".drop-down.active");
					curr.removeClass("active");
					curr.css({"display":"none"});
					topNav.parent().removeClass("active");

					//Add the active class to the link, make the drop down available, add hte active class then animate it down
					$(this).parent().addClass("active");
					setheight = dd.height();
					dd.css({"height":"0px"});
					dd.css({"display":"block"});
					dd.addClass("active");
					dd.animate({"height":setheight+"px"},250);
				}
			}		
			//If there isn't a drop down for this menu item, close any open ones
			else{
				var curr = $(".drop-down.active")
				curr.removeClass("active");
				curr.css({"display":"none"});
				topNav.parent().removeClass("active");
			}
		},
		function(){
		}
	);
	navigation.bind("mouseleave", function(){
		var curr = $(".drop-down.active")
		curr.removeClass("active");
		curr.css({"display":"none"});
		topNav.parent().removeClass("active");
		
	})
}
/* For the menu close button */
	$(".close-menu").live("click", function(){
		var curr = $(".drop-down")
		var topNav = $(".navigation li a span");
		curr.removeClass("active");
		curr.css({"display":"none"});
		topNav.parent().removeClass("active");
		return false;
	})
/* For the flyout close button */
	$(".close-flyout").click(function(){
		var curr = $(".info .selected")
		curr.removeClass("selected");
		curr.css({"left":"-40000px"});
		$(".info .default").css({"left":"0"});
		$(".info .default").css({"display":"block"});
		$("li.selected").removeClass("selected");
		
		$(".info .default").animate({"opacity":"1"},150, function(){
			$(this).addClass("selected");
		});
		return false;
	})	
	$(".close-alt").click(function(){
		$(".extra-content-area").css({"display":"none"});
		$(".extra-content-area .col").show();
        
		return false;
	})	
FC.feature = function(){
	$(".default").addClass("selected");
	var optsContainer = $(".landing-feature, .wpb-feature");
	var opts = $(".landing-feature .options li a");
	if($(".landing-feature").length>0){
	
	opts.bind("click",		
			function(){
			opts.parent().removeClass("selected");
			var anc = $(this).parent();
			var targ = $(this).attr("class");
		
				$(".info .selected").css({"left":"-40000px"});
				$(".info .selected").removeClass("selected");
				$("div."+targ).css({"left":"0"});
				anc.addClass("selected");		
			
			
				$("div."+targ).addClass("selected");
			
			
			return false;
	}
	)
	}
	
	opts.bind("mouseover",	
			function(){
				opts.parent().removeClass("selected");
				var anc = $(this).parent();
				var targ = $(this).attr("class");
					$(".info .selected").css({"left":"-40000px"});
					$(".info .selected").removeClass("selected");
					$("div."+targ).css({"left":"0"});
					anc.addClass("selected");		
					$("div."+targ).addClass("selected");
				return false;
			}
		)

};

FC.WPBHomeFeature = function(){
	$(".default").addClass("selected");
	var opts = $(".wpb-feature .options ul li");
	opts.hoverIntent(
		function(){
			opts.removeClass("selected");
			var targ = $(this).attr("class");
				$(".info .selected").css({"left":"-40000px"});
				$(".info .selected").removeClass("selected");
				$("div."+targ).css({"left":"0"});
				$(this).addClass("selected");		
				$("div."+targ).addClass("selected");
			
		},
		function(){
		}
	);
};

FC.WPBLandingFeature = function(){
	
	$(".default").addClass("selected");
	var opts = $(".wpb-options ul li");
	
	opts.bind("mouseenter mouseover",
		function(){
			
			opts.removeClass("selected");
			var targ = $(this).attr("class");
			
				$(".info .selected").css({"left":"-40000px"});
				$(".info .selected").removeClass("selected");
				$("div."+targ).css({"left":"0"});
				$(this).addClass("selected");		
				$("div."+targ).addClass("selected");
			
		}
	);
};

FC.NewsTab = function(){
	var opts = $(".news-menu ul li a");
	opts.bind("click mouseover mouseenter",	
		function(){
			var anc = $(this).attr("id");
			$(".news-menu ul li a.selected").removeClass("selected");
			$(this).addClass("selected");
			$(".news-content ul.selected").removeClass("selected");
			$("."+anc).addClass("selected");
			
			return false;
			});	
	
	};
FC.Homefeature = function(){
	
	var length = $(".default-panel").length;
	var defaultitem = Math.floor(Math.random()*length) + 1;
	
	$("div.info-panel, div.default-panel").removeClass("default");
	$("div.default-panel-"+defaultitem).addClass("default");
	
	
	//$('link[href*=colour-]').each(function(i){
	//	var currentCSS = $(this).attr('href');
	//	var defaultCSS = 'css/colour-'+defaultitem+'.css';
	//	if (defaultCSS != currentCSS) {
			this.disabled = true;
	//	}
	//});
	//$('link[href*=ie6-colour-]').each(function(i){
	//	var currentCSS = $(this).attr('href');
	//	var defaultCSS = 'css/ie6-colour-'+defaultitem+'.css';
	//	if (defaultCSS == currentCSS) {
	//		this.disabled = false;
	//	}
	//});

	
	
	Cufon.replace('.sifr');
	var opts = $("li.home-carousel-item");
		opts.hoverIntent(function(){
			var anc = $(this).attr("id");
			var targ = $(this).attr("id");
			var selection = $(this).attr("class");
			
			$(".selected-item").removeClass("selected-item");
			$(this).addClass("selected-item");
			
			$("div.info-panel, div.default-panel").removeClass("default");
			$("div.panel-"+targ).addClass("default");
			
			
			}, 
	     function () { 
	
			}
		);	
		
	};
		
FC.Customer = function(){
		var opts2 = $("li.existingCustomer");
		var opts3 = $("div.existingCustomerArea");
		opts2.bind("mouseenter",		
		function(){
			var topNav = $(".navigation li a span");
			var curr = $(".drop-down.active");
			curr.removeClass("active");
			curr.css({"display":"none"});
			topNav.parent().removeClass("active");
			
		$("div.existingCustomerArea").show();
		
		});
		opts3.bind("mouseleave",		
		function(){
		$("div.existingCustomerArea").hide();});
	};
	function Right(str, n){
		  if (n <= 0)
		    return "";
		  else if (n > String(str).length)
		    return str;
		  else {
		    var iLen = String(str).length;
		    return String(str).substring(iLen, iLen - n);
		  }
		}
FC.extraContent = function(){
		var opts2 = $('*[id^="extra-content"]'); 
		var opts3 = $('*[id^="alt-area"]');
		
		opts2.bind("mouseenter",
		function(){
			$(opts3).hide();
			//$(".extra-content-area .col").show();
			if ($(".extra-content-area form select").length>0) {
				var selectedColumn = $(".extra-content-area form select option:selected").val();	
				if (selectedColumn !== ''){
					$('.extra-content-area .col').css({'display':'none'});
					$(".extra-content-area form select").val(selectedColumn);
					$('.extra-content-area .'+selectedColumn).show();	
					$(".extra-content-area").css({'width':'250px'});
				}
				else {
					$(".extra-content-area").css({'width':'100%'});
				}
			};
			
			var selection = $(this).attr("id");
			var targetArea = "alt-area-"+Right(selection,1)
			var topNav = $(".navigation li a span");
			var curr = $(".drop-down.active");
			$(this).children("a").css({"background":"#000"});
			curr.removeClass("active");
			curr.css({"display":"none"});
			topNav.parent().removeClass("active");
			$("div#"+targetArea).show();
			
				
				
			
		});
		/*opts3.bind("mouseleave", function() { 
		    	var selection = $(this).attr("id");
				$(".navigation ul li.alt a").css({"background":"#333"});
				$(".extra-content-area .col").show();
				$(".extra-content-area h2.tabhead").css({'width':'100%'});
				$("div#"+selection).hide();
		    
		});*/	
		
		
			
			
	};


FC.FAQ = function() {
  jQuery(".faq-content").hide();
  $(".faq-heading-off").live("click", function(){
	  $(this).parent().addClass("faq-item-on");
	  $(this).addClass("faq-heading-on");
	  $(this).removeClass("faq-heading-off");
	  $(this).parent().removeClass("faq-item-off");
	  $(this).next(".faq-content").slideToggle(500);
  });
  $(".faq-heading-on").live("click", function(){
  		
	  $(this).parent().addClass("faq-item-off");
	  $(this).addClass("faq-heading-off");
	  $(this).removeClass("faq-heading-on");
	  $(this).parent().removeClass("faq-item-on");
	  $(this).next(".faq-content").slideToggle(500);
  });
  
};
	  


function printBeforeBuy(){
	var divToPrint=document.getElementById('before-buy-content-ajax');
	newWin= window.open("");
	newWin.document.write(divToPrint.innerHTML);
	newWin.print();
	newWin.close();
};
function simple_tooltip(target_items, name){
	 $(target_items).each(function(i){
			$("body").append("<div class='"+name+"' id='"+name+i+"'><p>"+$(this).attr('title')+"</p></div>");
			var my_tooltip = $("#"+name+i);
			
			$(this).removeAttr("title").mouseover(function(){
					my_tooltip.css({opacity:0.9, display:"none"}).fadeIn(400);
			}).mousemove(function(kmouse){
					my_tooltip.css({left:kmouse.pageX+15, top:kmouse.pageY+15});
			}).mouseout(function(){
					my_tooltip.fadeOut(400);				  
			});
		});
	};
FC.GalleryThumb = function() {
	opts = $('.gallery-item'); 
	opts.bind("mouseenter",
			function(){
				$(this).find(".gallery-image-full-overlay").css('display','block');
		   });
	opts.bind("mouseleave",
			function(){
				$(this).find(".gallery-image-full-overlay").css('display','none');
		   });
	 
}
function ImageGallery() {
	//<!-- Begin
		$('.gallery-image-dialog').dialog({
					bgiframe: true,
					autoOpen: false,
					resizable: false,
					width:550,
					modal: true
				})
		var opts = null;		
		var opts = $('.gallery-item'); 
		opts.bind('click',		
			function(){
					var htmlStr = $(this).next().html(); //set var to content of item
					$('.gallery-image-dialog').html(htmlStr); //load content into dialog
					$('.gallery-image-dialog').dialog("open"); //open dialog
				
				 
					
		   });
	 //-->
	
};	
sfActive = function() {
	var sfEls = $(".isButton");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmousedown=function() {
			this.className+=" sfactive";
		}
		sfEls[i].onmouseup=function() {
			this.className=this.className.replace(new RegExp(" sfactive\\b"), "");
		}
	}
}
//outerhtml function
jQuery.fn.outerHTML = function(s) {
	return (s)
	? this.before(s).remove()
	: jQuery("<p>").append(this.eq(0).clone()).html();
	}
//get stock quote details
function getStockQuote(){
	if( typeof irxmlstockquote != 'undefined' && irxmlstockquote.length > 0 ){
	  // irxml times are in ET
	  var irxmlrows = [ {"name":'Company', "field":'ticker.companyname'},
	               {"name":'Last Trade', "field":'irxmlfunctions.formatDate(ticker.lastdatetime, "dd MMM yyyy @ HH:mm\\\\G\\\\M\\\\T")'},
	               {"name":'Price', "field":'irxmlfunctions.numberFormat(ticker.lastprice, 2)'},
	               {"name":'Change', "field":'irxmlfunctions.numberFormat(ticker.change, 2)'},
	               {"name":'Volume', "field":'irxmlfunctions.numberFormat(ticker.volume)'},
	               {"name":'Trades', "field":'irxmlfunctions.numberFormat(ticker.trades)'},
	               {"name":'Day Low', "field":'irxmlfunctions.numberFormat(ticker.low, 2)'},
	               {"name":'Day High', "field":'irxmlfunctions.numberFormat(ticker.high, 2)'},
	               {"name":'52 Week Low', "field":'irxmlfunctions.numberFormat(ticker.yearlow, 2)'},
	               {"name":'52 Week High', "field":'irxmlfunctions.numberFormat(ticker.yearhigh, 2)'}
	              ];
	  	var notLoaded = 0;
	} else {
		$('.share-updated').html('Stock quote is not available at this time.');
		var notLoaded = 1;
	  
	}
		$(document).ready(function(){
			if (notLoaded == 0) {
			var ticker = irxmlstockquote[0];
		  	var priceChange = eval(irxmlrows[3].field);
		  	if (priceChange >= 0){
				//down arrow span added
		  		$('span.price-up, span.price-down').outerHTML('<span class="price-up">&nbsp;</span>');
			}
			else{
				// up arrow span added
				$('span.price-up, span.price-down').outerHTML('<span class="price-down">&nbsp;</span>');
			};
			// update stock price
			$('.share-price').html(eval(irxmlrows[2].field)+'p');
			// update date updated
			$('.share-updated').html(eval(irxmlrows[1].field)+' (20mins delay)');
			};
	});
	};
function genericGallery(){
	//init dialog
		$('.generic-image-gallery-dialog').dialog({
					bgiframe: true,
					autoOpen: false,
					resizable: false,
					width:'auto',
					height:'auto',
					modal: true
				})
	//first content load
		var opts = null;		
		var opts = $('.gallery-item .generic-image-left a'); 
		opts.bind('click',		
			function(){
			
			$('.generic-image-gallery-dialog').dialog("close"); //close dialog
				var opts2 = null;
				var opts2 = $(this).attr('href');	
				var fullImg = $("<img>");
				fullImg.attr({
			         src: opts2,
			         alt: $(this).attr('alt')
				});
				var caption = ($(this).siblings('div.generic-image-caption').html());
				$('.generic-image-gallery-dialog .main-img').html(fullImg); //load content into dialog
				$('.generic-image-gallery-dialog .main-caption').html(caption); //load content into dialog
				$('.generic-image-gallery-dialog').dialog("open"); //open dialog
				
				
				
				var current = $('.generic-image-gallery-dialog .main-img img').attr('src');
				var imageCounter = 0;
				$('.gallery-item .generic-image-left a').each(function(index) {
					if  ($(this).attr('href') == current){
						currentIndex = index;
						prevIndex = index - 1;
						nextIndex = index + 1;	
					}
					imageCounter = index;
				});		
				
				if (currentIndex==0){
					$('a.prev').css({'display':'none'});
				}
				else {$('a.prev').css({'display':'block'});};
				
				if (currentIndex==imageCounter){
					$('a.next').css({'display':'none'});
				}
				else {$('a.next').css({'display':'block'});};
				
				return false;
		   });
		   	// Next image functionality
			var opts = null;		
			var opts = $('.generic-image-gallery-dialog a.next'); 
			opts.bind('click',		
			function(){
				var opts2 = null;
				var current = $('.generic-image-gallery-dialog .main-img img').attr('src');
				var imageCounter = 0;
				$('.gallery-item .generic-image-left a').each(function(index) {
					if  ($(this).attr('href') == current){
						currentIndex = index;
						prevIndex = index - 1;
						nextIndex = index + 1;	
					}
					imageCounter = index;
				});
				if (nextIndex<=imageCounter){
					$('a.prev').css({'display':'block'});
					var fullImg = $("<img>");			 
					fullImg.attr({
				        src: $('.gallery-item .generic-image-left a:eq('+nextIndex+')').attr('href'),
				        alt: $(this).attr('alt')
					});
					$('.generic-image-gallery-dialog .main-img').html(fullImg); //load content into dialog
					
					var caption = $('div.generic-image-caption:eq('+nextIndex+')').html();
					$('.generic-image-gallery-dialog .main-caption').html(caption); //load content into dialog
				};
				if (nextIndex == imageCounter){
					$('a.next').css({'display':'none'});
					}; 
				return false;
			});
			// Next image functionality
		   	// Prev image functionality
			var opts = null;		
			var opts = $('.generic-image-gallery-dialog a.prev'); 
			opts.bind('click',		
			function(){
				$('a.next').css({'display':'block'});
				var opts2 = null;
				var current = $('.generic-image-gallery-dialog .main-img img').attr('src');
				var imageCounter = 0;
				$('.gallery-item .generic-image-left a').each(function(index) {
					if  ($(this).attr('href') == current){
						currentIndex = index;
						prevIndex = index - 1;
						nextIndex = index + 1;	
					}
					imageCounter = index;
				});
				if (prevIndex>=0){
					$('a.prev').css({'display':'block'});
					var fullImg = $("<img>");			 
					fullImg.attr({
				        src: $('.gallery-item .generic-image-left a:eq('+prevIndex+')').attr('href'),
				        alt: $(this).attr('alt')
					});
					$('.generic-image-gallery-dialog .main-img').html(fullImg); //load content into dialog
					
					var caption = $('div.generic-image-caption:eq('+prevIndex+')').html();
					$('.generic-image-gallery-dialog .main-caption').html(caption); //load content into dialog
				} 
				if (prevIndex == 0){
					$('a.prev').css({'display':'none'});
					};
				return false;
			});
};



 function myCarousel(){
	  $(function() {
        var originalSizes = new Array();
        $('#pane1').jScrollHorizontalPane({showArrows:true});
        $('.scroll-to').bind('click',function(){
                        $('#pane1')[0].scrollTo(75);
                        return false;
        });
       
        var originalSizes = new Array();
        $('#pane2').jScrollHorizontalPane({showArrows:true});
        $('.scroll-to').bind('click',function(){
                        $('#pane2')[0].scrollTo(75);
                        return false;
        });
                                
	  });
	 function mycarousel_initCallback(carousel)
	  {
	    carousel.buttonNext.bind('click', function() {
	        carousel.startAuto(0);
	    });

	    carousel.buttonPrev.bind('click', function() {
	        carousel.startAuto(0);
	    });

	    carousel.clip.hover(function() {
	        carousel.stopAuto();
	    }, function() {
	        carousel.startAuto();
	    });
	  };

   if($('#mycarousel').length>0){
   	    jQuery('#mycarousel').jcarousel({
   	        auto: 10,
   	        scroll:1,
   	        wrap: 'last',
   	        
   	        initCallback: mycarousel_initCallback
   	    });
   	   };
 };			
 /* Open link with new-window class in a new window*/
function newWindowLink(){
  $('a.new-window').each(function() {
  $(this).click(function(event) {
	  window.open(this.href, '_blank');
	  return false;
  	});
  	
  });
  
};



	 
/* ****************** START REDEYE MARKERS ****************************** */

function captureURLRedEye(){
	var counterName = document.location.pathname;

	var qs = document.location.search;
	var linkName;
	if (qs && qs.indexOf("link=")>=0) {
		//alert("link: " + qs.substring(qs.indexOf("link=")+5) );
		linkName = qs.substring(qs.indexOf("link=")+5);

		if (linkName.indexOf("&")>0) {
			var linkName = linkName.substring(0, linkName.indexOf("&"));
			//alert("t1: " + linkName);
		}

	}

	if(counterName.lastIndexOf(".")!=-1){
	var end = counterName.lastIndexOf(".");
	}
	else{
	var end = counterName.length;
	}
	counterName = counterName.substring(1,end);
	//counterName = counterName.replace(/[\/]/g, ".");

	if(counterName.substring(counterName.length-1)=="."){
	counterName = counterName.slice(0,counterName.length-1)
	}

	if (counterName=="") {
		counterName="homepage";
	}

	counterName = "http://report.legalandgeneral.com/cgi-bin/rr.cgi/images/blank.gif?nourl=direct/"+counterName+"&norefer="+escape(window.document.referrer);
	if (linkName) {
		counterName += "\n&landg_link=" + linkName;
	}

	sitestatRedEye(counterName);
}



function sitestatRedEye(ns_l){
//ns_l+='&ns__t='+(new Date()).getTime();ns_pixelUrl=ns_l;
//ns_0=document.referrer;
//ns_0=(ns_0.lastIndexOf('/')==ns_0.length-1)?ns_0.substring(ns_0.lastIndexOf('/'),0):ns_0;
//if(ns_0.length>0)ns_l+='&ns_referrer='+escape(ns_0);
if(document.images){ns_1=new Image();ns_1.src=ns_l;}else

document.write('<img src="file:///C|/Documents and Settings/Richard/My Documents/wareabouts/htdocs/v2/resources/js/'+ns_l+'" width="1" height="1" alt="" border="0">');
//document.write("REDEYE LINK: " + ns_l);
//alert(ns_l);

}

function RedEyeTag(strTag){
	imgRedEye = new Image();
	imgRedEye.src = 'http://report.legalandgeneral.com/cgi-bin/rr.cgi/images/blank.gif?nourl=' + strTag;
}


/* ****************** END REDEYE MARKERS ****************************** */	 
$(document).ready(function(){
	
	
	captureURLRedEye();

	
	 $(".extra-content-area form select").change(function() 
	    	    {  	    	   
    	    	var selection = $(this).val();
    	    	
    	        if (selection != '') { 
    	        	$(".extra-content-area .col").hide();
    	        	$(".extra-content-area .extra-content-footer ul").removeClass("cols-4 cols-3 cols-2");
    	        	$(".extra-content-area .extra-content-footer ul").css({'width':'160px'});
    	        	$(".extra-content-area").css({'width':'250px'});
    	        	$(".extra-content-area .extra-content-footer ul li.left").css({'float':'none'});
    	        	$(".extra-content-area .extra-content-footer ul li.right").css({'float':'none'});
    	        	$(".extra-content-area ."+selection).show();        	 
    	        }
    	        else {
    	            $(".extra-content-area .col").show();
    	            $(".extra-content-area").css({'width':'85%'});
    	            $(".extra-content-area .extra-content-footer ul").css({'width':'100%'});
    	        	
    	        	$(".extra-content-area .extra-content-footer ul li.left").css({'float':'left'});
    	        	$(".extra-content-area .extra-content-footer ul li.right").css({'float':'right'});
    	            $(".extra-content-area .extra-content-footer ul").addClass("cols-4");
    		        } 
    	    }); 
    	
	function printBeforeBuy(){
		var divToPrint=document.getElementById('before-buy-content-ajax');
		newWin= window.open("");
		newWin.document.write(divToPrint.innerHTML);
		newWin.print();
		newWin.close();
	};

	
	simple_tooltip("a.tt","tooltip");
	simple_tooltip("span.abbr","abbr-content");
	
	if($(".navigation").length>0){
		FC.dropdown();
	}
	//if($('.home-feature .options, .wpb-feature .options, .landing-feature .wpb-options').length>0){	
	//	$('.options ul li,wpb-options ul li').equalHeights();
	//}
	if($('a.new-window').length>0){
		newWindowLink();
	}
	if($('#mycarousel,#pane1,#pane2').length>0){
		myCarousel();
	}
	if($('.landing .cols-3-alt .col .panel').length>0){
		$('.landing .cols-3-alt .col .panel').equalHeights();
	}
	if($('.news-content ul').length>0){
		$('.news-content ul').equalHeights();
	}
	if($(".campaign .container .feat1-cols-2 .col").length>0){
		$('.campaign .container .feat1-cols-2 .col').equalHeights();
	}
	if($('.landing-feature .options ul li').length>0){
		$('.landing-feature .info .default').css({"margin-left":"28px"});
		$('.landing-feature .adviser-newsinfo .default').css({"margin-left":"28px"});
		
	}
	 
	if($('.landing .feat1-cols-3 .col').length>0){
		$('.landing .feat1-cols-3 .col').equalHeights();
	}
	if($('.group .feat1-cols-3 .col .sub-col').length>0){
		$('.group .feat1-cols-3 .col .sub-col').equalHeights();
	}
	
	
	if($('.landing .feat2-cols-3 .col').length>0){
		$('.landing .feat2-cols-3 .col').equalHeights();
	}
//	if($('.campaign .container .feat1-cols-2-withnav .col1 .options ul li').length>0){
//		$('.campaign .container .feat1-cols-2-withnav .col1 .options ul li').equalHeights();
//	}
	if($('.adviser-feature .feat1-cols-3 .cols-bg .col').length>0){
		$('.adviser-feature .feat1-cols-3 .cols-bg .col').equalHeights();
	}
	if($(".youraccountArea").length>0){
		var setTop = $(".youraccountArea").height() -20;
		$(".wpb-extra-options").css({"top":setTop});
	}
	if($(".search input.text").length>0){
		var searchTxt = $(".search input.text");
		searchTxt.bind("focus",function(){
			$(this).attr("value","");				
		})
	};
	$('#topsearchform').submit(function(){
		if ($('#q').val() == "" || $('#q').val() === undefined){//check if it's empty
			alert('Search term can not be blank');
			return false;
		}
	});
	
	if($(".faq-content").length>0){
		FC.FAQ();
	}
	if($(".news-menu").length>0){
		FC.NewsTab();
	}
	if($(".gallery-item").length>0){
		FC.GalleryThumb();
	 
	};
	if($(".gallery-image-dialog").length>0){
		ImageGallery();
	 
	};
	
	if($("li.home-carousel-item").length>0){
		FC.Homefeature();
		Cufon.replace('.sifr', { fontFamily: 'univers' });
	}
	if($("li.existingCustomer").length>0){
		FC.Customer();
	}
	if($("div.extra-content-area").length>0){
		FC.extraContent();
	}
	if($(".landing-feature .options ul li").length>0){
		FC.feature();
	}
	if($(".margin .wpb-feature .options ul li").length>0){
		FC.WPBHomeFeature();
	}
	if($(".margin .landing-feature .wpb-options ul li").length>0){
		FC.WPBLandingFeature();
	}
	if($(".share-price-bar").length>0){
		getStockQuote();
	}
	if($(".generic-image-gallery-dialog").length>0){
		genericGallery();
	}
	// IE 6 and lower warning//
	$(function() { 
		if ($.browser.msie && $.browser.version.substr(0,1)<7)  {
			if ($.cookie('BrowserWarningShown')) {
			}
			else{
				var options = { path: '/', expires: 7 }; //expires in 7 days
				var BrowserWarningShown = 'BrowserWarningShown';
				$.cookie(BrowserWarningShown, 'yes', options); //set the cookie
				$("#browser-warning").dialog({ // display the dialog
					bgiframe: true,
					autoOpen: true,
					height: 350,
					width:550,
					modal: true
				});		
				$("div.button-close a").click(
					function(){
						$('#browser-warning').dialog('close');
								
					});
				return false;
			}
		}
	});// END IE6 Warning

	sfActive();
	
	Cufon.replace('.sifr, .sifrwhite, .wpb-feature ul li span, .wpb-options ul li span, .highlight, .adviser-title', { 
		fontFamily: 'univers'
		
	});
	
});