// determine what Browser is being used...
var navAgent=navigator.userAgent.toLowerCase(); 
var versionNumber = parseInt(navigator.appVersion); 
var is_NS = ((navAgent.indexOf('mozilla')!=-1) && (navAgent.indexOf('spoofer')==-1) 
          && (navAgent.indexOf('compatible') == -1) && (navAgent.indexOf('opera')==-1) 
          && (navAgent.indexOf('webtv')==-1)); 
var is_NS4up = (is_NS && (versionNumber >= 4)); 
var is_NS5up = (is_NS && (versionNumber >= 5)); 
var is_IE    = (navAgent.indexOf("msie") != -1); 
var is_IE4up = (is_IE  && (versionNumber >= 4)); 

if (is_NS4up) {
    adjustWidth = -4;
    adjustHeight = -4;
}
else {
    adjustHeight = 27;
    adjustWidth = 11;
}
var x  = 0;
var y  = 0;
var w  = 0;
var h  = 0;
var pic  = null;
var isDHTML = 0;
var isLayers = 0;
var isAll = 0;
var isID = 0;

// display the image in a new window
 function openit(file, title) {
  var features = "top=0,left=0,dependent=yes,resizable=yes";
  if (pic != null)
    {if (pic.closed)
       {pic = window.open("","pic",features);}
    }
  else
    {pic = window.open("","pic",features);}
  if (is_IE4up)  
    {pic.moveTo(0, 0);}
  pic.focus();
  pic.document.writeln("<HTML><HEAD>");
  if (title == null) {title = "&nbsp;";}
  pic.document.writeln('<title>'+title+'<\/title>');
  pic.document.writeln('<style type="text/css"> #pic1 {position: absolute; top: 0px; left: 0px;}<\/style>');
  pic.document.writeln("<\/HEAD>");
  pic.document.writeln("<body onLoad='opener.setUp()'>");
  pic.document.writeln("<div id='pic1'>");
  pic.document.writeln('<a href="javascript:window.close()">');
  pic.document.writeln('<IMG NAME="pic1" SRC="'+file+'" border=0 alt="">');
  pic.document.writeln("<\/a>");
  pic.document.writeln("<\/div>");
  pic.document.writeln("<\/body><\/HTML>");
  pic.document.close();
 }

// determine the height & width of the image & center the new window
 function setUp() {
  widthObj = findWidth('pic1');
  heightObj = findHeight('pic1');
  w = widthObj + adjustWidth;
  h = heightObj + adjustHeight;
  var bigger = false;
  pic.resizeTo(w, h);
  x = Math.round((screen.availWidth  - w) / 2);
  y = Math.round((screen.availHeight - h) / 2);
  pic.moveTo(x, y);
 }

// determine the actual width of the image
 function findWidth(objectID) {
    var dom = findDOM(objectID,0);
    if (dom.offsetWidth) { 
        return dom.offsetWidth;
    }
    if (dom.clip.width) {
        return dom.clip.width;
    }
    return (null);
 }
 
// determine the actual height of the image
 function findHeight(objectID) {
    var dom = findDOM(objectID,0);
    if (dom.offsetHeight)
        return dom.offsetHeight;
    if (dom.clip.height)
        return dom.clip.height;
    return (null);
 }

// open a new window full screen 
 function openFullScreen(pageid) {
    window.open(pageid,'','width='+(screen.width-27)+',height='+(screen.height-30)+',top=0,left=0,scrollbars=yes')
 }

 function findDOM(objectID,withStyle) {
    if (pic.document.getElementById) {isID = 1; isDHTML = 1;}
    else {
         if (pic.document.all) {isAll = 1; isDHTML = 1;}
         else {
              browserVersion = parseInt(navigator.appVersion);
              if ((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4)) {
                 isLayers = 1; isDHTML = 1;}
         }
    }
    
    if (withStyle == 1) {
       if (isID) { return (pic.document.getElementById(objectID).style) ; }
       else {
            if (isAll) { return (pic.document.all[objectID].style); }
            else {
                 if (isLayers) { return (pic.document.layers[objectID]); }
            };}
    }
    else {
       if (isID) { return (pic.document.getElementById(objectID)); }
       else {
            if (isAll) { return (pic.document.all[objectID]); }
            else {
                 if (isLayers) { return (pic.document.layers[objectID]); }
            };}
    }
 }

 function loadFooter(menuNumber) {
    document.write('<table border="0" cellpadding="0" cellspacing="0">')
    document.write('<tr valign="middle">')

    document.write('<td align="left" valign="bottom" width="119">')
    if ((menuNumber == 2) || 
        (menuNumber == 4) || 
        (menuNumber == 5) ||
        (menuNumber == 6) ||
        (menuNumber == 7) || 
        (menuNumber == 8) || 
        (menuNumber == 9) || 
        (menuNumber == 17)) {
       document.write('<a href="#">Back to Top<\/a>')
    }
    else {
       document.write('<br>')
    }
    document.write('<\/td>')

    document.write('<td width="40"><br><\/td>')
    document.write('<td width="581" align="center" class="footer">')

    if (menuNumber != 1) {
       document.write('<a class="footer" href="index.html">')
       document.write('Home')
       document.write('<\/a>')
    }
    else {
       document.write('Home')
    }
    document.write(' - ')

    if (menuNumber != 2) {
       document.write('<a class="footer" href="about.html">')
       document.write('About Us')
       document.write('<\/a>')
    }
    else {
       document.write('About Us')
    }
    document.write(' - ')

    if (menuNumber != 3) {
       document.write('<a class="footer" href="photos.html">')
       document.write('Free Reports')
       document.write('<\/a>')
    }
    else {
       document.write('Free Reports')
    }
    document.write(' - ')

    if (menuNumber != 4) {
       document.write('<a class="footer" href="samples.html">')
       document.write('Listings')
       document.write('<\/a>')
    }
    else {
       document.write('Listings')
    }
    document.write(' - ')

    if (menuNumber != 5) {
       document.write('<a class="footer" href="awards.html">')
       document.write('Services')
       document.write('<\/a>')
    }
    else {
       document.write('Services')
    }
    document.write(' - ')

    if (menuNumber != 6) {    
       document.write('<a class="footer" href="privacy.html">')
       document.write('Code of Ethics')
       document.write('<\/a>')
    }
    else {
       document.write('Code of Ethics')
    }
    document.write(' - ')

    if (menuNumber != 7) {
       document.write('<a class="footer" href="now.html">')
       document.write('Helpful Links')
       document.write('<\/a>')
    }
    else {
       document.write('Helpful Links')
    }
    document.write(' - ')

    if (menuNumber != 8) {
       document.write('<a class="footer" href="now.html">')
       document.write('Request Information')
       document.write('<\/a>')
    }
    else {
       document.write('Request Information')
    }

    document.write('<br>copyright &#169; 2008 Performance Business Advisors, LLC<\/td>')
    document.write('<td width="10"><br><\/td><\/tr><\/table>')
 }

 function loadMenu(menuNumber) {
   
    document.write('<table border="0" cellpadding="0" cellspacing="0">')

    document.write('<tr><td>')
    if (menuNumber != 1) {
       document.write('<a class="menu" href="index.html">')
       document.write('Home')
       document.write('<\/a>')
    }
    else {
       document.write('Home')
    }
    document.write('<\/td><\/tr>')

    document.write('<tr><td>')
    if (menuNumber != 2) {
       document.write('<a class="menu" href="about.html">')
       document.write('About Us')
       document.write('<\/a>')
    }
    else {
       document.write('About Us')
    }
    document.write('<\/td><\/tr>')

    document.write('<tr><td>')
    if (menuNumber != 3) {
       document.write('<a class="menu" href="photos.html">')
       document.write('Free Reports')
       document.write('<\/a>')
    }
    else {
       document.write('Free Reports')
    }
    document.write('<\/td><\/tr>')

    document.write('<tr><td>')
    if (menuNumber != 4) {
       document.write('<a class="menu" href="samples.html">')
       document.write('Listings')
       document.write('<\/a>')
    }
    else {
       document.write('Listings')
    }
    document.write('<\/td><\/tr>')

    document.write('<tr><td>')
    if (menuNumber != 5) {
       document.write('<a class="menu" href="mailto:kent@babborama.com">')
       document.write('Services')
       document.write('<\/a>')
    }
    else {
       document.write('Services')
    }
    document.write('<\/td><\/tr>')

    document.write('<tr><td>')
    if (menuNumber != 6) {
       document.write('<a class="menu" href="awards.html">')
       document.write('Code of Ethics')
       document.write('<\/a>')
    }
    else {
       document.write('Code of Ethics')
    }
    document.write('<\/td><\/tr>')

    document.write('<tr><td>')
    if (menuNumber != 7) {
       document.write('<a class="menu" href="privacy.html">')
       document.write('Helpful Links')
       document.write('<\/a>')
    }
    else {
       document.write('Helpful Links')
    }
    document.write('<\/td><\/tr>')

    document.write('<tr><td>')
    if (menuNumber != 8) {
       document.write('<a class="menu" href="privacy.html">')
       document.write('Request Information')
       document.write('<\/a>')
    }
    else {
       document.write('Request Information')
    }
    document.write('<\/td><\/tr>')

    document.write('<\/table>')
 }

 function loadLogo() {

    document.write('<table border="0" cellpadding="0" cellspacing="0">')
    document.write('<tr><td><img src="blank.gif" width="1" height="2" alt=""><\/td><\/tr>')
    document.write('<a href="index.html"><img src="pbalogo5.jpg" alt="PBA logo" width="40" height="37" border="0"><\/a><\/td><\/tr>')
    document.write('<tr><td><img src="blank.gif" width="1" height="1" alt=""><\/td><\/tr><\/table>')
 }

 function loadPage(menuNumber,headgif,headheight,headwidth,headalt) {
    document.write('<table border="0" cellpadding="0" cellspacing="0">')
    document.write('<tr><td colspan="3" width="735"><img src="red.gif" height="1" width="735" alt=""><\/td>')
    document.write('<td><img src="blank.gif" height="1" width="10" alt=""><\/td><\/tr>')
    document.write('<tr><td>')
    document.write('<table border="0" cellpadding="0" cellspacing="0">')
    document.write('<tr><td><img src="blank.gif" width="1" height="2" alt=""><\/td><\/tr>')
    document.write('<a href="index.html"><img src="pbalogo5.jpg" alt="PBA logo" width="256" height="154" border="0"><\/a><\/td><\/tr>')
    document.write('<tr><td><img src="blank.gif" width="1" height="1" alt=""><\/td><\/tr><\/table>')
    document.write('<\/td>')
    document.write('<td><img src="blank.gif" height="1" width="40" alt=""><\/td>')
    document.write('<td align="left" valign="middle" width="580">')
    document.write('<img src="' + headgif + '" height="' + headheight + '" width="' + headwidth + '" border="0" alt="' + headalt + '"><\/td>')
    document.write('<td><br><\/td><\/tr>')
    document.write('<tr><td colspan="3"><img src="red.gif" height="1" width="735" alt=""><\/td>')
    document.write('<td><img src="blank.gif" height="1" width="10" alt=""><\/td><\/tr>')
    document.write('<tr><td valign="top" width="115">')
   
    loadMenu(menuNumber)

    document.write('<\/td><td><br><\/td><td align="left">')
 }

 function endTable() {

    document.write('<\/td>')
    document.write('<td><br><\/td>')
    document.write('<\/tr>')
    document.write('<\/table>')
 }
 
// func isblank()parameter is string to be compared. returns true if it does not contain any 

// non-whitespace character

function isblank(strval)

{

   if (typeof(strval) == "object")

   {  objtrim(strval);

	  str = strval.value;

   }

   else

   {  str = strtrim(strval);   }



   var len = str.length;

   for (var i = 0; i < len; i++)

   {

      if (str.charAt(i) != " ")

      {

	     return false;				// If the is any non-space character, isblank() returns false

      }

   }

   return true;

}

// Alltrim function meant only for string value. Returns trimmed value

// Last Modify : 28/05/01

function strtrim(val)

{

   while('' + val.charAt(0)==' ')

   {

      val = val.substring(1,val.length);

   }



   while('' + val.charAt(val.length-1)==' ')

   {

      val = val.substring(0,val.length-1)

   }



   return val;

}

// Alltrim func when object is passed. 

// last Modify : 28/05/01

function objtrim(box)

{

   while('' + box.value.charAt(0)==' ')

   {

      box.value = box.value.substring(1,box.value.length);

   }



   while(''+box.value.charAt(box.value.length-1)==' ')

   {

      box.value = box.value.substring(0,box.value.length-1)

   }



}