// JavaScript Document

function initMenus(){

	//hide all sub menu items; this is to show the headers on the menu
	$('div#body_menu ul li ul').hide();

	// get the name of the body id
	//var getTheName = $('body').attr("id");

	// get the name of the id with the class "thispage"
	var getTheName = $('.thispage').attr('id');
	
	// check the header links and make active if page id matches name
	$('.header_link_inactive').each(
		function() {
		    var obj = $(this).attr('name');
		      if (obj == getTheName) {
		        $(this).attr('class', 'header_link');
		    }
		});
	
	// start the menu process
	// need array of menu headers with Sub Menus
		//var x = ['AboutSolaris', 'FundProfiles', 'HowtoInvest'];
		var x = ['1', '6', '10'];
	
	// go through each of the elements with .body_menu_inactive class
	// get the name and swap it with "active"
		$('.body_menu_inactive').each(
		function() {
		    var obj = $(this).attr('name');
		    if (obj == getTheName) {
		        $(this).attr('class', 'body_menu_active');
		        //alert($(this).parent());
		        //alert("hello");

		        for (i = 0; i < 3; i++) {
		            //alert(x[i] + ' ' + i);
		            //if (obj.indexOf(x[i]) != -1) 
			  if(parseInt(obj) == x[i])
			    {
		                //alert(x[i] + ' ' + i);
		                var y = x[i];
		                $('#' + y + '_ul').show();
		              
		            }
		        }
		    }
		});

        $('div#body_main_right_text2 a').click(function(){
             if($(this).attr('id')=='more'){
                 //alert('hello');
                 $('div#divPUContainer').css({
                     display: 'block'
                 });
                 $('div#divPopup').fadeIn("slow");
             };
         });


	// kill the pop up
         $("div#divClose a").click(function() {
             $('div#divPUContainer').css({display: 'none'});
             $('div#divPopup').css({ display: 'none' });
         });
            
		
	
};


$(document).ready(function() {initMenus();});