var ls = 161;	// 161 if using default margins   // 151 if no margins

document.writeln(''
+'<SCRIPT language=javascript>'
+' new ypSlideOutMenu("menuPP",      "right", ls, 0, 300, 450);'
+' new ypSlideOutMenu("menuDL",      "right", ls, 0, 300, 450);'
+' new ypSlideOutMenu("menuHelp",    "right", ls, 0, 300, 450);'	// 161, 0, 300, 800
+' new ypSlideOutMenu("menuContact", "right", ls, 0, 300, 450);'
+' new ypSlideOutMenu("menuPlugins", "right", ls, 0, 300, 450);'
+' new ypSlideOutMenu("menuArticles", "right", ls, 0, 300, 500);'
+'</SCRIPT>'
);



function PrintMenus()
{
var d = document;


// algorithm to determine height: 18px * (rows) + 2

strDomain = document.domain;
if (strDomain.indexOf("www.") == 0 || strDomain.indexOf("poppeeper.com") == 0)
  strDomain = "";
else
  strDomain = "http://www.poppeeper.com";

// change so that it would work with poppeeper.server313.com
strDomain = "";


// POP PEEPER
d.writeln(''
+'<DIV class=menuContainer id=menuPPContainer>'
+'<DIV class=menu id=menuPPContent>'
+'<DIV class=menuInsert style="HEIGHT: 91px">'
+'<TABLE class=menuTable cellSpacing=0 cellPadding=2 border=0 width=100%>'
+'  <TBODY>'
+'  <TR>'
+ GetTd("t1_0", strDomain+"/", "POP Peeper Home", false) // true
+'  </TR>'
+'  <TR>'
+ GetTd("t1_1", strDomain+"/screenshots.php", "Screenshots", false)
+'  </TR>'
+'  <TR>'
+ GetTd("t1_2", strDomain+"/whatscoming.php", "What's Coming", false)
+'  </TR>'
+'  <TR>'
+ GetTd("t1_3", strDomain+"/whatsnew.php", "Version History", false)
+'  </TR>'
+'  <TR>'
+ GetTd("t1_4", strDomain+"/knownissues.php", "Known Issues", false)
+'  </TR>'
+'  </tbody>'
+'</table>'
+'</div></div></div>'
);

// DOWNLOAD
d.writeln(''
+'<DIV class=menuContainer id=menuDLContainer>'
+'<DIV class=menu id=menuDLContent>'
+'<DIV class=menuInsert style="HEIGHT: 38px">'
+'<TABLE class=menuTable cellSpacing=0 cellPadding=2 border=0 width=100%>'
+'  <TBODY>'
+'  <TR>'
+ GetTd("t2_0", strDomain+"/download.php", "Download POP Peeper", false) // true
+'  </TR>'
+'  <TR>'
+ GetTd("t2_5", strDomain+"/languages.php", "Languages", false)
+'  </TR>'
+'  </tbody>'
+'</table>'
+'</div></div></div>'
);



// HELP
d.writeln(''
+'<DIV class=menuContainer id=menuHelpContainer>'
+'<DIV class=menu id=menuHelpContent>'
+'<DIV class=menuInsert style="HEIGHT: 73px">'
+'<TABLE class=menuTable cellSpacing=0 cellPadding=2 border=0 width=100%>'
+'  <TBODY>'
+'  <TR>'
//+'    <TD class=menuTitle><b>Help</b></TD>'
+ GetTd("t3_0", strDomain+"/Help/", "Help", false) // true
+'  </TR>'
+'  <TR>'
+ GetTd("t3_1", strDomain+"/Help/starting.php", "Getting Started", false)
+'  </TR>'
//+'  <TR>'
//+ GetTd("t3_2", strDomain+"/Help/advanced.php", "Advanced", false)
//+'  </TR>'
+'  <TR>'
+ GetTd("t3_3", strDomain+"/Help/tweaks.php", "Tips", false)
+'  </TR>'
+'  <TR>'
+ GetTd("t3_4", strDomain+"/Help/icons.php", "Icons", false)
+'  </TR>'
//+'  <TR>'
//+ GetTd("t3_5", strDomain+"/Help/troubleshooting.php", "Troubleshooting", false)
//+'  </TR>'
+'  </tbody>'
+'</table>'
+'</div></div></div>'
);



// CONTACT
d.writeln(''
+'<DIV class=menuContainer id=menuContactContainer>'
+'<DIV class=menu id=menuContactContent>'
+'<DIV class=menuInsert style="HEIGHT: 56px">'
+'<TABLE class=menuTable cellSpacing=0 cellPadding=2 border=0 width=100%>'
+'  <TBODY>'
+'  <TR>'
+ GetTd("t4_0", strDomain+"/contact.php", "Contact", false) // true
+'  </TR>'
+'  <TR>'
+ GetTd("t4_1", strDomain+"/maillist.php", "Mailing List", false)
+'  </TR>'
+'  <TR>'
+ GetTd("t4_2", strDomain+"/donation.php", "Donations", false)
+'  </TR>'
+'  </tbody>'
+'</table>'
+'</div></div></div>'
);



// PLUGINS
d.writeln(''
+'<DIV class=menuContainer id=menuPluginsContainer>'
+'<DIV class=menu id=menuPluginsContent>'
+'<DIV class=menuInsert style="HEIGHT: 128px">'
//+'<DIV class=menuInsert style="HEIGHT: 92px">'
+'<TABLE class=menuTable cellSpacing=0 cellPadding=2 border=0 width=100%>'
+'  <TBODY>'
+'  <TR>'
+ GetTd("t5_0", strDomain+"/Plugins/", "Plugins", false) // true
+'  </TR>'
+'  <TR>'
+ GetTd("t5_1", strDomain+"/PPTweaker/", "PPTweaker", false)
+'  </TR>'
+'  <TR>'
+ GetTd("t5_2", strDomain+"/Plugins/notify.php", "Notification", false)
+'  </TR>'
+'  <TR>'
+ GetTd("t5_3", strDomain+"/Skins/", "&bull; Notification Skins", false)
+'  </TR>'
+'  <TR>'
+ GetTd("t5_4", strDomain+"/addonpack.php", "Premium Add-on Pack", false)
+'  </TR>'

+'  <TR>'
+ GetTd("t5_5", strDomain+"/Plugins/webmail.php", "WebMail", false)
+'  </TR>'
+'  <TR>'
+ GetTd("t5_6", strDomain+"/Plugins/ssl.php", "SSL", false)
+'  </TR>'
+'  </tbody>'
+'</table>'
+'</div></div></div>'
);


// ARTICLES
d.writeln(''
+'<DIV class=menuContainer id=menuArticlesContainer>'
+'<DIV class=menu id=menuArticlesContent>'
+'<DIV class=menuInsert style="HEIGHT: 56px">'
+'<TABLE class=menuTable cellSpacing=0 cellPadding=2 border=0 width=100%>'
+'  <TBODY>'
+'  <TR>'
+ GetTd("t6_0", strDomain+"/Articles/", "Articles", false) // true
+'  </TR>'
+'  <TR>'
+ GetTd("t6_1", strDomain+"/Articles/mspchart.php", "EMail Providers", false)
+'  </TR>'
+'  <TR>'
+ GetTd("t6_2", strDomain+"/Articles/basics.php", "EMail Basics", false)
+'  </TR>'
+'  </tbody>'
+'</table>'
+'</div></div></div>'
);

}




function changeColor(blnOver, target, textid, strMenuLink)
{
  target.className = blnOver ? "menuOver" : "menuUnder";
  document.getElementById(textid).className = blnOver ? "menuTextOver" : strMenuLink;
}



function SetStatus(strHref)
{
  // better way...?
  var strHrefDisplay = strHref;
  if (strHref.substr(0,4) != "http")
  {
    strHrefDisplay = location.protocol + "//" + location.host;
    if (strHref.substr(0,1) != "/")
    {
       strPath = location.pathname;
       var index = strPath.lastIndexOf("/");
       strPath = strPath.substr(0, index);
       strHrefDisplay += strPath;
       strHrefDisplay += "/"
    }
    strHrefDisplay += strHref;
  }

  window.status = strHrefDisplay;
}

function GetTd(strItem, strHref, strDesc, bTitle)
{
  var strLinkClass = "menuLink";
  if (bTitle) strLinkClass = "menuLinkTitle";

  var str = '    '
       + (bTitle ? '<TD class=menuTitle ' : '<TD class=menuData ')
       + 'onmouseover="changeColor(true, this, \''+strItem+'\', \''+strLinkClass+'\'); SetStatus(\''+strHref+'\');" '
       + 'onmouseout="changeColor(false, this, \''+strItem+'\', \''+strLinkClass+'\'); window.status=\'\';" '
+ 'onclick="location.href=\''+strHref+'\'; return false;" '
       + '> '
       + '<A id='+strItem+' class=' + strLinkClass + ' href="'+strHref+'">'
       + (bTitle ? '<b>' : '')
       + strDesc
       + (bTitle ? '</b>' : '')
       + '</A></TD>';

  return str;
}

