var newwindow;
function popupWin(url,width,height)
{
  newwindow=window.open(url,'name','width='+width+',height='+height+',resizable=yes,scrollbars=yes,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,copyhistory=yes');
  if (window.focus) {newwindow.focus()}
}

function selectSearchForm()
{
  if (document.getElementById('searchForm').style.display == 'block') {document.getElementById('searchForm').style.display = 'none';}
    else document.getElementById('searchForm').style.display = 'block';
}

function selectContent(id)
{
  // test to make sure browser is DOM compliant
  if (document.getElementById('selectContent')) {
    // curr Obj is div element with 'selectContent' id
    curr = document.getElementById('selectContent');
    for( var x = 0; x < curr.childNodes.length; x++ ) {
      if (curr.childNodes[x].nodeName.toLowerCase() == "ul") {
        // if Nodes of curr are named "ul" set new currUL Object
        currUL = curr.childNodes[x];
        for( var y = 0; y < currUL.childNodes.length; y++ ) {
          if (currUL.childNodes[y].nodeName.toLowerCase() == "li") {
            // if currUL Node is li, first child (assumed is an "a" tag) - set tab to off
            currUL.childNodes[y].firstChild.style.backgroundPosition = 'left top';
          }
        }
      }
      else if (curr.childNodes[x].nodeName.toLowerCase() == "div") {
        // if Nodes of curr are named "div" hide all the divs to init selectContent before showing id below
        curr.childNodes[x].style.display = 'none';
      }
    }
    document.getElementById('tab'+id+'Content').style.display = 'block';
    document.getElementById('tabLink'+id).style.backgroundPosition = 'left bottom';
  }
}

function selectContentInit() {
  selectContent('1');
}
//window.onload=selectContentInit;
// to display properly, selectContentInit is called near the webpage footer in the HTML body
// instead of using window.onload above...
// this is so page with "tab content" doesn't appear, then quickly hide as the page finishes loading

function tourpopup(url)
{
  newwindow=window.open(url,'tourpopup','top=32,left=32,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,width=600,height=455');
	if (window.focus) {newwindow.focus()}
}

function scrollingpopup(url,width,height)
{
  newwindow=window.open(url,'faq','width='+width+',height='+height+',status=yes,scrollbars=yes');
  if (window.focus) {newwindow.focus()}
}


  function jobpopup(theURL)
  {
    newwindow=window.open(theURL,'tourpopup','top=32,left=32,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=600,height=455');
  if (window.focus) {newwindow.focus()}
  }

function startSearch(email)
{
  self.friendinfo.location.href = "/consumer/slingshot/frsearch.php?email=" + email
}

