<!-- Begin
var isNetscape = navigator.appName=="Netscape";
// Global variables
var xMousePos = 0; // Horizontal position of the mouse on the screen
var yMousePos = 0; // Vertical position of the mouse on the screen
var xMousePosMax = 2000; // Width of the page
var yMousePosMax = 1000; // Height of the page

// Global object to hold drag information.
var dragObj = new Object();
dragObj.zIndex = 0;

try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlhttp = false;
  }
 }

if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
	try {
		xmlhttp = new XMLHttpRequest();
	} catch (e) {
		xmlhttp=false;
	}
}
if (!xmlhttp && window.createRequest) {
	try {
		xmlhttp = window.createRequest();
	} catch (e) {
		xmlhttp=false;
	}
}

function getRefToDiv(divID) {
	if( document.layers ) { return document.layers[divID+'C'].document.layers[divID]; };
	if( document.getElementById ) {return document.getElementById(divID); };
	if( document.all ) { return document.all[divID]; };
	if( document[divID+'C'] ) { return document[divID+'C'].document[divID]; };
	return false;
}

function getoutisdeinfo(d,a) {
  var dref = getRefToDiv(d);
  xmlhttp.open("GET", a , true);
  xmlhttp.onreadystatechange = function() {
   if (xmlhttp.readyState==4) {
    dref.innerHTML = xmlhttp.responseText;
   }
  }
 xmlhttp.send(null)
}

function submitit(which) {
	var page = "/underdog/" + which + ".php?txt=" + eval("document."+which+"form.txt.value");
	getoutisdeinfo(which+"div",page);
}

function voteit(id,good) {
	var page = "/underdog/vote.php?id=" + id + "&gb=" + good;
	getoutisdeinfo(id+"div",page);
}

function checkdata() {
    var needfields = "";
	var fields = document.getElementsByTagName('input');
 	for (i = 0; i < fields.length; i++)	{
		if (fields[i].value.length < 3 && fields[i].type == "text" && fields[i].name != "q") needfields+= fields[i].name + ", ";
	}
	fields = document.getElementsByTagName('textarea');
 	for (i = 0; i < fields.length; i++)	{
		if (fields[i].value.length < 3) needfields+= fields[i].name + ", ";
	}

    if (needfields  != "") {
     alert('Please make sure all fields are at least 3 characters long. \n\n Check : ' + needfields + '\n\n Thank you =).');
    }// endif needfields
}

function checkdata2() {
    var needfields = "";
	var fields = document.getElementsByTagName('input');
 	for (i = 0; i < fields.length; i++)	{
		if (fields[i].value.length < 3 && fields[i].type == "text" && fields[i].name != "q") needfields+= fields[i].name + ", ";
	}
    if (needfields  != "") {
     alert('Please make sure all fields are at least 3 characters long. \n\n Check : ' + needfields + '\n\n Thank you =).');
    }// endif needfields
}

function okit() {
	document.form1.c.value = document.form1.s.value;
}

// End -->