﻿$(document).ready(function(){
	  
	  // Invest now landing page hover / click radio button div effect.
	  
	  // highlight checked div
		
	  
	  $('.investnow div').css('cursor', 'pointer');
		
		$('.investnow div').each( function() {
		
			// Loop through inputs and apply the highlighted class.
			// This is because Firefox will maintain the checked state the last checked radio button on refresh.

			 if (($(this).children('span').children('input').attr('checked')) == true) {
			 $('.investnow div').removeClass().addClass('rowOff');
			 $(this).removeClass();
				$(this).addClass('rowOn');
			 }
		
		});
			
		  $('.investnow div').hover(
		  function () {
			if ($(this).attr('class') != 'rowOn') {
			$(this).toggleClass('rowHover');
			}
		  }, 
		  function () {
			$(this).removeClass('rowHover');
		  }
		);
	
		$('.investnow div').click(function() {
				$('.investnow div').removeClass().addClass('rowOff');
				$(this).removeClass();
				$(this).addClass('rowOn');
				$(this).children('span').children('input').attr('checked', true);
			});
			
			
	  watermark("#ctl00_Content_txtFundName", "Keyword(s)", "#ctl00_Content_txtFundName", "Please enter a value");
		
	$(".enabler").change(function() {
		if ($(this).val()!='') {
		$(this).next().next().removeAttr('disabled')
		} else {
		$(this).next().next().val('').attr('disabled','disabled')};
	})
	

	$(".pnlAdvancedSearch").hide();
	$("#advheader").click(function() {
		$(".pnlAdvancedSearch").toggle();
		$(this).toggleClass("advheaderOpen");
		return false;
		});
});