//  Jayakar - SPAR Capital 
//  Header Inclusion Script for nav: Set up grayed-out/NAV btn
//  Context Menu also included & Pop Window
//  SPAR1headIncl.js 

/* Write out the banner  - - - OLD  (See below!)
document.write('<TABLE SUMMARY="MAST Banner" BORDER="0" CELLSPACING="0" CELLPADDING="0" VALIGN="TOP"><TR><TD width="380"> ');
document.write('<IMG ALIGN="ABSTOP" ALT="MASTPartners.com" STYLE="border-bottom: thin solid;" id="m1" ');
document.write('SRC="images/MASTHdr4Left.gif" WIDTH="380" HEIGHT="66" BORDER="0"></TD><TD width="100%">');
document.write('<IMG ALIGN="ABSTOP" ALT=" " STYLE="border-bottom: thin solid;" ');
document.write('SRC="images/MASTHdr4Mid.gif" WIDTH="100%" HEIGHT="66" id="m2" BORDER="0"></TD><TD width="290">');
document.write('<IMG ALIGN="ABSTOP" ALT="Solutions for Profit, Asset &amp; Risk-mgmt!" STYLE="border-bottom: thin solid;" ');
document.write('SRC="images/MASTHdr4Right.gif" WIDTH="290" HEIGHT="66" id="m3" BORDER="0">');
document.write('</TD></TR></TABLE>');
*/

// Get File Name of the current Page- Used to find out
// the active page to gray out button on nav menu.
var hashend1 = (location.href.search("#") != -1) ? location.href.indexOf("#") : location.href.length;
var MASTPage_filename = location.href.slice(location.href.lastIndexOf("/")+1,hashend1);
if (MASTPage_filename == "") { MASTPage_filename = "index.html"; }

// Global Variables set HERE
// First get Date & set up Global Variables
var MASTDate=new Date();

function realclock() {
	elem9 = document.getElementById("M_clk");
	elem9.innerHTML = new Date().toString().slice(0,31);
	setTimeout("realclock();",1000);
}
var M_MenuItems = 9;                  // including 0 as the first (home page) item
var MASTDate = new Date();
var M_months = new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
var M_days = new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat");
var MASTcYear = MASTDate.getFullYear();
var MASTcMonth = M_months[MASTDate.getMonth()];
var MASTcDay = M_days[MASTDate.getDay()];
var MASTcDate = MASTDate.getDate();

// Check browser
var txt9 = "<a title='Get IE FireFox plugin - New Window' target='_blank' href='https://addons.mozilla.org/en-US/firefox/addon/10909'><span style='font: bold; color: red; border=1; border: inset #000080; padding: 2;'><b><u>FireFox Users: Get IE PlugIn</u></b></span></a><br><br> ";
var ver9 = navigator.appName;  var num9 = parseInt(navigator.appVersion); var notIE = "no"; 
if ((ver9 != "Microsoft Internet Explorer")&&(num9 >= 4)) {  notIE = "yes";  } 

function prnDate() { document.write(MASTcDay+' 	 '+MASTcMonth+' '+MASTcDate+', '+MASTcYear); }

var MASTsetupPg = 0;

// set Newsletter updated new gif 
var MASTNewsletterUpdated = "NO";
if (MASTcDate > 32)
// if (MASTcDate > 27  && MASTcDate < 12)
	MASTNewsletterUpdated = "YES";       // YES or NO only!
else 	MASTNewsletterUpdated = "NO";       // YES or NO only!

// set Links updated new gif
var MASTLinksUpdated = "YES";
if (MASTcDate > 13  &&  MASTcDate < 28)
	MASTLinksUpdated = "YES";      // YES or NO only!
else	MASTLinksUpdated = "NO";      // YES or NO only!

var MASTPhoneNum = "";
var MASTStreetAddr = "";
var MASTCityAddr = "Greenwich";
var MASTStateAddr = "CT";
var MASTZipAddr = "";
var MASTeMailAddr = "HFInfo";

function CheckActivePage(LinkName) {
// Match received Button Name with MAST Global Variable Page Name (of File)
// Idx Value returned: 1 is Active, 0 is Normal
var IdxValue = (MASTPage_filename == LinkName) ? 1 : 0 ;
return (IdxValue);
}


// START of Table NAV Load: Load Table with all HTML script/data for nav menu

// following is in order of HTML generation of nav menu table
var A_Link_TR = '<TR>';

// Open & Close Parendthesis for bottom nav
var bOpenBracket = '[';
var bCloseBracket = ']';

var A_Link_HREF = '<A class="a_nodecor" HREF="';

// followed by actual link from indexed array A_Link
//left class for left nav link behavior
var lTDCLASS_sect = new Array();
lTDCLASS_sect[0] = '<td CLASS="MASTnavl" ';
// or FOR CURRENTLY ACTIVE PAGES- GRAYED OUT BOX
lTDCLASS_sect[1] = '<td CLASS="MASTnavlAct" ';

//left class for left nav link behavior
var lACLASS_sect = new Array();
lACLASS_sect[0] = '" CLASS="MASTnavlA" ';
// or FOR CURRENTLY ACTIVE PAGES- GRAYED OUT BOX
lACLASS_sect[1] = '" CLASS="MASTnavlAAct" ';

//bottom class for bottom nav link behavior
var bCLASS_sect = new Array();
bCLASS_sect[0] = '"><SPAN CLASS="MASTnavb" ';
// or FOR CURRENTLY ACTIVE PAGES- GRAYED OUT BOX
bCLASS_sect[1] = '"><SPAN CLASS="MASTnavbAct" ';

//Top Menu class for top nav link behavior
var tTDCLASS_sect = new Array();
tTDCLASS_sect[0] = '"><span CLASS="MASTnavTop" ';
// or FOR CURRENTLY ACTIVE PAGES- GRAYED OUT BOX
tTDCLASS_sect[1] = '"><span CLASS="MASTnavTopAct" ';

var TITLE2 = ' TITLE="';

// followed by actual TITLE from indexed array A_Link

// for the left nav mouseover and ~out sections
var ONM_OVERl_sect = new Array();
ONM_OVERl_sect[0] = "\" ONMOUSEOVER=\"this.className='MASTnavlOver'; window.status='";
// or FOR CURRENTLY ACTIVE PAGES- GRAYED OUT BOX
ONM_OVERl_sect[1] = "\" ONMOUSEOVER=\"this.className='MASTnavlAct'; \"window.status='";

var ONM_OVERlA_sect = new Array();
ONM_OVERlA_sect[0] = "\" ONMOUSEOVER=\"this.className='MASTnavlAOver'; window.status='";
// or FOR CURRENTLY ACTIVE PAGES- GRAYED OUT BOX
ONM_OVERlA_sect[1] = "\" ONMOUSEOVER=\"this.className='MASTnavlAAct'; \"window.status='";

// for the bottom nav mouseover and ~out sections
var ONM_OVERb_sect = new Array();
ONM_OVERb_sect[0] = "\" ONMOUSEOVER=\"this.className='MASTnavbOver'; window.status='";
// or FOR CURRENTLY ACTIVE PAGES- GRAYED OUT BOX
ONM_OVERb_sect[1] = "\" ONMOUSEOVER=\"this.className='MASTnavbAct'; window.status='";

// for the top nav mouseover and ~out sections
var ONM_OVERt_sect = new Array();
ONM_OVERt_sect[0] = "\" ONMOUSEOVER=\"this.className='MASTnavTopOver'; window.status='";
// or FOR CURRENTLY ACTIVE PAGES- GRAYED OUT BOX
ONM_OVERt_sect[1] = "\" ONMOUSEOVER=\"this.className='MASTnavTopAct'; window.status='";

// followed by actual text of window status from array ONM_WinStat

var ONM_OVER_return = "';return true;\" ";

var ONM_OUTl_sect = new Array();
ONM_OUTl_sect[0] = " ONMOUSEOUT=\"this.className='MASTnavl'; window.status='";
// or FOR CURRENTLY ACTIVE PAGES- GRAYED OUT BOX
ONM_OUTl_sect[1] = " ONMOUSEOUT=\"window.status='";

var ONM_OUTlA_sect = new Array();
ONM_OUTlA_sect[0] = " ONMOUSEOUT=\"this.className='MASTnavlA'; window.status='";
// or FOR CURRENTLY ACTIVE PAGES- GRAYED OUT BOX
ONM_OUTlA_sect[1] = " ONMOUSEOUT=\"window.status='";

var ONM_OUTb_sect = new Array();
ONM_OUTb_sect[0] = " ONMOUSEOUT=\"this.className='MASTnavb'; window.status='";
// or FOR CURRENTLY ACTIVE PAGES- GRAYED OUT BOX
ONM_OUTb_sect[1] = " ONMOUSEOUT=\"window.status='";

var ONM_OUTt_sect = new Array();
ONM_OUTt_sect[0] = " ONMOUSEOUT=\"this.className='MASTnavTop'; window.status='";
// or FOR CURRENTLY ACTIVE PAGES- GRAYED OUT BOX
ONM_OUTt_sect[1] = " ONMOUSEOUT=\"window.status='";

var ONM_OUT_return = "';return true;\">";

// followed by actual text of Button/Link from array Link_text

// Different Font color for Home Page Button ONLY: only if not active [else grayed out]
var ChgHmPgFont = new Array();
ChgHmPgFont[0] = '<FONT COLOR="#00aa33">';
// or FOR CURRENTLY ACTIVE PAGES- GRAYED OUT BOX
ChgHmPgFont[1] = '';

var A_Link_EndTD = '</TD>';
var A_Link_EndTR = '</TR>';

var A_Link_EndSPAN = '</SPAN>';
var A_Link_EndA = '</A>';

//  
// ARRAYs OF ALL ABOVE(left and bottom) nav BUTTONs
var A_Link = new Array();
var ATitle = new Array();
var ONM_WinStat = new Array();
var Link_text = new Array();

A_Link[0] = 'index.html';
ATitle[0] = 'MAST Partners Home Page';
ONM_WinStat[0] = 'MAST Partners Home Page';
Link_text[0] = 'MAST Home';

A_Link[1] = 'HedgeFund.htm';
ATitle[1] = ' Some Basic and detailed Hedge Fund Information';
ONM_WinStat[1] = 'Hedge Fund Information for potential Investors';
Link_text[1] = 'What is a Hedge Fund?';

A_Link[2] = 'FAQs.htm';
ATitle[2] = 'FAQs about Hedge Funds';
ONM_WinStat[2] = 'FAQs about Hedge Funds and MAST Partners';
Link_text[2] = 'H/F FAQs';

A_Link[3] = 'StartHedge.htm';
ATitle[3] = 'Start/Setup a Hedge Fund!';
ONM_WinStat[3] = 'Start your own Hedge Fund and become a PROFITABLE Hedge Fund Manager!';
Link_text[3] = 'How to Start a H/F';

A_Link[4] = 'OtherInfo.htm';
ATitle[4] = 'OffShore / Corporate / Institutions / Partners / Affiliates / Others, etc.';
ONM_WinStat[4] = 'OffShore / Corporate / Institutions / Partners / Affiliates, etc.';
Link_text[4] = 'OffShore / Other . . .';

A_Link[5] = 'Links.htm';
ATitle[5] = 'Some Interesting Links on the Web!';
ONM_WinStat[5] = 'Some Interesting Links on the Web!';
Link_text[5] = 'Web Links';

A_Link[6] = 'Login.shtml';
ATitle[6] = 'Login to MASTPartners.com';
ONM_WinStat[6] = 'Login to MASTPartners.com';
Link_text[6] = 'Login';

A_Link[7] = 'AboutMAST.htm';
ATitle[7] = 'All About MAST Partners';
ONM_WinStat[7] = 'All About MAST Partners';
Link_text[7] = 'About MAST';

A_Link[8] = 'ContactMAST.htm';
ATitle[8] = 'Contact MAST Partners!';
ONM_WinStat[8] = 'Contact MAST Partners!';
Link_text[8] = 'Contact Us';

A_Link[9] = 'SiteHelp.htm';
ATitle[9] = 'HELP! MAST WebSite Assistance!';
ONM_WinStat[9] = 'HELP! MAST WebSite Assistance!';
Link_text[9] = 'H E L P !';


function writeTopMenu (navIdx,topLinkText) {
	navIdx = navIdx * 1;
	ThisPageActiveIdx = CheckActivePage(A_Link[navIdx]);   // 0 is FALSE; 1 is TRUE[This page IS Active]

	document.write('<td>'); 
	document.write(A_Link_HREF);
	// current page gets # for itself
	if (ThisPageActiveIdx == 0) document.write(A_Link[navIdx]); else document.write("#");
	document.write(tTDCLASS_sect[ThisPageActiveIdx]);
	document.write(TITLE2);
	document.write(ATitle[navIdx]);
	document.write(ONM_OVERt_sect[ThisPageActiveIdx]);
	document.write(ONM_WinStat[navIdx]);
	document.write(ONM_OVER_return);
	document.write(ONM_OUTt_sect[ThisPageActiveIdx]);
	document.write(ONM_OUT_return);
	if (navIdx == 0) document.write(ChgHmPgFont[ThisPageActiveIdx]);
	document.write(topLinkText);
	document.write('</SPAN></A></td>');

} 	//  END of function

// Write out the Banner  - NEW 
document.write('<TABLE SUMMARY="MAST Banner" CELLSPACING="0" CELLPADDING="0" WIDTH="100%" style="border: solid #000066;"><TR>');

document.write('<TD height="30" width="300" style="background-color: navy; color: white;"> ');
document.write('<img border="0"src="images/MASTLetthd1.gif" alt="MASTPartners" style="vertical-align: bottom;" width="282" height="27"></TD>');
document.write('<TD height="30" style="background-color: navy;"><img src="images/MAST100x16px.gif" border="0" width="100%" height="15"></TD>');
document.write('<TD height="30" width="300" style="text-align: right; vertical-align: bottom; background-color: navy; color: gold">');
document.write('<img border="0"src="images/MASTLetthd3.gif" alt="MASTPartners" style="vertical-align: bottom;" width="285" height="15"></TD></TR>');

document.write('<TR><TD height="22" style="background-color: silver; vertical-align: bottom;" colspan="2">');
// Left side of header menu
document.write('<table cellspacing="2" cellpadding="0" border="0" style="font: Times, serif;" class="MASTnormal"><tr>');



// document.write('<div id="tm1" style="position: absolute; left: 13px; top: 48px; z-index: 9"> ');
// document.write('<table CELLSPACING="4" CELLPADDING="0" VALIGN="TOP" ALIGN="LEFT" SUMMARY="TopMenu"><tr> ');
writeTopMenu(0,"&nbsp;Home&nbsp;");
writeTopMenu(3,"&nbsp;Start H/F&nbsp;");
writeTopMenu(2,"&nbsp;FAQs&nbsp;");
writeTopMenu(4,"&nbsp;OffShore&nbsp;");

document.write('</tr></table></TD><TD height="22" style="text-align: right; vertical-align: bottom; background-color: silver;" colspan="2">');

// Right side of header menu
document.write('<table cellspacing="2" cellpadding="0" border="0" style="font: Times, serif;"  class="MASTnormal" align="right"><tr>');


//document.write('</tr></table></div>');
//document.write('<div id="tm2" style="position: absolute; right 10px; top: 48px; z-index: 9"> ');
//document.write('<table CELLSPACING="4" CELLPADDING="0" VALIGN="TOP" ALIGN="RIGHT" SUMMARY="TopMenu2"><tr>');
writeTopMenu(6,"&nbsp;Login&nbsp;");
writeTopMenu(8,"&nbsp;Contact&nbsp;");
writeTopMenu(9,"&nbsp;Help !&nbsp;");
//document.write('<td></td></tr></table></div>');
document.write('</tr></table></TD></TR></TABLE>');



// END of nav Table Load


// Set window location to real website address -debug required!
//  if (parent.location.href == self.location.href){parent.location.href = "index.html"} else
//  top.location.href = "http://www.mastpartners.com/"+MASTPage_filename;

// eMail addresses on the fly
function mailMast(addr1,title1,linkWords1,subject1) {
// USAGE: <script>mailMast('eMailAddr','Title that is visible when cursor is over link','Words that appear in HTML link','Re: Starting a HF');</s cript>
// USAGE: <script>mailMast('HFInfo','Contact MAST Partners by eMail','eMail MAST Partners','FAQs Inquiry');</s cript>
	document.write('<A HREF="mailto:'+addr1+'&#64;'+'MAST'+'Partners.com?subject='+subject1+' " TITLE="'+title1+'">'+linkWords1+'</A>');
}



//  END of SCRIPT

