function conLayer(LayerName) {
  var id = document.getElementById(LayerName);
  if (id.style.display == 'none') id.style.display = "";
  else id.style.display = "none";
}
function xLayerValue(LayerName) {
  var id = document.getElementById(LayerName);
  if (id.style.display == 'none') return 0;
  else return 1;
}
function xLayer(LayerName) {
  var id = document.getElementById(LayerName);
  var imidup = document.getElementById(LayerName+'_up');
  var imiddown = document.getElementById(LayerName+'_down');
  var imidtl = document.getElementById(LayerName+'_tl');
  var imidtlalt = document.getElementById(LayerName+'_tlalt');
  var imidtr = document.getElementById(LayerName+'_tr');
  var imidtralt = document.getElementById(LayerName+'_tralt');
  if (id.style.display == 'none') {
	  id.style.display = "";
	  eval("document.forms.expandable.table"+LayerName+".value=1;");
  }
  else {
	  id.style.display = "none";
	  eval("document.forms.expandable.table"+LayerName+".value=0;");
  }
  if (imidup.style.display == 'none') { 
	  imidup.style.display = "";
	  imiddown.style.display = "none";
	  
	  imidtl.style.display = "";
 	  imidtlalt.style.display = "none";

 	  imidtr.style.display = "";
 	  imidtralt.style.display = "none";
  }
  else {	  
	  imiddown.style.display = "";
	  imidup.style.display = "none";
	  
	  imidtlalt.style.display = "";
  	  imidtl.style.display = "none";
 	  
	  imidtralt.style.display = "";
   	  imidtr.style.display = "none";
   }
}
  function HideLayer(LayerName) {
    var id = document.getElementById(LayerName);
    id.style.visibility = "hidden";
  }
  
  function ShowLayer(LayerName) {
    var id = document.getElementById(LayerName);
    id.style.visibility = "visible";
  }
  
  function Account_Tabs(tabname) {
	  var id = document.getElementById(tabname);
	  document.getElementById('home').style.visibility = "hidden";
	  document.getElementById('webboard').style.visibility = "hidden";
	  document.getElementById('display').style.visibility = "hidden";
	  document.getElementById('profile').style.visibility = "hidden";
	  id.style.visibility = "visible";
  }
  
  function UpdateLayer(LayerName) {
    var id = document.getElementById(LayerName);
    
    if (document.body.scrollLeft + 200 > document.body.clientWidth) {
      id.style.left = event.clientX + document.body.scrollLeft - 215;
    }
	  else {
	    id.style.left = event.clientX + document.body.scrollLeft + 15;
	  }
    id.style.top = event.clientY + document.body.scrollTop - 5;
  }

  function breakOutFrames() {
	  if (window != top) top.location.href = location.href;
	  //below is to halt animated gifs on entire page (made because of lame avatars)
	  //document.execCommand('Stop');
  }

  function previewSignature() {
    var x = parseInt((screen.availWidth - 550) / 2);
    var y = parseInt((screen.availHeight - 360) / 2);
    window.open("", "signaturePreview", "top=" + y + ",left=" + x + ",scrollbars=yes,toolbar=no,menubar=no,location=no,resizable=yes,width=550,height=360");

    var ds = document.forms.sigPreview; 
    ds.signature.value = document.forms.webboard.signature.value;
    ds.target = "signaturePreview";
    ds.submit();
  }
  
  function viewCodeSnippet(id) {
    var x = parseInt((screen.availWidth - 450) / 2);
    var y = parseInt((screen.availHeight - 460) / 2);
    var url = "/download.php?type=0&id=" + id;
    window.open(url, "snippet", "top=" + y + ",left=" + x + ",scrollbars=yes,toolbar=no,menubar=no,location=no,resizable=yes,width=450,height=460");
  }
  
  function viewBoardSuggest() {
    var x = parseInt((screen.availWidth - 450) / 2);
    var y = parseInt((screen.availHeight - 460) / 2);
    var url = "/boardsuggest.html";
    window.open(url, "suggest", "top=" + y + ",left=" + x + ",scrollbars=yes,toolbar=no,menubar=no,location=no,resizable=yes,width=450,height=460");
  }
  
  function doPic(imgName) {
    imgOn = ("" + imgName);
    document.images['mainpic'].src = imgOn;
  }
  
  function doIcon(iconName) {
	  document.images['icon_img'].src = "icon/" + iconName;
	  
    var ico = document.forms.webboard.icon;
    
    if (ico.value != iconName) {
      for (i = 0; i < ico.length; i++) {
        if (ico.options[i].value == iconName) {
          ico.options[i].selected = true;
          break;
        }
      }
    }
  }
  
  function showIcons() {
    var x = parseInt((screen.availWidth - 620) / 2);
    var y = parseInt((screen.availHeight - 460) / 2);
    window.open("icons.php", "icon_choose", "top=" + y + ",left=" + x + ",scrollbars=yes,toolbar=no,menubar=no,location=no,resizable=yes,width=620,height=460");
  }

  function FindCSSRule(RuleName) {
    var i, r;
    for (i = 0; i < document.styleSheets[0].rules.length; i++) {
      c = document.styleSheets[0].rules.item(i).selectorText;
      if (c == RuleName) {
        return document.styleSheets[0].rules.item(i);
        break;
      }
    }
    return false;
  }
  
  function highlight(obj) {    
    obj.style.backgroundColor = ColorSiteMainLite;
  }
  
  function revert(obj) {
    obj.style.backgroundColor = ColorSiteMain;
  }

  function mClick(src) {
    if (event.srcElement.tagName == "TD") src.children.tags('LI')[0].children.tags('A')[0].click();
  }

  function forumHelp() {
    var x = parseInt((screen.availWidth - 620) / 2);
    var y = parseInt((screen.availHeight - 460) / 2);
    var url = "/forumhelp.html";
    window.open(url, "snippet", "top=" + y + ",left=" + x + ",scrollbars=yes,toolbar=no,menubar=no,location=no,resizable=yes,width=620,height=460");
  }
  
  var blinkON = false;
  
  function blinkThing() { 
    blinkON = blinkON ? false : true;
    
    document.all['blinkything'].style.color = blinkON ? "#BABABA" : ColorSiteMain;
    setTimeout("blinkThing();", 850); 
  }
  
  function email() {
    var a = "webm";
    var b = "ast";
    var c = "er@m";
    var x = "ircs";
    var y = "crip";
    var z = "ts.org";
    
    var abc = "To contact the webmaster, please send an email to "+a+b+c+x+y+z+"\n\nNOTE:  Any emails with attachments are automatically ignored.";
    
    alert(abc);
  }