<!--
if (navigator.appName == "Netscape") {
	layerRef="document.layers";
  	styleSwitch="";
    } else {
    	layerRef="document.all";
    	styleSwitch=".style";
    }

var jsworks = "false";
if ((navigator.appName.substring(0,8) == "Netscape" && 
parseFloat(navigator.appVersion) >= 3) ||
    (navigator.appName.substring(0,8) == "Microsof" && 
parseFloat(navigator.appVersion) == 4)) 
{
	jsworks = "true";
}
if (navigator.appVersion.indexOf("X11")> 1)
{
	jsworks = "false";
}
if (navigator.appVersion.indexOf("AOL")> 1)
{
	jsworks = "false";
}

/*
Submit Once form validation- 
© Dynamic Drive (www.dynamicdrive.com)
For full source code, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
*/

function submitonce(theform){
//if IE 4+ or NS 6+
	if (document.all||document.getElementById){
	//screen thru every element in the form, and hunt down "submit" and "reset"
		for (i=0;i<theform.length;i++){
			var tempobj=theform.elements[i]
			if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset")
			//disable em
				tempobj.disabled=true
		}
	}
}
function getElementFromID(name)
{
	if (document.getElementById)
	{
	        return document.getElementById(name);
	}
	else if (document.all)
	{
	        return document.all[name];
	}
	else if (document.layers)
	{
	        return document.layers[name];
	}
	else
	{
	        return null;
	}
}
function toggleingoreimg(imgname)
{
	imgN = document.getElementById(imgname);
	if (imgN.src.indexOf('/pics/icons/toggleup.gif') >= 0)
		imgN.src = '/pics/icons/toggledown.gif';
	else
		imgN.src = '/pics/icons/toggleup.gif';
	window.status=imgN.src.indexOf('toggleup').imgN.src;
}

function togglediv(name)
{
	var obj = getElementFromID(name)
	if (obj.style.display != 'inline')
	{
		obj.style.display='inline';
	}
	else
	{
		obj.style.display='none';
	}
}

function expandAllDivs(name)
{
	var arrTD = document.getElementsByTagName('div')
	for (var i = 0; i < arrTD.length; i++)
  {
  	var str = arrTD[i].id;
    if (str.indexOf(name)>=0)
      {
         arrTD[i].style.display='inline';
      }
   }
}
function collapseAllDivs(name)
{
	var arrTD = document.getElementsByTagName('div')
	for (var i = 0; i < arrTD.length; i++)
  {
  	var str = arrTD[i].id;
    if (str.indexOf(name)>=0)
      {
         arrTD[i].style.display='none';
      }
   }
}

function replace(string,text,by) {
// Replaces text with by in string
    var strLength = string.length, txtLength = text.length;
    if ((strLength == 0) || (txtLength == 0)) return string;

    var i = string.indexOf(text);
    if ((!i) && (text != string.substring(0,txtLength))) return string;
    if (i == -1) return string;

    var newstr = string.substring(0,i) + by;

    if (i+txtLength < strLength)
        newstr += replace(string.substring(i+txtLength,strLength),text,by);

    return newstr;
}

function make_homepage(name)
{
	browserName=navigator.appName;browserVer=parseInt(navigator.appVersion);
	version="other";
	if ((browserName=="Microsoft Internet Explorer" && browserVer>=4) && 
    	    (navigator.appVersion.indexOf('5.')>-1))
 		version="IE5";
	/* IE Version 5 browser URL */
	if (version=="IE5")
	{
		name.style.behavior='url(#default#homepage)';
		name.setHomePage("http://www.returntothepit.com/index.php?default="+replace(replace(replace(location.href, '?', '1232123'),"http://www.returntothepit.com","" ),"http://localhost","" ));
		name.href = document.location;
	}
}

function showLayer(layerName) {
 	eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"');
}
  	
function hideLayer(layerName) {
	eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"');
}
ns=0;
layerRef="document.all"
styleSwitch=".style"
if (navigator.appName == "Netscape") {
	ns=1;
	layerRef="document.layers"
  	styleSwitch=""

}

menutop=102;
if (ns) menutop=97;
if(navigator.appName=="Microsoft Internet Explorer" && navigator.platform=="MacPPC"){menutop=87};

function sety(layerName,y) {
 	eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.top='+y);
}

function openIconWindow()
{	
	mywin=window.open("view.php?iconwindow=1","", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=300,height=300");
}

function bugReport()
{
	mywin=window.open("","", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=300,height=300");
	mywin.document.write("<body bgcolor=#000000 text=#FFFFFF>");
	mywin.document.write("<table width='100%' height='100%'  border='0' cellspacing='0' cellpadding='0' ><tr><td>");
	mywin.document.write("Dear Rev,<br> It seems you messed up this page:");
	mywin.document.write("<form action='cgi-bin/bug_report.pl'><input name='loc' value='"+document.location+"'><br>");
	mywin.document.write("The problem is:<br><textarea name='body' rows=3>\n");
	mywin.document.write("\n");
	mywin.document.write("</textarea><br><br>Please, fix it now, jerk!<br>");
	mywin.document.write("Thanks<br><input name='email'><br><input type='submit' name=sButton value='Send'>");
	mywin.document.write("<input type='hidden' name='browsertype' value='"+navigator.appName+"\@"+navigator.appVersion+"'></form>");
	mywin.document.write("</td></tr></table></body></html>");
	mywin.document.close();
	mywin.focus();
	
}

function open_win(name, image, text) { 
	mywin=window.open("/pictures.php?id="+image,"win", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=680,height=530");
	mywin.document.close();
	mywin.focus();
}

function writeoutpage(thumb, index) 
{ 
  var band = thumb.substring(thumb.lastIndexOf('/')+1);
  band = band.replace(/\_/g, " ").replace("thumb.jpg","");
	if (jsworks == "true")
	{
	  
		document.write("<td> <a href=\"javascript:\/\/\" onClick=\"javascript:open_win(\'\',\'"+index+"\',\'\')\"><img src=\'"+thumb+"\' width='78' height='59' border='0'  onmouseover=\"className='imghover'\"  onmouseout=\"className='imgnormal'\" alt='"+band+"' title='"+band+"'></a></td>");
	}
	else
	{
		document.write("<td> <a href='/pictures.php?id="+index+"&simple=1' target='_blank'><img src='"+thumb+"' width='78' height='59' border='0' alt='"+band+"' title='"+band+"'></a></td>");
	}
}
function writepage(start, pictureCount, startingIndex)
{
  for (i = 1; i <= pictureCount; i++) 
  {
		if (i < 10)
		{
			writeoutpage(''+start+'00'+i+'_thumb.jpg', (startingIndex+i-1));
		}
		else if (i < 100)
		{
			writeoutpage(''+start+'0'+i+'_thumb.jpg', (startingIndex+i-1));
		}
		else if (i < 1000)
		{
			writeoutpage( ''+start+''+i+'_thumb.jpg', (startingIndex+i-1));
		}
		if ((i % 10) == 0 && i != 0)
		{
			document.write('</tr><tr>');
		}
  }
}
function writeCookie()
{ 
	SetCookie ('site_user', document.form1.email.value);
}
function readCookie()
{
	document.form2.email2.value = GetCookie('site_user');
}

function GetCookie (name) 
{  
	var arg = name + "=";  
	var alen = arg.length;  
	var clen = document.cookie.length;  
	var i = 0;  
	while (i < clen) 
	{    
		var j = i + alen;    
		if (document.cookie.substring(i, j) == arg)      
			return getCookieVal (j);    
		i = document.cookie.indexOf(" ", i) + 1;    
		if (i == 0) 
			break;   
	}  
	return null;
}

function SetCookie (name, value) 
{  
	var argv = SetCookie.arguments;  
	var argc = SetCookie.arguments.length;  
	var expires = (argc > 2) ? argv[2] : null;  
	var path = (argc > 3) ? argv[3] : null;  
	var domain = (argc > 4) ? argv[4] : null;  
	var secure = (argc > 5) ? argv[5] : false;  
	document.cookie = name + "=" + escape (value) + 
	((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
	((path == null) ? "" : ("; path=" + path)) +  
	((domain == null) ? "" : ("; domain=" + domain)) +    
	((secure == true) ? "; secure" : "");
}
function DeleteCookie (name) 
{  
	var exp = new Date();  
	exp.setTime (exp.getTime() - 1);  
	var cval = GetCookie (name);  
	document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}
function getCookieVal (offset) 
{  
	var endstr = document.cookie.indexOf (";", offset);  
	if (endstr == -1)    
		endstr = document.cookie.length;  
	return unescape(document.cookie.substring(offset, endstr));
}
function DeleteRefresh(name)
{
	DeleteCookie(name);
}			

function reloadTop()
{
	parent.top_fill.location.reload();
}

function reloadSystem(theDate)
{
	parent.menu_sql.location.href="/band.php?systemupdate=1&date="+theDate;
}

function populateBandDropDown(band)
{

  if (http == false)
  {
    return;
  }
  else if (!ajaxIsBusy) 
  {
    ajaxIsBusy = document.getElementById('band'+band);
    if (ajaxIsBusy.style.display== 'inline')
    {
      ajaxIsBusy =0;
      return;
    }
    newNoteValue = "type=getdropdowninfo&band="+band;
    http.open("GET", "/processAJAX.php?" + newNoteValue, true);
    http.onreadystatechange = handleBandDropDown;
    http.send(null);
  }
}

function handleBandDropDown()
{
   if (http.readyState == 4) {
    if (http.status == 200) {
      ajaxIsBusy.style.color="white";
    } else {
      alert("Unable to update note: " + http.status);
    }   
    ajaxIsBusy.innerHTML = "<BR />"+http.responseText;
    ajaxIsBusy.style.display = 'inline';
    ajaxIsBusy = 0;
    }    
}

Xoffset = 0;
function popup(msg,bak){
var content="<TABLE WIDTH=180 BORDER=2 BORDERCOLOR=#0000FF CELLPADDING=2 CELLSPACING=0 "+
"BGCOLOR=#000000><TD ALIGN=left><FONT FACE='Verdana, Arial, Helvetica, sans-serif' COLOR=white SIZE=1>"+msg+"</FONT></TD></TABLE>";
yyy=Yoffset;
Xoffset = 0;
 if(ns4){skn.document.write(content);skn.document.close();skn.visibility="visible"}
 if(ns6){document.getElementById("dek").innerHTML=content;skn.display=''}
 if(ie4){document.all("dek").innerHTML=content;skn.display=''}
}
function popupOtherPlace(msg,bak){
var content="<TABLE WIDTH=180 BORDER=2 BORDERCOLOR=#0000FF CELLPADDING=2 CELLSPACING=0 "+
"BGCOLOR=#000000><TD ALIGN=left><FONT FACE='Verdana, Arial, Helvetica, sans-serif' COLOR=white SIZE=1>"+msg+"</FONT></TD></TABLE>";
yyy=Yoffset;
Xoffset = -253;
 if(ns4){skn.document.write(content);skn.document.close();skn.visibility="visible"}
 if(ns6){document.getElementById("dek").innerHTML=content;skn.display=''}
 if(ie4){document.all("dek").innerHTML=content;skn.display=''}
}

function get_mouse(e){
var x=(ns4||ns6)?e.pageX:event.x+document.body.scrollLeft;
//skn.left=x+Xoffset;
skn.left=510 + Xoffset;
var y=(ns4||ns6)?e.pageY:event.y+document.body.scrollTop;
//skn.top=y+yyy;
skn.top=0;
}

function kill(){
yyy=-1000;
if(ns4){skn.visibility="hidden";}
else if (ns6||ie4)
skn.display="none"
}

function messagePreview()
{
	var myText = document.theform.messagebody.value;
	myString = new String(document.theform.messagebody.value)
	rExp = /\n/gi;
	results = myString.replace(rExp, "5554354555")
	mywin=window.open("view.php?preview=1&message="+results+"&nickname="+document.theform.nickname.value,"", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=800,height=300");

	mywin.document.close();
	mywin.focus();
	
}

function setIn1(theRow)
{
	setPointer(theRow, 'over', '#000080', '#0000AA', '#000088');
}
function setIn2(theRow)
{
	setPointer(theRow, 'over', '#0000EF', '#0000AA', '#000088');
}

function setOut1(theRow)
{
	setPointer(theRow, 'out', '#000080', '#0000AA', '#000088');
}
function setOut2(theRow)
{
	setPointer(theRow, 'out', '#0000EF', '#0000AA', '#000088');
}

function setC1(theRow)
{
	setPointer(theRow, 'click', '#000080', '#0000AA', '#000088');
}
function setC2(theRow)
{
	setPointer(theRow, 'click', '#0000EF', '#0000AA', '#000088');
}

/**
 * Sets/unsets the pointer and marker in browse mode
 *
 * @param   object   the table row
 * @param   string   the action calling this script (over, out or click)
 * @param   string   the default background color
 * @param   string   the color to use for mouseover
 * @param   string   the color to use for marking a row
 *
 * @return  boolean  whether pointer is set or not
 */ 
function setPointer(theRow, theAction, theDefaultColor, thePointerColor, theMarkColor)
{
    var theCells = null;
    if (navigator.appVersion.indexOf('AOL') == -1)
    {
		    // 1. Pointer and mark feature are disabled or the browser can't get the
		    //    row -> exits
		    if ((thePointerColor == '' && theMarkColor == '')
		        || typeof(theRow.style) == 'undefined') {
		        return false;
		    }
		
		    // 2. Gets the current row and exits if the browser can't get it
		    if (typeof(document.getElementsByTagName) != 'undefined') {
		        theCells = theRow.getElementsByTagName('td');
		    }
		    else if (typeof(theRow.cells) != 'undefined') {
		        theCells = theRow.cells;
		    }
		    else {
		        return false;
		    }
		
		    // 3. Gets the current color...
		    var rowCellsCnt  = theCells.length;
		    var domDetect    = null;
		    var currentColor = null;
		    var newColor     = null;
		    // 3.1 ... with DOM compatible browsers except Opera that does not return
		    //         valid values with "getAttribute"
		    if (typeof(window.opera) == 'undefined'
		        && typeof(theCells[0].getAttribute) != 'undefined') {
		        currentColor = theCells[0].getAttribute('bgcolor');
		        domDetect    = true;
		    }
		    // 3.2 ... with other browsers
		    else {
		        currentColor = theCells[0].style.backgroundColor;
		        domDetect    = false;
		    } // end 3
		
		    // 4. Defines the new color
		    // 4.1 Current color is the default one
		    if (currentColor == null)
		    	currentColor = '';
		    if (currentColor == ''
		        || (currentColor.toLowerCase() == theDefaultColor.toLowerCase())) {
		        if (theAction == 'over' && thePointerColor != '') {
		            newColor = thePointerColor;
		        }
		        else if (theAction == 'click' && theMarkColor != '') {
		            newColor = theMarkColor;
		        }
		    }
		    // 4.1.2 Current color is the pointer one
		    else if (currentColor.toLowerCase() == thePointerColor.toLowerCase()) {
		        if (theAction == 'out') {
		            newColor = theDefaultColor;
		        }
		        else if (theAction == 'click' && theMarkColor != '') {
		            newColor = theMarkColor;
		        }
		    }
		    // 4.1.3 Current color is the marker one
		    else if (currentColor.toLowerCase() == theMarkColor.toLowerCase()) {
		        if (theAction == 'click') {
		            newColor = (thePointerColor != '')
		                     ? thePointerColor
		                     : theDefaultColor;
		        }
		    } // end 4
		
		    // 5. Sets the new color...
		    if (newColor) {
		        var c = null;
		        // 5.1 ... with DOM compatible browsers except Opera
		        if (domDetect) {
		            for (c = 0; c < rowCellsCnt; c++) {
		                	theCells[c].setAttribute('bgcolor', newColor, 0);
		            } // end for
		        }
		        // 5.2 ... with other browsers
		        else {
		            for (c = 0; c < rowCellsCnt; c++) {
		                	theCells[c].style.backgroundColor = newColor;
		            }
		        }
		    } // end 5
		
		    return true;
		  }
} // end of the 'setPointer()' function

// this is for the Quick Reply feature on the messageboard.
	function addURL() 
	{
		var newMessage;
		var currentMessage = document.theform.messagebody.value;	
		var myURL = prompt("Enter in the link that you want", "http://");
		var myName = prompt("link name (change or just click 'ok')", myURL);
		
		s = new String(myURL);
		myURL =s.replace(" ","%20");
		if (myURL != '' && myURL != 'http://' && myURL != null)
		{
			if (myURL == myName)
				var msg = "[URL]"+myURL+"[/URL]";
			else
					var msg = "[URL='"+myURL+"']"+myName+"[/URL]";
				
			newMessage = currentMessage+msg;
			document.theform.messagebody.value=newMessage;
	        }
		document.theform.messagebody.focus();
		return;
	}
	// this is for the Quick Reply feature on the messageboard.
  function addVideo(textareaID) 
  { 
    var titleTxt =  "Enter in the URL of the video page\n"+
                    "Examples:\nhttp://www.youtube.com/watch?v=QfbGzAuOTlM\n"+
                    "\nhttp://vids.myspace.com/index.cfm?fuseaction=vids.individual&VideoID=19462391\n"+
                    "\nhttp://video.google.com/videoplay?docid=-3607630557453462171\n"+
                    "http://video.aol.com/video/tv-growing-pains-nude-photos/1865277\n"+
                    "http://www.collegehumor.com/video:1819977\n"+
                    "http://www.liveleak.com/view?i=b45_1215795478\n"+
                    "Supported: youtube, myspace, AOL, google, liveleak, College Humor";
    var myURL = prompt(titleTxt);
    if (!myURL || myURL == "")
    	return;
	    var txt = getElementFromID(textareaID);
    if (http != 'undefined' && !ajaxIsBusy)
    {
    	ajaxIsBusy = txt;
    	addVideoAjax(myURL);
    }
    else
    {
	    var textToReturn = "[";
	    if (myURL.indexOf("youtube")>0)
	    {
	      textToReturn += "youtube=";
	      //"v=([A-Z0-9a-z]){11}"
	      //var regexp = new RegExp("v=([A-Z0-9a-z]){11}", "i");
	      textToReturn += (myURL.split(/v=([A-Z0-9a-z_\-]{11})/ig))[1];
	    }
	    else if (myURL.indexOf("vids.myspace")>0)
	    {
	      textToReturn += "myspace=";
	      //"VideoID=([A-Z0-9a-z]+)"
	      textToReturn += (myURL.split(/VideoID=([A-Z0-9a-z]+)/ig))[1];
	    }
	    else if (myURL.indexOf("video.google")>0)
	    {
	      textToReturn += "google=";
	      //"docid=([\-A-Z0-9a-z]+)"
	      textToReturn += (myURL.split(/docid=([\-0-9]+)/ig))[1];
	    }
	    else if (myURL.indexOf("aol.com")>0)
	    {
	      textToReturn += "aol=";
	      //"/([0-9]+)$"
	      textToReturn += (myURL.split(/\/([0-9]+)$/ig))[1];
	    }
	    textToReturn += "]";
	    txt.value = txt.value+"\n"+textToReturn; 
	  }
  }
  
  function addVideoAjax(myURL)
  {
		//ajaxIsBusy
		newNoteValue = "type=addvideo&url="+myURL;
		http.open("GET", "/processAJAX.php?" + newNoteValue, true);
		http.onreadystatechange = handleEventAddVideo;
		http.send(null);
  }
  
  function handleEventAddVideo()
	{
	   if (http.readyState == 4) {
	    if (http.status == 200) {
	      //ajaxIsBusy.style.color="black";
	    } else {
	      alert("Unable to update note: " + http.status);
	    }   
	    videoValue = http.responseText;
	    if (ajaxIsBusy.value != "")
	    	videoValue = "\n"+videoValue;
	    ajaxIsBusy.value += videoValue+"\n";
	    ajaxIsBusy =0;
	  }
	}
  
	function addAddText(text) 
	{
		document.theform.messagebody.value = document.theform.messagebody.value+text;	
		document.theform.messagebody.focus();
		return;
	}
	function addIMG() {
	var newMessage;
	var currentMessage = document.theform.messagebody.value;	
	var myURL = prompt("Location of the Image (URL) on the web", "http://");
	s = new String(myURL);
	myURL =s.replace(" ","%20");
	if (myURL != '' && myURL != 'http://' &&  myURL != null)
	{
		var msg = "[IMG]"+myURL+"[/IMG]";
		newMessage = currentMessage+msg;
		document.theform.messagebody.value=newMessage;
	}
	document.theform.messagebody.focus();
	return;
	}
function changeRowStyle(nameID, change)
{
  var theRow = getElementFromID(nameID);
  var theCells = null;
  if (nameID != 'donttouch')
  {
    theRow.className = change;
    if (typeof(document.getElementsByTagName) != 'undefined') {
      theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
      theCells = theRow.cells;
    }
    else {
      return false;
    }
    var rowCellsCnt  = theCells.length;
    for (c = 0; c < rowCellsCnt; c++) {
      if (theCells[c].id != 'donttouch')
      {
        theCells[c].className = change;
      }
    }
  }
}
function Select_Value_Set(SelectName, Value)
{
  SelectObject = document.getElementById(SelectName);
  for(index = 0;
  index < SelectObject.length;
  index++)
  {
    if(SelectObject[index].value == Value)
    SelectObject.selectedIndex = index;
  }
}
function isDefined(variable)
{
  return (!(!(document.getElementById(variable))))
}
var http = getHTTPObject();
var ajaxIsBusy = 0;
function getHTTPObject() 
{

  var xmlhttp;

  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
    try {
      xmlhttp = new XMLHttpRequest(); //Firefox,Safari,...
    } catch (e) {
      xmlhttp = false;
    }
  } else {
    try {
      xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); //Internet Explorer
    } catch (e) {
      xmlhttp = false;
    }
  }
  return xmlhttp;
}

function isObject(o) 
{return (o && 'object' == typeof o) || isFunction(o);}


//-->
