var z
var imagesOff=new Array()
var imagesOn=new Array()
var panels=new Array()
// var sp=new Image(239,26)
var scTop
var autoon="no"
var lastIndex=0
var lastImage="none"
var currentlyClicked="no"

function toggleAuto() {
if (autoon=="no") {
	autoon="yes"
} else {
	autoon="no"
}
return true
}
function plImages() {



panels[0]="threadviews"
panels[1]="topicviews"
panels[2]="otherpoets"
panels[3]="registerfree"
panels[4]="searchoptions"
panels[5]="securityfeatures"
panels[6]="forumstats"
panels[7]="mydrunkstuff"
panels[8]="bdbppoetry"
panels[9]="rawfun"
panels[10]="main"
panels[11]="bdbpinformation"
panels[12]="threadviews"
panels[13]="threadviews"


}

function checkPanel(ind) {
if (ind==null) {
	ind=6
}
//if (parseInt(ind)>3) {
	//if (findDOM("t" + ind,0)) {
	//setTimeout("findDOM('t" + ind + "',0).click();",4000)
	//}
//}
return true
}




function toggleButton(ind,iName,act) {
//var img
//img=findDOM(iName,0)
if (act=="on") {
	if (currentlyClicked!=iName) {
	if(imagesOn[parseInt(ind)]) {
	eval("document." + iName).src=imagesOn[parseInt(ind)].src
	}
	}
} else {
	if (currentlyClicked!=iName) {
	if(imagesOff[parseInt(ind)]) {
	eval("document." + iName).src=imagesOff[parseInt(ind)].src
	}
	} 
}
return
}

function closePanel(pName) {
var pnl
pnl=findDOM(pName,1)
pnl.display="none"
return true
}
function switchPanel(pName) {

var c
for (c=2;c<14;c++) {
if (c !=3 && c!=12 && c!=1) {
findDOM(panels[c],1).display="none"
}
}
findDOM(pName,1).display="block"
return true;
}


function savePanelInfo(iName,ind) {
var lastImg
var img1234
var imgPS
var img111
if (lastImage!="none") {
	
//	lastImg=findDOM(lastImage,0)
	eval("document." + lastImage).src=imagesOff[parseInt(lastIndex)].src
	
}

img111=findDOM(iName,0)
// alert('running')
//findDOM(iName,0).outerHTML="<img src='spacer.gif' style='width:1px !important;height:1px !important;' id='" & iName & "' name='" & iName & "'>"
img111.outerHTML="<img id='" + iName + "' name='" + iName + "' src='images/panelselected.jpg' border='0' width='25%' height='25' alt='Click to open panel'>"

// imgPS=findDOM("convoGif",0)

// imgPS.outerHTML="<img id='convoGif' name='convoGif' src='../inc/savepanelinfo.asp?iname=" + iName + "?ind=" + ind + "' border='0' width='2' height='2' alt='sex'>"
// img1.outerHTML="<img id='" + iName + "' name='" + iName + "' src='inc/savepanelinfo.asp?iname=" + iName + "?ind=" + ind + "' border='0' width='25%' alt='Click to open panel'>"
lastIndex=parseInt(ind)
lastImage=iName
currentlyClicked=iName
return
}


function addShoutBox(){
var sBox
sBox=findDOM("shoutArea",0)
sBox.innerHTML="<iframe name='shoutFrame' id='shoutFrame' src='inc/shoutboxinclude.asp' width='100%' height='91%' marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 style='border:3px solid #000088;margin:0px;padding:0px;' scrolling='no'></iframe>"
// parent.shoutFrame.load()

}
function changeImage(imgNum) {
var np
np=findDOM("img" + imgNum,0)
np.outerHTML="<img src='inc/setbm.asp?threadId=" + imgNum + "' height=17 width=17 border=0 align=middle>"
// document.images['img' + imgNum].outerHTML="<img src='inc/setbm.asp?threadId=" + imgNum + "' height=17 width=17 border=0 align=middle>"
return true
}



function dodissable(imgNum) {

document.images['imgd' + imgNum].outerHTML="<img src='inc/setdissabled.asp?threadId=" + imgNum + "' height=17 width=17 border=0 align=middle>"
return true
}

function giveShot(imgNum,thNum,receiver) {
var msg
msg=prompt("Enter a message then click okay to buy a shot for " + receiver + " worth 50 pts")
document.images['imgs' + imgNum + thNum].outerHTML="<img src='inc/giveshot.asp?memberId=" + imgNum + "&receiver=" + receiver + "&msg=" + msg + "' height=17 width=12 border=0 align=middle alt='" + receiver + " is considering accepting this shot and getting drunk with you'>"
return true
}
function pDelete(imgNum) {

document.images['imgp' + imgNum].outerHTML="<img src='deletepostshort.asp?pId=" + imgNum + "' height=17 width=17 border=0 align=middle>"
return true
}

function startShot(imgNum,thNum,receiver) {

	var theW,theH,theL,theWin
	scTop=findScrollTop()
	// alert(scTop)
	theWin=findDOM("utilityWindow",0)
	theW=findLivePageWidth()
	theH=findLivePageHeight()
	theWin.style.width=parseInt(theW*.65) + "px"
	theWin.style.height=parseInt(theH*.65) + "px"
	theWin.style.left=parseInt((theW*.35)/2) + "px"
	theWin.style.top=parseInt((theH*.35)/2 + parseInt(scTop)) + "px"
	theWin.style.display="block"
	theWin.style.zIndex=15
	var theFrame=findDOM("utilityFrame",0)
	theFrame.src="shotbox.asp?recId=" + receiver + "&imgNum=" + imgNum + "&thNum=" + thNum

	}

		function changeToFull(iStr) {
		document.images['imgs' + iStr].outerHTML="<img src='images/shotglassfull.gif' height=17 width=12 border=0 align=middle alt='The receiver is considering accepting this shot and getting drunk with you'>"
		
		}
		
			function closeWindow() {
	var theWin
	theWin=findDOM("utilityWindow",1)
	theWin.display="none"
	}
	
		function goTo() {
	window.scroll(0, parseInt(scTop))
	
	}
	
	function displayShot(imgNum,thNum,receiver) {

	var theW,theH,theL,theWin
	scTop=findScrollTop()
	// alert(scTop)
	theWin=findDOM("utilityWindow",0)
	theW=findLivePageWidth()
	theH=findLivePageHeight()
	theWin.style.width=parseInt(theW*.65) + "px"
	theWin.style.height=parseInt(theH*.65) + "px"
	theWin.style.left=parseInt((theW*.35)/2) + "px"
	theWin.style.top=parseInt((theH*.35)/2 + parseInt(scTop)) + "px"
	theWin.style.display="block"
	theWin.style.zIndex=15
	var theFrame=findDOM("utilityFrame",0)
	theFrame.src="shotdisplaybox.asp"

	}

	function grabFile(mmmId) {

	var theW,theH,theL,theWin
	scTop=findScrollTop()
	// alert(scTop)
	theWin=findDOM("utilityWindow",0)
	theW=findLivePageWidth()
	theH=findLivePageHeight()
	theWin.style.width=parseInt(theW*.65) + "px"
	theWin.style.height=parseInt(theH*.65) + "px"
	theWin.style.left=parseInt((theW*.35)/2) + "px"
	theWin.style.top=parseInt((theH*.35)/2 + parseInt(scTop)) + "px"
	theWin.style.display="block"
	theWin.style.zIndex=15
	var theFrame=findDOM("utilityFrame",0)
	theFrame.src="filegrab.asp?mmId=" + mmmId

	}

		function grabFile2(mmmId) {

	var theW,theH,theL,theWin
	scTop=findScrollTop()
	// alert(scTop)
	theWin=findDOM("utilityWindow",0)
	theW=findLivePageWidth()
	theH=findLivePageHeight()
	theWin.style.width=parseInt(theW*.65) + "px"
	theWin.style.height=parseInt(theH*.65) + "px"
	theWin.style.left=parseInt((theW*.35)/2) + "px"
	theWin.style.top=parseInt((theH*.35)/2 + parseInt(scTop)) + "px"
	theWin.style.display="block"
	theWin.style.zIndex=15
	var theFrame=findDOM("utilityFrame",0)
	theFrame.src="filegraburl.asp?mmId=" + mmmId

	}
