function toggleLayer( whichLayer )
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here
  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
  vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}

function checkInput(whichLayer)
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.value;
  if(vis.length > 0)
  {
    document.commentform.submit();
  }
  else
  {
    alert('Comment cannot be blank');
  }
}
function checkInput2(whichLayer,whichLayer2)
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.value;
  
  var elem2, vis2;
  if( document.getElementById ) // this is the way the standards work
    elem2 = document.getElementById( whichLayer2 );
  else if( document.all ) // this is the way old msie versions work
      elem2 = document.all[whichLayer2];
  else if( document.layers ) // this is the way nn4 works
    elem2 = document.layers[whichLayer2];
  vis2 = elem2.value;
  if(vis.length > 0 && vis2.length > 0)
  {
    document.commentform.submit();
    alert('You are not a registered user so your comment is still subject for approval.  Your comment will show up as soon as it is approved');
  }
  else
  {
    alert('Name and Comment cannot be blank');
  }
}
function checkInputForum(whichLayer)
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.value;
  if(vis.length > 0)
  {
    document.forumpost.submit();
  }
  else
  {
    alert('Message cannot be blank');
  }
}
function checkInputForum2(whichLayer,whichLayer2)
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.value;
  
  var elem2, vis2;
  if( document.getElementById ) // this is the way the standards work
    elem2 = document.getElementById( whichLayer2 );
  else if( document.all ) // this is the way old msie versions work
      elem2 = document.all[whichLayer2];
  else if( document.layers ) // this is the way nn4 works
    elem2 = document.layers[whichLayer2];
  vis2 = elem2.value;
  if(vis.length > 0 && vis2.length > 0)
  {
    document.editTopic.submit();
  }
  else
  {
    alert('Title and Description cannot be blank');
  }
}
function checkInputForum3(whichLayer,whichLayer2,whichLayer3)
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.value;
  
  var elem2, vis2;
  if( document.getElementById ) // this is the way the standards work
    elem2 = document.getElementById( whichLayer2 );
  else if( document.all ) // this is the way old msie versions work
      elem2 = document.all[whichLayer2];
  else if( document.layers ) // this is the way nn4 works
    elem2 = document.layers[whichLayer2];
  vis2 = elem2.value;
  
  var elem3, vis3;
  if( document.getElementById ) // this is the way the standards work
    elem3 = document.getElementById( whichLayer3 );
  else if( document.all ) // this is the way old msie versions work
      elem3 = document.all[whichLayer3];
  else if( document.layers ) // this is the way nn4 works
    elem3 = document.layers[whichLayer3];
  vis3 = elem3.value;
  
  if(vis.length > 0 && vis2.length > 0 && vis3.length > 0)
  {
    document.addTopic.submit();
  }
  else
  {
    alert('Title, description and message cannot be blank');
  }
}
function checkInputForum4(whichLayer)
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.value;
  if(vis.length > 0)
  {
    document[whichLayer].submit();
  }
  else
  {
    alert('Message cannot be blank');
  }
}

maxL=500;
var bName = navigator.appName;
function taLimit(taObj) {
	if (taObj.value.length==maxL) return false;
	return true;
}

function taCount(taObj,Cnt) { 
	objCnt=createObject(Cnt);
	objVal=taObj.value;
	if (objVal.length>maxL) objVal=objVal.substring(0,maxL);
	if (objCnt) {
		if(bName == "Netscape"){	
			objCnt.textContent=maxL-objVal.length;}
		else{objCnt.innerText=maxL-objVal.length;}
	}
	return true;
}
function createObject(objId) {
	if (document.getElementById) return document.getElementById(objId);
	else if (document.layers) return eval("document." + objId);
	else if (document.all) return eval("document.all." + objId);
	else return eval("document." + objId);
}