/*********************************************************************************************************************************/
/* DOCUMENT READY CALLS **********************************************************************************************************/
/*********************************************************************************************************************************/
$(document).ready(function(){
	
	/* EXTERNAL LINKS start ***********************************************************/
	$('a[rel="external"]').click(function(){
		this.target = "_blank";
	});
	/* EXTERNAL LINKS end *************************************************************/
	
	$('html').addClass('js');

	/*SEARCH start ********************************************************************/
	$('#form-search input[type="text"]')
		.val('Search')
		.focus(function(){ if(this.value=='Search') { $(this).val('');} })
		.blur(function(){ if(this.value =='') { $(this).val('Search');} });
	/*SEARCH end **********************************************************************/

	$('#nav-media .audio a').click(function(){
		$('#audio').remove();
		$('body').append('<div id="audio"><iframe style="width:1px;position:absolute;left:-6000px;top:-6000px;height:1px;" id="musicPlayer" src="'+$(this).attr('href')+'"></iframe></div>');
		return false;
	});
	
	/*DISCLAIMER POPUP start ********************************************************************/
	
	$('.disclaimer').click(function(){
		
		var message = confirm("You are now leaving The Financial Guys website. The link you have selected is located on another server. Please click the link below to leave The Financial Guys site and proceed to the selected site. Neither The Financial Guys nor NEXT Financial Group, Inc. endorses this web site, its sponsor, or any of the policies, activities, products, or services offered on the site or by any advertiser on the site.");
		
		if (message) {
			return true;
		} else {
			return false;
		}
				
	});
	
	/*DISCLAIMER POPUP end ********************************************************************/


}); //close document.ready

/*********************************************************************************************************************************/
/* DOCUMENT READY FUNCTIONS ******************************************************************************************************/
/*********************************************************************************************************************************/

/* SLIDESHOW function start *********************************************************/
function slideSwitch(s,o,d){var $a=$(s+'.active');if($a.length==0)$a=$(s+':first');if(d=='Next'||d==null){var $n=$a.next().length?$a.next():$(s+':first');}else if(d=='Previous'){var $n=$a.prev().length?$a.prev():$(s+':last');}$a.addClass('last-active');$n.css({opacity: 0.0}).addClass('active').animate({opacity: 1.0},o,function(){$a.removeClass('active last-active');});}
/* SLIDESHOW function end ***********************************************************/

function setAgreementCookie(){
	var options = { path: '/' };
	$.cookie('agree',true, options);
}

