//------------------------------------------
// FunkySkunk Forums Beta
// Nav Roll Over
// (c) 2006 retrohead
//
//------------------------------------------


function small_nav_rollover(navid,loc){
	if(loc == ""){
	loc = "home";
	}
	loc = "small_nav_" + loc;
	if(navid != loc){
	document.getElementById(navid).className = 'box_nav_text_over';
	}
}
function small_nav_rollout(navid,loc){
	if(loc == ""){
	loc = "home";
	}
	loc = "small_nav_" + loc;
	if(navid != loc){
	document.getElementById(navid).className = 'box_nav_text';
	}
}
function nav_rollover(navid){
	document.getElementById('nav_' + navid).className = 'banner_nav_' + navid + '_over';
}
function nav_rollout(navid){
	document.getElementById('nav_' + navid).className = 'banner_nav_' + navid;
}
function changeSkin(url){
	document.getElementById("skin").disabled = "disabled";
	window.location= url + "/?skin=" + document.getElementById("skin").value;
}
function download(action){
    if (action == "") alert("You clicked an illegal link");
    else window.open("/?s=getfile&ref=" + action);
}
function getElementsByTagName(node, tagName) {
  tagName=tagName.toUpperCase();
  var els = [];
  if (node.elements) {
    node = node.elements;
  }
  for (i in node) {
    if (node[i] && tagName == node[i].tagName) {
      els.push(node[i]);
      if (node[i].id) {
        els[node[i].id] = node[i];
      }
      /* Could also record nodes by name in els, but it's probably not worth the
         computation
      */
    }
    /*should probably recurse; if so, test whether sub-nodes have already
      been added to els.
      */

  }
  return els;
}

function setCheckedState (form, state) {
  if (!form) {
    form = document;
  }
  if (!form.getElementsByTagName) {
    form.getElementsByTagName = function(tagName) {
      return getElementsByTagName(this, tagName);
    }
  }

  var inputs = form.getElementsByTagName('input');
  for (i=0; i<inputs.length; ++i) {
    if ('checkbox' == inputs[i].type.toLowerCase()) {
      inputs[i].checked=state;
    }
  }
}

function checkAll(form) {
  setCheckedState(form, true);
  form.check.style.display = "none";
  form.clear.style.display = "";
}

function uncheckAll(form) {
  setCheckedState(form, false);
  form.check.style.display = "";
  form.clear.style.display = "none";
}

function editPost(homepage,id) {
	window.location= homepage+"/?s=editpost&id="+id;
	return;
}

function deletePost(homepage,id) {
	var input_box = confirm("Are you sure you want to delete this post?");
	if(input_box==true){
	window.location= homepage+"/?script=deletepost&id="+id;
	} else {
	return;
	}
}