// JavaScript Document
$(document).ready(function() {
	$("#navigation").droppy({ speed: 250 }); 
	$("#pageContent table tr:even").addClass("alt");


	$("a[rel*=external]").addClass('external');
	$("#sidenav a[rel*=external]").append("<img src='/assets/templates/investorsbank/images/icon-external.gif' alt='External Link' />");

	$('a[rel=external]').leaveNotice({
		siteName: 'Investors Bank',
		exitMessage: '<img src="/assets/templates/investorsbank/images/logo-investorsbank-small.png" alt="Investor&rsquo;s Bank" id="external-logo" /><p id="warning-message">You are now leaving InvestorsBank&rsquo;s website and are going to a website that is not operated by the bank. InvestorsBank is not responsible for the content or availability of linked sites. The privacy and security policies of the linked site may differ from those practiced by the bank.</p>',
		preLinkMessage: '',
		timeOut: 0
	});
//	$('.callout .submit').leaveNotice({
//		siteName: 'Investors Bank',
//		exitMessage: '<img src="/assets/templates/investorsbank/images/logo-investorsbank-small.png" alt="Investor&rsquo;s Bank" id="external-logo" /><p id="warning-message">You are now leaving InvestorsBank&rsquo;s website and are going to a website that is not operated by the bank. InvestorsBank is not responsible for the content or availability of linked sites. The privacy and security policies of the linked site may differ from those practiced by the bank.</p>',
//		preLinkMessage: '',
//		timeOut: 0
//	});
	
	function initMenu() {
		$('#faq h3').append('<span class="click">Click to expand</span>');
		$('#faq h3').click(function() {
			$(this).next().slideToggle('normal');
			$(this).toggleClass('active');
			$('#faq h3 .click').text("Click to expand");
			$('#faq h3.active .click').text("Click to collapse");
		});
		$('#faq div').hide();
	}
	initMenu();

// email popup script. nothing fancy :(
  $(".emailpopup").click(function() {
    var emailid = this.id.replace(/emailuser/, '');
    if(!isNaN(emailid)) {
      sendEmail(emailid);
    }
    else {
      alert('Invalid Email ID');
    }
  return false;
  });

//	$("a.external-proceed").click( function() {
//		window.open(this.href);
//		return false;
//	})
});

function sendEmail(id){
  var theURL = '/send_email.html?id=' + id;
  window.open(theURL,'SendEmail','scrollbars=yes,width=560,height=500');
}

