self.name="main_isssp";

function showTreeBranch(branch)
{
  var objBranch = document.getElementById(branch).style;

  if (objBranch.display == "block")
  {
    objBranch.display = "none";
  }
  else
  {
    objBranch.display = "block";
  }
}

function swapTreeFolder(folder, openimg, closedimg)
{
  var objImg = document.getElementById(folder);

  if (objImg.src.indexOf('closed.gif') > -1)
  {
    objImg.src = "images/treeicons/" + openimg;
  }
  else
  {
    objImg.src = "images/treeicons/" + closedimg;
  }
}


function MemberAlert()
{
  window.alert("This item is available only to members.\nPlease sign in to the members area, or if you are not a member, please click on 'Become A Member' to sign up for a membership.");
}


function OpenWindow(nURL)
{
  window.open('popup.asp?page=' + nURL + '&session_id=0','', 'width=450, height=480, toolbar=no, resizable=no, scrollbars=yes');
}

function OpenSmallWindow(nURL)
{
  window.open('popup.asp?page=' + nURL + '&session_id=0','', 'width=450, height=200, toolbar=no, resizable=no, scrollbars=yes');
}

function OpenCustomWindow(nURL, sTitle, nWidth, nHeight, sResizable, sScrollbars)
{
  window.open('display.asp?page=' + nURL + '&session_id=0',sTitle, 'width=' + nWidth + ', height=' + nHeight + ', toolbar=no, resizable=' + sResizable + ', scrollbars=' + sScrollbars);
}

function OpenSecureWindow(nURL)
{
  window.open('https://www.isssp.com/display.asp?page=' + nURL + '&session_id=0','', 'width=450, height=200, toolbar=no, resizable=no, scrollbars=yes');
}

function OpenSecureWindowCustom(nURL,sTitle,nWidth,nHeight,sResizable,sScrollbars)
{
  window.open('https://www.isssp.com/display.asp?page=' + nURL + '&session_id=0',sTitle, 'width=' + nWidth + ', height=' + nHeight + ', toolbar=no, resizable=' + sResizable + ', scrollbars=' + sScrollbars);
}


function OpenSecureWindowURL(nURL)
{
  window.open('https://www.isssp.com/' + nURL,'', 'width=450, height=200, toolbar=no, resizable=no, scrollbars=yes');
}

function OpenTinyWindow(nURL)
{
  window.open('justgrab.asp?page=' + nURL + '&session_id=0','', 'width=100, height=80, toolbar=no, resizable=no, scrollbars=no');
}

function ShowAbout(sTitle, sHelp)
{
  sHeight = '200';
  sTitle = sTitle + ' - About';
  sExplanation = sHelp;

  thisHelp = window.open('', '', 'width=720, height=' + sHeight + ', toolbar=no, resizable=no, scrollbars=yes');
  thisHelp.document.write('<title>' + sTitle + '</title><p>');

  thisHelp.document.write('<table border=0 cellspacing=0 cellpadding=0 width=100%>');
  thisHelp.document.write('<tr>');
  thisHelp.document.write('<td align=left height=69 width=600 background="Images/ISSSP-Header.gif">&nbsp;</td>');
  thisHelp.document.write('</tr>');
  thisHelp.document.write('</table><p>');
  thisHelp.document.write(sExplanation);
  thisHelp.document.bgColor='#FFFFFF';
  thisHelp.document.close();
}

function ShowViewerPopup(sTitle, sMessage, vWidth, vHeight, vCols, vRows)
{
  if (document.all) // Likely IE browser
  {
    xMax = document.body.clientWidth;
    yMax = document.body.clientHeight;
    xOffset = window.screenLeft;
    yOffset = window.screenTop;
  }
  else
  {
    if (document.getElementById) // Likely Mozilla/Netscape browser
    {
      xMax = window.outerWidth;
      yMax = window.outerHeight;
      xOffset = window.screenX;
      yOffset = window.screenY;
    }
    else // All others...
    {
      xMax = 800;
      yMax = 600;
      xOffset = 0;
      yOffset = 0;
    }
  }

  xOffset = xOffset + (xMax - vWidth) / 2;
  yOffset = yOffset + (yMax - vHeight) / 2;

  thisPopup = window.open('', '', 'width=' + vWidth + ', height=' + vHeight + ', screenX=' + xOffset + ', screenY=' + yOffset + ', top=' + yOffset + ', left=' + xOffset + ', toolbar=no, resizable=no, scrollbars=yes');

  thisPopup.document.write('<title>' + sTitle + '</title><p>');

  thisPopup.document.write('<table border=0 cellspacing=0 cellpadding=0 width=100%>');
  thisPopup.document.write('<tr>');
  thisPopup.document.write('<td align=left height=69 width=600 background="Images/ISSSP-Header.gif">&nbsp;</td>');
  thisPopup.document.write('</tr>');
  thisPopup.document.write('</table><p>');

  thisPopup.document.write('<center><b>' + sTitle + '</b><p>');
  thisPopup.document.write('<textarea cols=' + vCols + ' rows=' + vRows + '>' + sMessage + '</textarea>');
  thisPopup.document.write('</center>');

  thisPopup.document.close();
}

function ShowMessageBoxDialog(sTitle, sMessage, vStyle, vWidth, vHeight, sCallback)
{
  sWord1 = 'OK';
  sWord2 = '';
  sAlign = 'center';
  sType = '';

  vQuo = vStyle;

  if (vQuo & 1)
  {
    sWord1 = 'OK';
    sWord2 = 'Cancel';
  }
  vQuo = vQuo >> 1;

  if (vQuo & 1)
  {
    sWord1 = 'Yes';
    sWord2 = 'No';
  }
  vQuo = vQuo >> 1;

  if (vQuo & 1)
  {
    sWord1 = 'OK';
    sWord2 = '';
  }
  vQuo = vQuo >> 1;

  if (vQuo & 1)
  {
    sWord1 = 'OK';
    sWord2 = '';
  }
  vQuo = vQuo >> 1;

  if (vQuo & 1)
  {
    sAlign = 'left';
  }
  vQuo = vQuo >> 1;

  if (vQuo & 1)
  {
    sAlign = 'center';
  }
  vQuo = vQuo >> 1;

  if (vQuo & 1)
  {
    sAlign = 'right';
  }
  vQuo = vQuo >> 1;

  if (vQuo & 1)
  {
    sType = 'warning_32.gif';
  }
  vQuo = vQuo >> 1;

  if (vQuo & 1)
  {
    sType = 'help_32.gif';
  }
  vQuo = vQuo >> 1;

  if (vQuo & 1)
  {
    sType = 'info_32.gif';
  }
  vQuo = vQuo >> 1;

  if (document.all) // Likely IE browser
  {
    xMax = document.body.clientWidth;
    yMax = document.body.clientHeight;
    xOffset = window.screenLeft;
    yOffset = window.screenTop;
  }
  else
  {
    if (document.getElementById) // Likely Mozilla/Netscape browser
    {
      xMax = window.outerWidth;
      yMax = window.outerHeight;
      xOffset = window.screenX;
      yOffset = window.screenY;
    }
    else // All others...
    {
      xMax = 800;
      yMax = 600;
      xOffset = 0;
      yOffset = 0;
    }
  }

  xOffset = xOffset + (xMax - vWidth) / 2;
  yOffset = yOffset + (yMax - vHeight) / 2;

  thisDialog = window.open('', '', 'width=' + vWidth + ', height=' + vHeight + ', screenX=' + xOffset + ', screenY=' + yOffset + ', top=' + yOffset + ', left=' + xOffset + ', toolbar=no, resizable=no, scrollbars=no');
  thisDialog.document.bgColor='#FFFFFF';
  thisDialog.document.write('<title>' + sTitle + '</title><p>');
  thisDialog.document.write('<form method="post" action="">');  
  thisDialog.document.write('<center><table width=100%>');

  thisDialog.document.write('<tr>');
  thisDialog.document.write('<td colspan=2 align=' + sAlign + '>');
  
  if (sType != '')
  {
    thisDialog.document.write('<img src="images/buttons/' + sType + '"></img>&nbsp;&nbsp;&nbsp;');
  }

  thisDialog.document.write(sMessage + '</td>');
  thisDialog.document.write('</tr>');

  thisDialog.document.write('<tr>');
  thisDialog.document.write('<td colspan=2>&nbsp;</td>');
  thisDialog.document.write('</tr>');

  thisDialog.document.write('<tr>');
  
  if (sWord1 != '' && sWord2 != '')
  {  
    thisDialog.document.write('<td width=50% align=center>');
  }
  else
  {
    thisDialog.document.write('<td colspan=2 align=center>');
  }

  if (sCallback != '')
  {
    sButton = "<button style='width: 75px;' type='submit' name='submit' ";
    sButton = sButton + "onclick='javascript:opener.location.href=";
    sButton = sButton + '"' + sCallback + '"';
    sButton = sButton + "; self.close();'>";
  }
  else
  {
    sButton = "<button style='width: 75px;' type='submit' name='submit' ";
    sButton = sButton + "onclick='javascript:self.close();'>";
  }

  thisDialog.document.write(sButton + sWord1 + '</button></td>');

  if (sWord2 != '')
  {  
      thisDialog.document.write('<td width=50% align=center>');
      thisDialog.document.write('<button style="width: 75px;" onclick="javascript:self.close()">' + sWord2 + '</button></td>');
  }

  thisDialog.document.write('</tr>');

  thisDialog.document.write('</table></center>');
  thisDialog.document.write('</form>');  
  thisDialog.document.close();
}


function Show(obj,obj2)
{
  //if(document.all)
    obj.style.visibility='visible';
    if(obj2){
    	var ob=document.getElementById(obj2);
    	ob.style.visibility='visible';
    }
  //else
  //  obj.visibility='show';
  return true;
}

function Hide(obj,obj2)
{
  //if(document.all)
   if(obj2){
    	var ob=document.getElementById(obj2);
    	ob.style.visibility='hidden'; 
    }
   obj.style.visibility='hidden';
   
  //else
  //  obj.visibility='hide';
  return true;
}

function Hilight(obj, linkobj)
{
  if(document.all)
  {
    obj.style.background='white';
    linkobj.style.color='#183979';
//    linkobj.focus();
  }
}

function UnHilight(obj, linkobj)
{
  if(document.all)
  {
    obj.style.background='#183979';
    linkobj.style.color='white';
//    obj.focus();
  }
}

function UnhilightAllBut(obj)
{
}

function HideAllBut(obj)
{
  if(document.all) // IE
  {

    if(obj.id != document.all["menu1"].id) document.all["menu1"].style.visibility='hidden';

    if(obj.id != document.all["menu2"].id) document.all["menu2"].style.visibility='hidden';

    if(obj.id != document.all["menu3"].id) document.all["menu3"].style.visibility='hidden';

    if(obj.id != document.all["menu4"].id) document.all["menu4"].style.visibility='hidden';

    if(obj.id != document.all["menu5"].id) document.all["menu5"].style.visibility='hidden';

    if(obj.id != document.all["menu6"].id) document.all["menu6"].style.visibility='hidden';

    if(obj.id != document.all["menu7"].id) document.all["menu7"].style.visibility='hidden';
    
    if(obj.id != document.all["menu8"].id) document.all["menu8"].style.visibility='hidden';
    
  }
  else // NS
  {

    if(obj.name != "menu1") menu1.style.visibility='hidden';

    if(obj.name != "menu2") menu2.style.visibility='hidden';

    if(obj.name != "menu3") menu3.style.visibility='hidden';

    if(obj.name != "menu4") menu4.style.visibility='hidden';

    if(obj.name != "menu5") menu5.style.visibility='hidden';

    if(obj.name != "menu6") menu6.style.visibility='hidden';

    if(obj.name != "menu7") menu7.style.visibility='hidden';
    
    if(obj.name != "menu8") menu8.style.visibility='hidden';


  }
  return true;
}

function ClearSelect(obj)
{
  while(obj.options.count)
    obj.options.remove(0);
}
