	var moveDiv = 0
	var moveDiv2 = 0
	var myX = 0
	var myY = 0
	var chk4Msgs = 0
	var msgChks = 0
	var ha = 0
	var curGroupTab = 1
	var userAppName = navigator.appName
	var lastCalDate = ""
	var lastCalColor = ""
	var holdLap = 1
	var grabDivX = 0
	var grabDivY = 0
	var chgLoc = 0
	var chgGame = 0
	var pageStart = 0
	var badRun = 0
	var divNamed = ""
	
	//openPopUp("/ajax/createAcct.asp",0,0)
	//ajax("/ajax/playersInvolved.asp","myBot")
	//setTimeout("",1000)
	
	function featuredStore(storeID,name) {
		alert(storeID)
		ajax('/ajax/locInfo.asp?advStore=' + storeID,'myBot2')
		alert(name)
		setTimeout("window.location='/" + name + "'",500)
	}
	
	function resetCellColor(selElement,color) {
		if (selElement.style.backgroundColor != siteColor_2c) {
			selElement.style.backgroundColor=color;
		}
	}
	
	function openWowDeck(deckID) {
		document.getElementById("popContent").innerHTML = "Loading Deck..."
		//document.getElementById("testZone").innerHTML = '/ajax/wowTcgDeckBuilder.asp?gameID=' + gameID + '&deckID=' + deckID
		ajax('/ajax/wowTcgDeckBuilder.asp?gameID=' + gameID + '&deckID=' + deckID,'popUp')
	}
	
	function selSearchCard(which,selElement,cardName,line) {
		addCardName = cardName
		for(i=0;i<addCardName.length;i++) {
			addCardName = addCardName.replace('$','"')
			addCardName = addCardName.replace("^","'")
		}
		
		if (which == "") {
			document.addCardForm.req_cardName.value = addCardName
			selElement.style.backgroundColor = siteColor_2c
			if (curSearchCard != "") { document.getElementById(curSearchCard).style.backgroundColor = '#ffffff' }
			curSearchCard = line
			if (cardName.length > 0) {
				ajax('/ajax/wowTcgDeckBuilder.asp?gameID=' + gameID + '&cardPic=' + cardName,'addCardPic2')
				ajax('/ajax/wowTcgDeckBuilder.asp?gameID=' + gameID + '&cardPic=' + cardName,'addCardPic')
			}
		}
		else if (which == "heroOnly") {
			document.newDeckForm.req_deckHero.value = addCardName
			selElement.style.backgroundColor = siteColor_2c
			if (curSearchCard != "") { document.getElementById(curSearchCard).style.backgroundColor = '#ffffff' }
			curSearchCard = line
			if (cardName.length > 0) {
				//ajax('/ajax/wowTcgDeckBuilder.asp?gameID=' + gameID + '&cardPic=' + cardName,'addCardPic2')
				ajax('/ajax/wowTcgDeckBuilder.asp?gameID=' + gameID + '&cardSize=large&cardPic=' + cardName,'addCardPic5')
			}
		}
		else {
			selElement.style.backgroundColor = siteColor_2c
			if (curSearchCard != "") { document.getElementById(curSearchCard).style.backgroundColor = '#ffffff' }
			curSearchCard = line
			if (cardName.length > 0) {
				ajax('/ajax/wowTcgDeckBuilder.asp?gameID=' + gameID + '&cardPic=' + cardName,'addCardPic2')
			}
		}
	}
	
	function mtgSearchCard(selElement,cardName,line,inPage) {
		addCardName = cardName
		for(i=0;i<addCardName.length;i++) {
			addCardName = addCardName.replace('$','"')
			addCardName = addCardName.replace("^","'")
			addCardName = addCardName.replace('AElig','Æ')
			addCardName = addCardName.replace('aacute','á')
		}
		
		selElement.style.backgroundColor = siteColor_2c
		if (cardName.length > 0) {
			ajax('/ajax/mtgCardDetails.asp?gameID=' + gameID + '&cardPic=' + cardName,'addCardPic2')
			if (inPage == 1) {
				document.addCardForm.req_cardName.value = addCardName
				ajax('/ajax/mtgCardDetails.asp?gameID=' + gameID + '&cardPic=' + cardName,'addCardPic')
			}
			//ajax('/ajax/wowTcgDeckBuilder.asp?gameID=' + gameID + '&cardPic=' + cardName,'addCardPic2')
			//ajax('/ajax/wowTcgDeckBuilder.asp?gameID=' + gameID + '&cardPic=' + cardName,'addCardPic')
		}
	}
	
	function bigCardOff(cardName) {
		if (bigCard == 1) {
			bigCard = 0
			setTimeout("bigCardOff('" + cardName + "')",500)
		}
		else {
			showBigCard(cardName,0)
		}
	}
	
	function showBigCard(cardName,dir) {
		if (dir == 1) {
			bigCard = 1
			document.getElementById("popUp2").innerHTML = "<img onmouseover=showBigCard('" + cardName + "',1) onmouseout=showBigCard('" + cardName + "',0) src='/images/wowCards/" + cardName + "' border='0' />"
			pageStart = document.getElementById("contentTopLeft").offsetLeft
			document.getElementById('popUp2').style.display = ''
		}
		else {
			document.getElementById('popUp2').style.display = 'none'
		}
	}
	
	function showEveCertDetails(certID) {
		if (document.getElementById("certDetails_" + certID).style.display == '') {
			document.getElementById("certDetails_" + certID).innerHTML = ""
			document.getElementById("certDetails_" + certID).style.display = 'none'
		}
		else {
			document.getElementById("certDetails_" + certID).style.display = ''
			ajax('/ajax/eveOnlineCertLookup.asp?certID=' + certID,'certDetails_' + certID)
		}
	}
	
	function showEveSkillDetails(skillID) {
		if (document.getElementById("skillDetails_" + skillID).style.display == '') {
			document.getElementById("skillDetails_" + skillID).innerHTML = ""
			document.getElementById("skillDetails_" + skillID).style.display = 'none'
		}
		else {
			document.getElementById("skillDetails_" + skillID).style.display = ''
			ajax('/ajax/eveOnlineSkillLookup.asp?skillID=' + skillID,'skillDetails_' + skillID)
		}
	}
	
	function getSkillSearch(skillAttribute,skillRank,searchVal,searchSkillGroup) {
		if (skillRank == "" && searchVal == "" && searchSkillGroup == "" && skillAttribute == "") {
			document.getElementById("searchResults").innerHTML = ""
			alert("You enter a keyword or select a skill group")
		}
		else {
			document.getElementById("searchResults").innerHTML = "<span style='font-weight:bold;'>Searching for skills</span>"
			ajax('/ajax/eveOnlineSkillLookup.asp?skillAttribute=' + skillAttribute + '&skillRank=' + skillRank + '&searchVal=' + searchVal + '&searchSkillGroup=' + searchSkillGroup,'searchResults')
		}
	}
	
	function getCertSearch(grade,searchVal,searchCategory) {
		if (grade == "" && searchVal == "" && searchCategory == "") {
			document.getElementById("searchResults").innerHTML = ""
			alert("You enter a keyword or select a certificate group")
		}
		else {
			document.getElementById("searchResults").innerHTML = "<span style='font-weight:bold;'>Searching for certificates</span>"
			ajax('/ajax/eveOnlineCertLookup.asp?certGrade=' + grade + '&searchVal=' + searchVal + '&searchCategory=' + searchCategory,'searchResults')
		}
	}
	
	function sendReferral(emailAddr) {
		document.referralForm.referralEmail.value = ""
		ajax('/ajax/sendReferral.asp?email=' + emailAddr,'referralCell')
	}
	
	function popFriendApproval(num,playerID) {
		if (num == 1) {
			closePopUp()
			if (curPage == "My GiP") {
				ajax('/ajax/friendList.asp?action=Accepted&playerID=' + playerID,'content1')
			}
			else {
				ajax('/ajax/friendList.asp?action=Accepted&playerID=' + playerID,'myBot')
			}
		}
		else {
			closePopUp()
			if (curPage == "My GiP") {
				ajax('/ajax/friendList.asp?action=Declined&playerID=' + playerID,'content1')
			}
			else {
				ajax('/ajax/friendList.asp?action=Declined&playerID=' + playerID,'myBot')
			}
		}
	}
	
	function popGGMemApproval(num,playerID,groupID) {
		if (num == 1) {
			closePopUp()
			if (curPage == "Gaming Group") {
				ajax("/ajax/groupMembers.asp?memID=" + playerID + "&myAction=approveMembership&gID=" + groupID,"groupContent")
			}
			else {
				ajax("/ajax/groupMembers.asp?memID=" + playerID + "&myAction=approveMembership&gID=" + groupID,"myBot")
			}
		}
		else {
			closePopUp()
			if (curPage == "Gaming Group") {
				ajax("/ajax/groupMembers.asp?memID=" + playerID + "&myAction=declineMembership&gID=" + groupID,"groupContent")
			}
			else {
				ajax("/ajax/groupMembers.asp?memID=" + playerID + "&myAction=declineMembership&gID=" + groupID,"myBot")
			}
		}
	}
	
	function getPostalInfo(val) {
		ajax('/ajax/chkValue.asp?chkType=zipCode&stopVal=1&chkValue=' + val,'responseField_zipCode')
		ajax('/ajax/chkValue.asp?chkType=zipCode&stopVal=2&chkValue=' + val,'caCity')
		ajax('/ajax/chkValue.asp?chkType=zipCode&stopVal=3&chkValue=' + val,'caState')
	}
	
	function albumViewPictures(albumID) {
		document.getElementById("bottomSection").style.display = ''
		ajax('/ajax/viewAlbum.asp?albumID=' + albumID + '&viewPic=1','curPicData')
		document.getElementById("picTab").style.backgroundColor = siteColor_1a
		document.getElementById("commTab").style.backgroundColor = siteColor_1b
		
		document.getElementById("albumLeft1").src = "/images/player/tabLeftSel.gif"
		document.getElementById("albumRight1").src = "/images/player/tabRightSel.gif"
		document.getElementById("albumLeft2").src = "/images/player/tabLeft.gif"
		document.getElementById("albumRight2").src = "/images/player/tabRight.gif"
	}
	
	function albumViewComments(albumID) {
		document.getElementById("bottomSection").style.display = 'none'
		ajax('/ajax/viewAlbum.asp?albumID=' + albumID + '&comments=1','curPicData')
		document.getElementById("picTab").style.backgroundColor = siteColor_1b
		document.getElementById("commTab").style.backgroundColor = siteColor_1a
		
		document.getElementById("albumLeft1").src = "/images/player/tabLeft.gif"
		document.getElementById("albumRight1").src = "/images/player/tabRight.gif"
		document.getElementById("albumLeft2").src = "/images/player/tabLeftSel.gif"
		document.getElementById("albumRight2").src = "/images/player/tabRightSel.gif"
	}
	
	function chkPicSize(imgLoc,imgID) {
		var imgPreview = new Image();
		imgPreview.src = imgLoc
		var maxSize = 400
		if (imgPreview.width > maxSize) {
			if (imgPreview.height > maxSize) {
				if (imgPreview.height > imgPreview.width) {
					document.getElementById(imgID).height = maxSize
				}
				else {
					document.getElementById(imgID).width = maxSize
				}
			}
			else {
				document.getElementById(imgID).width = maxSize
			}
		}
		else if (imgPreview.height > maxSize) {
			document.getElementById(imgID).height = maxSize
		}
	}
	
	function deleteAlbum(albumID) {
		closePopUp()
		ajax('/ajax/myAlbum.asp?albumID=' + albumID + '&aDelete=1','myBot')
	}
	
	function albumPopUp(albumID,val,playerID) {
		if (playerID != 0) {
			ajax('/ajax/myPictures.asp?playerID=' + playerID,'content2')
		}
		openPopUp('/ajax/viewAlbum.asp?albumID=' + albumID,0,0)
		//val.selectedIndex = 0
	}
	
	function updateAlbumName(albumID,newName) {
		ajax('/ajax/myAlbum.asp?albumID=' + albumID + '&aName=' + newName,'popUp')
		ajax('/ajax/myPictures.asp','content2')
	}
	
	function addLoc(num)
	{
		openPopUp("/ajax/addLocForm.asp?adminPage=" + num,0,500)
		setTimeout("locForm.name1.focus()",2000)
	}
	
	function chkNewLocForm()
	{
		if (document.locForm.name1.value == "") {
			alert("You must enter the name of the location")
			document.locForm.name1.focus()
			return false
		}
		else if (document.locForm.addr1.value == "") {
			alert("You must enter the address of the location")
			document.locForm.addr1.focus()
			return false
		}
		else if (document.locForm.city.value == "") {
			alert("You must enter the city of the location")
			document.locForm.city.focus()
			return false
		}
		else if (document.locForm.state.value == "") {
			alert("You must enter the state of the location")
			document.locForm.state.focus()
			return false
		}
		else if (document.locForm.zip.value == "") {
			alert("You must enter the zip code of the location")
			document.locForm.zip.focus()
			return false
		}
		else if (document.locForm.phone1.value == "") {
			alert("You must enter the telephone number of the location")
			document.locForm.phone1.focus()
			return false
		}
		else
		{
			return true
		}
	}
	
	function recordAdClick(adID)
	{
		ajax("/ajax/adClick.asp?adID=" + adID,"myBot")
	}
	
	function pageHelp(pageName)
	{
		openPopUp("/ajax/pageHelp.asp?pageName=" + pageName,"popUp")
	}
	
	function chgDetailsUpdateAddr(addrID)
	{
		resetTopTabs(1)
		document.getElementById("accountTab").style.backgroundColor = siteColor_1a
		ajax("/ajax/myAccount.asp?showAddr=1","content2")
		openPopUp("/ajax/editAddr.asp?addrID=" + addrID,0,0)
	}
	
	function selAddr(addrID,chgID)
	{
		openPopUp("/ajax/chgDetails.asp?addrID=" + addrID + "&id=" + chgID)
	}
	
	function acceptChg(chgID)
	{
		openPopUp("/ajax/chgDetails.asp?accept=yes&id=" + chgID)
	}
	
	function declineChg(chgID)
	{
		openPopUp("/ajax/chgDetails.asp?accept=no&id=" + chgID)
	}
	
	function forgotPassword(username,email) {
		closePopUp()
		ajax('/ajax/forgotPassword.asp?username=' + username + '&email=' + email,'myBot')
		alert("Your request has been submitted\nPlease check your email account")
	}
	
	function swapTabs(newNum,preName)
	{
		if (newNum != curGroupTab)
		{
			//document.getElementById(preName + "Left" + curGroupTab).src = "/images/player/tabLeft.gif"
			//document.getElementById(preName + "Right" + curGroupTab).src = "/images/player/tabRight.gif"
			document.getElementById(preName + "Body" + curGroupTab + "a").setAttribute("class", "bgColor2");
			document.getElementById(preName + "Body" + curGroupTab + "b").setAttribute("class", "bgColor2");
			document.getElementById(preName + "Body" + curGroupTab + "c").setAttribute("class", "bgColor2");
			
			//document.getElementById(preName + "Left" + newNum).src = "/images/player/tabLeftSel.gif"
			//document.getElementById(preName + "Right" + newNum).src = "/images/player/tabRightSel.gif"
			document.getElementById(preName + "Body" + newNum + "a").setAttribute("class", "bgColor1");
			document.getElementById(preName + "Body" + newNum + "b").setAttribute("class", "bgColor1");
			document.getElementById(preName + "Body" + newNum + "c").setAttribute("class", "bgColor1");
			
			curGroupTab = newNum
		}
	}
	
	function joinChg(chgID,chgPlayerID)
	{
		ajax("/ajax/playersInvolved.asp?chgID=" + chgID + "&chgPlayerID=" + chgPlayerID,"playersInvolved")
	}
	
	function leaveChg(chgID)
	{
		var yourstate=window.confirm("Are you sure you want to leave this challenge?")
		if (yourstate)
		{
			ajax("/ajax/playersInvolved.asp?chgID=" + chgID + "&removePlayer=" + acctID,"playersInvolved")
		}
		else
		{
			return false
		}
	}
	
	function findChgActions(val,chgID)
	{
		if (val == "view") { viewChgDetails(chgID,0) }
	}
	
	function mngMyGames(val,dir,gameID)
	{
		if (dir == "add") { ajax("/ajax/addToMyGames.asp?dir=add&gameID=" + gameID,val) }
		if (dir == "remove") { ajax("/ajax/addToMyGames.asp?dir=remove&gameID=" + gameID,val) }
	}
	
	function hiCat(val)
	{
		document.flashGamesID.border = 1
	}
	
	function chkNewAcctData(num)
	{
		if (num == 1)
		{
			uName = document.dataForm.username.value
			if (uName.length > 2)
			{
				ajax("/ajax/newAcct.asp?username=" + uName,"validName")
			}
			else if (uName.length > 0)
			{
				document.getElementById("validName").innerHTML = "<span style='color:#ff0000;'>Invalid</span>"
			}
		}
		else if (num == 2)
		{
			uEmail = document.dataForm.email.value
			if (uEmail.length > 6)
			{
				ajax("/ajax/newAcct.asp?email=" + uEmail,"validEmail")
			}
			else if (uEmail.length > 0)
			{
				document.getElementById("validEmail").innerHTML = "<span style='color:#ff0000;'>Invalid</span>"
			}
		}
	}
	
	function createAcct(num)
	{
		openPopUp("/ajax/createAcct.asp?Step=" + num,0,0)
		if (num == 1) { setTimeout("document.dataForm.username.focus()",2000) }
	}
	
	if (isNaN(createAcctStep)) { createAcctStep = 0 }
	if (createAcctStep > 0) {
		createAcct(createAcctStep)
	}
	
	function chkNewAcctRatingForm()
	{
		if (document.dataForm.parent1.value != document.dataForm.parent2.value)
		{
			alert("The Parental Passwords do not match")
			document.dataForm.parent1.focus()
			return false
		}
		else
		{
			return true
		}
	}
	
	function chkStr(val,testVal) {
		if (val.length < 1) {
			return false;
		}
		else {
			itsGood = 0
			phraseLen = testVal.length
			strLen = val.length
			for (i=0;i<=strLen;i++) {
				curVal = val.substring(i,i + phraseLen)
				if (curVal == testVal) {
					itsGood = 1
				}
			}
			if (itsGood == 1) {
				return true;
			}
			else {
				return false;
			}
		}
	}
	
	function chkNewAcctForm() {
		testUN = document.getElementById("validName").innerHTML
		testEmail = document.getElementById("responseField_email").innerHTML
		testZip = document.getElementById("responseField_zipCode").innerHTML
		
		if (chkStr(testEmail,'Valid') == false) {
			alert("You must enter a valid email address")
			document.dataForm.email.select()
			return false
		}
		
		if (chkStr(testUN,'Available') == false) {
			alert("You must enter a valid username")
			document.dataForm.username.select()
			return false
		}
		else if (document.dataForm.username.value == "")
		{
			alert("You must enter a username")
			document.dataForm.username.focus()
			return false
		}
		else if (document.dataForm.email.value == "")
		{
			alert("You must enter your email address")
			document.dataForm.email.focus()
			return false
		}
		else if (document.dataForm.pass.value.length < 6)
		{
			alert("You must enter a valid password")
			document.dataForm.pass.select()
			return false
		}
		else if (document.dataForm.pass.value != document.dataForm.pass2.value)
		{
			alert("Your re-entered password must match your password")
			document.dataForm.pass2.select()
			return false
		}
		else if (document.dataForm.terms.checked != true)
		{
			alert("You must agree to the terms and conditions of this website")
			document.dataForm.terms.focus()
			return false
		}
		else if (document.dataForm.zip.value.length < 1)
		{
			alert("You must enter a valid postal code")
			document.dataForm.zip.focus()
			return false
		}
		else
		{
			return true
		}
	}
	
	function chgOk(which,val)
	{
		if (which == "pvt") {
			if (val != "") {
				chgLoc = 1
				if (document.chgForm.gameID.value != "") {
					chgGame = 1
				}
			}
			else {
				chgLoc = 0
			}
			
		}
		else if (which == "pub") {
			if (val != "") {
				chgLoc = 1
				if (document.chgForm.gameID.value != "") {
					chgGame = 1
				}
			}
			else {
				chgLoc = 0
			}
		}
		else if (which == "gameID") {
			if (val != "") {
				chgGame = 1
			}
			else {
				chgGame = 0
			}
		}
		if (chgGame == 1 && chgLoc == 1)
		{
			document.chgForm.mySub.disabled = false
		}
		else
		{
			document.chgForm.mySub.disabled = true
		}
	}
	
	function hlDate(curDate,bgColor)
	{
		if (curDate.style.backgroundColor != "#cc9933" && curDate.style.backgroundColor != "rgb(204, 153, 51)")
		{
			curDate.style.backgroundColor = bgColor
		}
	}
	
	function setChgDate(curDate,bgColor,month,day,year) {
		endDate = document.chgForm.endGameDate.value.split("/")
		if (endDate[0] == month) {
			if (endDate[1] < day) {
				document.chgForm.endGameDate.value = month + "/" + day + "/" + year
			}
		}
		else if (endDate[0] < month) {
			document.chgForm.endGameDate.value = month + "/" + day + "/" + year
		}
		
		document.chgForm.gameDate.value = month + "/" + day + "/" + year
		if (lastCalDate != "") {
			lastCalDate.style.backgroundColor = lastCalColor
		}
		curDate.style.backgroundColor = "#cc9933"
		lastCalDate = curDate
		lastCalColor = bgColor
	}
	
	function setTournamentDate(curDate,bgColor,month,day,year) {
		endDate = document.tournamentDetailsForm.endGameDate.value.split("/")
		if (endDate[0] == month) {
			if (endDate[1] < day) {
				document.tournamentDetailsForm.endGameDate.value = month + "/" + day + "/" + year
			}
		}
		else if (endDate[0] < month) {
			document.tournamentDetailsForm.endGameDate.value = month + "/" + day + "/" + year
		}
		
		document.tournamentDetailsForm.gameDate.value = month + "/" + day + "/" + year
		if (lastCalDate != "") {
			lastCalDate.style.backgroundColor = lastCalColor
		}
		curDate.style.backgroundColor = "#cc9933"
		lastCalDate = curDate
		lastCalColor = bgColor
	}
	
	function disbandtournament(tournamentID) {
		var yourstate=window.confirm("Are you sure you want to cancel this tournament?")
		if (yourstate)
		{
			ajax("/ajax/createTournament.asp?chgID=" + tournamentID + "&cancelTournament=1","myBot")
			setTimeout("window.location='/players/default.asp'",500)
		}
	}
	
	function chkUpload()
	{
		if (document.upForm.FILE1.value.length == 0 && document.upForm.FILE2.value.length == 0 & document.upForm.FILE3.value.length == 0)
		{
			alert("You must select at least one file to upload")
			return false
		}
		else
		{
			noGo = 0
			if (document.upForm.FILE1.value.length > 0)
			{
				fileType = document.upForm.FILE1.value.substring(document.upForm.FILE1.value.length - 3,document.upForm.FILE1.value.length)
				fileType = fileType.toLowerCase()
				if (fileType != "gif" && fileType != "jpg" && fileType != "png" && fileType != "bmp")
				{
					noGo = 1
				}
			}
			if (document.upForm.FILE2.value.length > 0)
			{
				fileType = document.upForm.FILE2.value.substring(document.upForm.FILE2.value.length - 3,document.upForm.FILE2.value.length)
				fileType = fileType.toLowerCase()
				if (fileType != "gif" && fileType != "jpg" && fileType != "png" && fileType != "bmp")
				{
					noGo = 1
				}
			}
			if (document.upForm.FILE3.value.length > 0)
			{
				fileType = document.upForm.FILE3.value.substring(document.upForm.FILE3.value.length - 3,document.upForm.FILE3.value.length)
				fileType = fileType.toLowerCase()
				if (fileType != "gif" && fileType != "jpg" && fileType != "png" && fileType != "bmp")
				{
					noGo = 1
				}
			}
			if (noGo == 1)
			{
				alert("You may only upload jpg, png, bmp and gif files")
				return false
			}
			else
			{
				document.upForm.mySub.disabled = true
				return true
			}
		}
	}
	
	function verifyNewGameForm()
	{
		if (newGameForm.name.value == "")
		{
			alert("You must enter the name of the game")
			newGameForm.name.focus()
			return false
		}
		else if (newGameForm.type.value == "")
		{
			alert("You must enter the game type")
			newGameForm.type.focus()
			return false
		}
		else
		{
			return true
		}		
	}
	
	function popUpRolloff()
	{
		hideMovePop = 1
		setTimeout("hidePop()",200)
	}
	
	function hidePop()
	{
		if (hideMovePop == 1) { document.moveImg.src='/images/popUp/topLeft02_off.jpg' }
	}
	
	function popUpRollOn()
	{
		hideMovePop = 0
		document.moveImg.src='/images/popUp/topLeft02_over.jpg'
	}
	
	function chkChgSearchForm(tournament)
	{
		zipCode = parseInt(document.searchForm.zipCode.value)
		username = document.searchForm.username.value
		gameID = document.searchForm.gameID.value
		locID = document.searchForm.locID.value
		if (document.searchForm.range.value == "any")
		{
			range = "any"
			if (isNaN(zipCode))
			{
				alert("You must enter a zip code")
				document.searchForm.zipCode.focus()
			}
			else
			{
				chgSearch(zipCode,range,username,gameID,locID,tournament)
			}
		}
		else
		{
			range = parseInt(document.searchForm.range.value)
			if (isNaN(range))
			{
				alert("You must enter a mile radius")
				document.searchForm.range.focus()
			}
			else
			{
				if (isNaN(zipCode))
				{
					alert("You must enter a zip code")
					document.searchForm.zipCode.focus()
				}
				else
				{
					chgSearch(zipCode,range,username,gameID,locID,tournament)
				}
			}
		}		
	}
	
	function chkGGSearchForm()
	{
		zipCode = parseInt(document.searchForm.zipCode.value)
		rating = document.searchForm.rating.value
		username = document.searchForm.username.value
		gameID = document.searchForm.gameID.value
		if (document.searchForm.range.value == "any")
		{
			range = "any"
			if (isNaN(zipCode))
			{
				alert("You must enter a zip code")
				document.searchForm.zipCode.focus()
			}
			else
			{
				ggSearch(zipCode,range,username,rating,gameID)
			}
		}
		else
		{
			range = parseInt(document.searchForm.range.value)
			if (isNaN(range))
			{
				alert("You must enter a mile radius")
				document.searchForm.range.focus()
			}
			else
			{
				if (isNaN(zipCode))
				{
					alert("You must enter a zip code")
					document.searchForm.zipCode.focus()
				}
				else
				{
					ggSearch(zipCode,range,username,rating,gameID)
				}
			}
		}		
	}
	
	function chkLocAction(val,locID)
	{
		if (val == "view")
		{
			locDetails(locID)
		}
		else if (val == "add")
		{
			ajax("/ajax/myLocs.asp?which=add&locID=" + locID,"action" + locID)
		}
		else if (val == "remove")
		{
			ajax("/ajax/myLocs.asp?which=remove&locID=" + locID,"action" + locID)
		}
	}
	
	function chkZip(zipCode) {
		if (zipCode == "") {
			document.getElementById("cityCell").innerHTML = "Enter postal/zip code "
			document.getElementById("stateCell").innerHTML = "Enter postal/zip code "
		}
		else {
			ajax("/ajax/cityState.asp?zipCode=" + zipCode,'myBot2')
			setTimeout("setCityState()",500)
		}
	}
	
	function setCityState() {
		returnVal = document.getElementById("myBot2").innerHTML
		cellVal = returnVal.split(",")
		if (cellVal[0] == "No Data Found") {
			if (document.getElementById("cityCell").innerHTML.substring(0,6) != "<INPUT") {
				document.getElementById("cityCell").innerHTML = "<input type='text' name='tempCity' value='' onblur='document.locForm.city.value=this.value' />"
				document.getElementById("stateCell").innerHTML = "<input type='text' name='tempState' value='' onblur='document.locForm.state.value=this.value' />"
			}
		}
		else {
			document.getElementById("cityCell").innerHTML = cellVal[0]
			document.locForm.city.value = cellVal[0]
			document.getElementById("stateCell").innerHTML = cellVal[1]
			document.locForm.state.value = cellVal[1]
		}
	}
	
	function chkSearchCountry(val) {
		if (val == "US") {
			document.getElementById("searchState").style.display = ''
			document.getElementById("searchZip").style.display = ''
		}
		else {
			document.getElementById("searchState").style.display = 'none'
			document.getElementById("searchZip").style.display = 'none'
		}
	}
	
	function chkPlayerSearchForm(page,totPlayersFound,showRange)
	{
		if (showRange == 1) {
			zipCode = parseInt(document.findPlayerForm.zipCode.value)
		}
		else {
			zipCode = ""
		}
		fname = document.findPlayerForm.fname.value
		lname = document.findPlayerForm.lname.value
		username = document.findPlayerForm.username.value
		accountTag = document.findPlayerForm.accountTag.value
		email = document.findPlayerForm.email.value
		locID = ""
		gameName = document.findPlayerForm.name.value
		//locID = document.findPlayerForm.locID.value
		if (document.findPlayerForm.range.value == "any")
		{
			range = "any"
			if (isNaN(zipCode))
			{
				alert("You must enter a zip code")
				document.findPlayerForm.zipCode.focus()
			}
			else
			{
				playerSearch(zipCode,range,fname,lname,username,accountTag,email,gameName,locID,page,totPlayersFound,showRange)
			}
		}
		else
		{
			range = parseInt(document.findPlayerForm.range.value)
			if (isNaN(range))
			{
				alert("You must enter a mile radius")
				document.findPlayerForm.range.focus()
			}
			else
			{
				if (isNaN(zipCode))
				{
					alert("You must enter a zip code")
					document.findPlayerForm.zipCode.focus()
				}
				else
				{
					playerSearch(zipCode,range,fname,lname,username,accountTag,email,gameName,locID,page,totPlayersFound,showRange)
				}
			}
		}		
	}
	
	function searchGames3(myVal,myStyle,myGen,myRating)
	{
		document.getElementById("selCat").innerHTML = "Search Results"
		ajax("/ajax/breadCrumb.asp?gStyle=" + myStyle + "&gen=" + myGen + "&cat=" + myVal + "&rating=" + myRating + "&page=gameSearch&lvl=2",'breadCrumb')
		document.getElementById("selCatBody").innerHTML = "<br /><span style='font-weight:bold;'>Searching for games...</span><br /><img src='/images/blank.gif' border='0' height='280' width='1' />"
		ajax("/ajax/gameSearch.asp?style=" + myStyle + "&genre=" + myGen + "&category=" + myVal + "&rating=" + myRating,'selCatBody')
	}
	
	function popStyle(catID,styleID)
	{
		curCatID = catID
		curStyleID = styleID
		curGenreID = -1
		openPopUp("/ajax/gameNav.asp",0,0)
		setTimeout("popResults()",1000)
	}
	
	function validChar(charVal,shiftUsed,entryBox) {
		if (charVal < 65 && shiftUsed == true) {
			alert("You may only use letters and numbers")
			validTxt = entryBox.value
			entryBox.value = validTxt.substring(0,(validTxt.length - 1))
		}
		if (charVal > 90) {
			alert("You may only use letters and numbers")
			validTxt = entryBox.value
			entryBox.value = validTxt.substring(0,(validTxt.length - 1))
		}
	}
	
	function groupDetails(gID) {
		window.location = '/players/group.asp?groupID=' + gID
		setTimeout("showGroupMembers(" + gID + ")",1000)
	}
	
	function nameAssist(myVal,which,evt) {
		if (userBrowser == "IE") {
			evt = window.event;
			var KeyID = evt.keyCode;
		}
		else {
			var KeyID = evt.which;
		}
		if (which == 1 || which == 4 || which == 5) {
			cellName = "nameHelp"
		}
		else if (which == 2) {
			cellName = "nameHelp2"
		}
		else if (which == 6) {
			cellName = "nameHelp6"
		}
		else if (which == 7) {
			cellName = "nameHelp7"
		}
		else {
			cellName = "nameHelp3"
		}
		if (KeyID == 40)
		{
			newTitles++
			if (document.getElementById("nLine" + which + "_" + (newTitles)) != null)
			{
				if (newTitles > 1)
				{
					document.getElementById("nLine" + which + "_" + (newTitles - 1)).style.backgroundColor='#ffffff';
				}
				document.getElementById("nLine" + which + "_" + newTitles).style.backgroundColor='#9999ff';
				if (which == 1)
				{
					document.searchForm.gName.value = document.getElementById("nLine" + which + "_" + newTitles + "_name").innerHTML
				}
				else if (which == 2)
				{
					document.findPlayerForm.name.value = document.getElementById("nLine" + which + "_" + newTitles + "_name").innerHTML
				}
				else if (which == 4) {
					document.addCardForm.req_cardName.value = document.getElementById("nLine" + which + "_" + newTitles + "_name").innerHTML
					cardName = document.getElementById("nLine" + which + "_" + newTitles + "_name").innerHTML
					for (i=0;i<cardName.length;i++) {
						cardName = cardName.replace("'","^")
						cardName = cardName.replace('"','$')
					}
					if (cardName.length > 0) {
						ajax('/ajax/wowTcgDeckBuilder.asp?gameID=' + gameID + '&cardPic=' + cardName,'addCardPic')
					}
				}
				else if (which == 6) {
					document.shortSearchForm.req_cardName.value = document.getElementById("nLine" + which + "_" + newTitles + "_name").innerHTML
					cardName = document.getElementById("nLine" + which + "_" + newTitles + "_name").innerHTML
					for (i=0;i<cardName.length;i++) {
						cardName = cardName.replace("'","^")
						cardName = cardName.replace('"','$')
					}
					if (cardName.length > 0) {
						ajax('/ajax/wowTcgDeckBuilder.asp?gameID=' + gameID + '&cardPic=' + cardName,'addCardPic6')
					}
				}
				else if (which == 7) {
					document.shortSearchForm.req_cardName.value = document.getElementById("nLine" + which + "_" + newTitles + "_name").innerHTML
					cardName = document.getElementById("nLine" + which + "_" + newTitles + "_name").innerHTML
					for (i=0;i<cardName.length;i++) {
						cardName = cardName.replace("'","^")
						cardName = cardName.replace('"','$')
						cardName = cardName.replace('Æ','AElig')
						cardName = cardName.replace('á','aacute')
					}
					if (cardName.length > 0) {
						ajax('/ajax/mtgCardDetails.asp?cardPic=' + cardName,'addCardPic7')
					}
				}
				else if (which == 5) {
					document.newDeckForm.req_deckHero.value = document.getElementById("nLine" + which + "_" + newTitles + "_name").innerHTML
					cardName = document.getElementById("nLine" + which + "_" + newTitles + "_name").innerHTML
					for (i=0;i<cardName.length;i++) {
						cardName = cardName.replace("'","^")
						cardName = cardName.replace('"','$')
					}
					if (cardName.length > 0) {
						ajax('/ajax/wowTcgDeckBuilder.asp?gameID=' + gameID + '&cardSize=large&cardPic=' + cardName,'addCardPic5')
					}
				}
				else
				{
					document.groupGamesAdd.gName.value = document.getElementById("nLine" + which + "_" + newTitles + "_name").innerHTML
				}
			}
			else
			{
				newTitles--
			}
		}
		else if (KeyID == 38)
		{
			newTitles--
			if (document.getElementById("nLine" + which + "_" + (newTitles)) != null)
			{
				if (newTitles > 0)
				{
					document.getElementById("nLine" + which + "_" + (newTitles + 1)).style.backgroundColor='#ffffff';
				}
				document.getElementById("nLine" + which + "_" + newTitles).style.backgroundColor='#9999ff';
				if (which == 1)
				{
					document.searchForm.gName.value = document.getElementById("nLine" + which + "_" + newTitles + "_name").innerHTML
				}
				else if (which == 2)
				{
					document.findPlayerForm.name.value = document.getElementById("nLine" + which + "_" + newTitles + "_name").innerHTML
				}
				else if (which == 4) {
					document.addCardForm.req_cardName.value = document.getElementById("nLine" + which + "_" + newTitles + "_name").innerHTML
					cardName = document.getElementById("nLine" + which + "_" + newTitles + "_name").innerHTML
					for (i=0;i<cardName.length;i++) {
						cardName = cardName.replace("'","^")
						cardName = cardName.replace('"','$')
					}
					if (cardName.length > 0) {
						ajax('/ajax/wowTcgDeckBuilder.asp?gameID=' + gameID + '&cardPic=' + cardName,'addCardPic')
					}
				}
				else if (which == 6) {
					document.shortSearchForm.req_cardName.value = document.getElementById("nLine" + which + "_" + newTitles + "_name").innerHTML
					cardName = document.getElementById("nLine" + which + "_" + newTitles + "_name").innerHTML
					for (i=0;i<cardName.length;i++) {
						cardName = cardName.replace("'","^")
						cardName = cardName.replace('"','$')
					}
					if (cardName.length > 0) {
						ajax('/ajax/wowTcgDeckBuilder.asp?gameID=' + gameID + '&cardPic=' + cardName,'addCardPic6')
					}
				}
				else if (which == 7) {
					document.shortSearchForm.req_cardName.value = document.getElementById("nLine" + which + "_" + newTitles + "_name").innerHTML
					cardName = document.getElementById("nLine" + which + "_" + newTitles + "_name").innerHTML
					for (i=0;i<cardName.length;i++) {
						cardName = cardName.replace("'","^")
						cardName = cardName.replace('"','$')
						cardName = cardName.replace('Æ','AElig')
						cardName = cardName.replace('á','aacute')
					}
					if (cardName.length > 0) {
						ajax('/ajax/mtgCardDetails.asp?cardPic=' + cardName,'addCardPic7')
					}
				}
				else if (which == 5) {
					document.newDeckForm.req_deckHero.value = document.getElementById("nLine" + which + "_" + newTitles + "_name").innerHTML
					cardName = document.getElementById("nLine" + which + "_" + newTitles + "_name").innerHTML
					for (i=0;i<cardName.length;i++) {
						cardName = cardName.replace("'","^")
						cardName = cardName.replace('"','$')
					}
					if (cardName.length > 0) {
						ajax('/ajax/wowTcgDeckBuilder.asp?gameID=' + gameID + '&cardSize=large&cardPic=' + cardName,'addCardPic5')
					}
				}
				else
				{
					document.groupGamesAdd.gName.value = document.getElementById("nLine" + which + "_" + newTitles + "_name").innerHTML
				}
			}
			else
			{
				newTitles++
			}
		}
		else if (KeyID != 13) {
			newTitles = 0
			if (myVal.length > 2)
			{
				for(i=1;i<myVal.length;i++) {
					myVal = myVal.replace('"','$');
					myVal = myVal.replace("'","^");
					myVal = myVal.replace('Æ','AElig')
					myVal = myVal.replace('á','aacute')
				}
				ajax("/ajax/nameHelp.asp?gameID=" + gameID + "&myVal=" + myVal + "&whichCell=" + which,cellName)
			}
			else
			{
				document.getElementById(cellName).innerHTML = ""
			}
		}
	}
	
	function hideAssist(which) {
		if (which == 1 || which == 4 || which == 5)
		{
			cellName = "nameHelp"
		}
		else if (which == 2)
		{
			cellName = "nameHelp2"
		}
		else if (which == 6) {
			cellName = "nameHelp6"
		}
		else if (which == 7) {
			cellName = "nameHelp7"
		}
		else
		{
			cellName = "nameHelp3"
		}
		if (ha == 0)
		{
			document.getElementById(cellName).innerHTML = ""
		}
	}
	
	function showLocDetails(locName) {
		ajax('/ajax/locNameHelp.asp?locName=' + locName,'myBot')
		setTimeout("updateLocForm()",1000)
	}
	
	function updateLocForm() {
		returnValue = document.getElementById("myBot").innerHTML
		if (returnValue != "nothing") {
			document.getElementById("locDetailCell").innerHTML = document.getElementById("myBot").innerHTML
		}
	}
	
	function locNameAssist(myVal,evt) {
		if (userBrowser == "IE") {
			evt = window.event;
			var KeyID = evt.keyCode;
		}
		else {
			var KeyID = evt.which;
		}
		if (KeyID == 40) {
			newTitles++
			if (document.getElementById("nLine_" + (newTitles)) != null) {
				if (newTitles > 1)
				{
					document.getElementById("nLine_" + (newTitles - 1)).style.backgroundColor='#ffffff';
				}
				document.getElementById("nLine_" + newTitles).style.backgroundColor='#9999ff';
				document.tournamentDetailsForm.lName.value = document.getElementById("nLine_" + newTitles + "_name").innerHTML
			}
		}
		else if (KeyID == 38) {
			newTitles--
			if (document.getElementById("nLine_" + (newTitles)) != null) {
				if (newTitles > 0) {
					document.getElementById("nLine_" + (newTitles + 1)).style.backgroundColor='#ffffff';
				}
				document.getElementById("nLine_" + newTitles).style.backgroundColor='#9999ff';
				document.tournamentDetailsForm.lName.value = document.getElementById("nLine_" + newTitles + "_name").innerHTML
			}
		}
		else if (KeyID != 13) {
			newTitles = 0
			if (myVal.length > 2) {
				for(i=1;i<myVal.length;i++) {
					myVal = myVal.replace('"','$');
					myVal = myVal.replace("'","^");
					myVal = myVal.replace('Æ','AElig')
					myVal = myVal.replace('á','aacute')
				}
				ajax("/ajax/locNameHelp.asp?myVal=" + myVal,"locNameHelp")
			}
			else {
				document.getElementById("locNameHelp").innerHTML = ""
			}
		}
	}
	
	function hideLocAssist() {
		document.getElementById("locNameHelp").innerHTML = ""
	}
	
	function chkGroupGame(gID) {
		addGroupGame(gID)
		return false
	}
	
	function protectDiv(val) {
		ha = val
	}
	
	function locNameHelpSel(myVal) {
		document.getElementById("locNameHelp").innerHTML = ""
		ha = 0
		for(i=1;i<myVal.length;i++) {
			myVal = myVal.replace('$','"');
			myVal = myVal.replace("^","'");
		}
		document.tournamentDetailsForm.lName.value = myVal
	}
	
	function nameHelpSel(myVal,which) {
		if (which == 1 || which == 4 || which == 5)
		{
			cellName = "nameHelp"
		}
		else if (which == 2)
		{
			cellName = "nameHelp2"
		}
		else if (which == 6)
		{
			cellName = "nameHelp6"
		}
		else if (which == 7)
		{
			cellName = "nameHelp7"
		}
		else
		{
			cellName = "nameHelp3"
		}
		document.getElementById(cellName).innerHTML = ""
		ha = 0
		if (which == 1) {
			for (i=0;i<myVal.length;i++) {
				myVal = myVal.replace('$','"');
				myVal = myVal.replace("^","'");
			}
			document.searchForm.gName.value = myVal
			searchGames()
		}
		else if (which == 2) {
			for (i=0;i<myVal.length;i++) {
				myVal = myVal.replace('$','"');
				myVal = myVal.replace("^","'");
			}
			document.findPlayerForm.name.value = myVal
		}
		else if (which == 4) {
			myVal2 = myVal
			for (i=0;i<myVal2.length;i++) {
				myVal2 = myVal2.replace('$','"');
				myVal2 = myVal2.replace("^","'");
			}
			document.addCardForm.req_cardName.value = myVal2
			if (myVal.length > 0) {
				ajax('/ajax/wowTcgDeckBuilder.asp?gameID=' + gameID + '&cardPic=' + myVal,'addCardPic')
			}
		}
		else if (which == 5) {
			for(i=1;i<myVal.length;i++) {
				myVal = myVal.replace('$','"');
				myVal = myVal.replace("^","'");
			}
			document.newDeckForm.req_deckHero.value = myVal
			if (myVal.length > 0) {
				ajax('/ajax/wowTcgDeckBuilder.asp?gameID=' + gameID + '&cardSize=large&cardPic=' + myVal,'addCardPic5')
			}
		}
		else if (which == 6) {
			for(i=1;i<myVal.length;i++) {
				myVal = myVal.replace('$','"');
				myVal = myVal.replace("^","'");
			}
			document.shortSearchForm.req_cardName.value = myVal
			if (myVal.length > 0) {
				ajax('/ajax/wowTcgDeckBuilder.asp?gameID=' + gameID + '&cardPic=' + myVal,'addCardPic6')
			}
		}
		else if (which == 7) {
			for(i=1;i<myVal.length;i++) {
				myVal = myVal.replace('$','"');
				myVal = myVal.replace("^","'");
			}
			document.shortSearchForm.req_cardName.value = myVal
			if (myVal.length > 0) {
				ajax('/ajax/mtgCardDetails.asp?cardPic=' + myVal,'addCardPic7')
			}
		}
		else
		{
			document.groupGamesAdd.gName.value = myVal
		}
	}
	
	function findPlayers(gameID)
	{
		openPopUp("/ajax/playerSearch.asp?gameID=" + gameID,0,0)
		if (gameID > 0)
		{
			setTimeout("playersByGame(" + gameID + ")",2000)
		}
	}
	
	function findLocations()
	{
		openPopUp("/ajax/locationSearch.asp",0,0)
		setTimeout("document.findLocForm.locName.focus()",1500)
	}
	
	function deleteLoc(locID) {
		var yourstate=window.confirm("Are you sure you want to delete this location?")
		if (yourstate)
		{
			closePopUp()
			ajax("/ajax/locInfo.asp?deleteLoc=" + locID,"myBot")
		}
	}
	
	function playersByGame(gameID)
	{
		eval("playerSearch('" + myZip + "','any','','','',''," + gameID + ",'')")
	}
	
	function playerSearch(zipCode,range,fname,lname,username,accountTag,email,gameName,locID,page,totPlayersFound,showRange)
	{
		document.getElementById("resultPane").innerHTML = "<span align='center' style='color:#ff0000; font-weight:bold;'>Please wait while we find players who match your criteria</span>"
		ajax("/ajax/radiusResults.asp?showRange=" + showRange + "&totPlayersFound=" + totPlayersFound + "&page=" + page + "&zipCode=" + zipCode + "&range=" + range + "&fname=" + fname + "&lname=" + lname + "&username=" + username + "&accountTag=" + accountTag + "&email=" + email + "&gameName=" + gameName + "&locID=" + locID,"resultPane")
	}
	
	function chgSearch(zipCode,range,username,gameID,locID,tournament)
	{
		if (tournament == 1) { eType = "Tournament" } else { eType = "Event" }
		document.getElementById("resultPane").innerHTML = "Searching for " + eType + "s"
		ajax("/ajax/chgRadiusResults.asp?tournament=" + tournament + "&zipCode=" + zipCode + "&range=" + range + "&username=" + username + "&gameID=" + gameID + "&locID=" + locID,"resultPane")
	}
	
	function ggSearch(zipCode,range,username,rating,gameID)
	{
		document.getElementById("resultPane").innerHTML = "Searching for Gaming Groups"
		ajax("/ajax/ggRadiusResults.asp?zipCode=" + zipCode + "&range=" + range + "&rating=" + rating + "&username=" + username + "&gameID=" + gameID,"resultPane")
	}
	
	function backFire()
	{
		return false
	}
	
	function moveBox(num) {
		if (num == 0) {
			moveDiv = 0
		}
		else {
			moveDiv = 1
			boxPosX = document.getElementById("popUp").style.left
			boxPosY = document.getElementById("popUp").style.top
			mousePosX = myX
			mousePosY = myY
			grabDivX = parseInt(myX) - parseInt(document.getElementById("popUp").style.left)
			grabDivY = parseInt(myY) - parseInt(document.getElementById("popUp").style.top)
		}
	}
	
	function moveBox2(num) {
		if (num == 0) {
			moveDiv2 = 0
		}
		else {
			moveDiv2 = 1
			boxPosX = document.getElementById("popUp2").style.left
			boxPosY = document.getElementById("popUp2").style.top
			mousePosX = myX
			mousePosY = myY
			grabDivX = parseInt(myX) - parseInt(document.getElementById("popUp2").style.left)
			grabDivY = parseInt(myY) - parseInt(document.getElementById("popUp2").style.top)
		}
	}
	
	function mouseX(evt)
	{
		if (!evt) evt = window.event;
		if (evt.pageX) return evt.pageX; else if (evt.clientX)return evt.clientX + (document.documentElement.scrollLeft ?  document.documentElement.scrollLeft : document.body.scrollLeft); else return 0;
	}
	function mouseY(evt)
	{
		if (!evt) evt = window.event;
		if (evt.pageY) return evt.pageY; else if (evt.clientY)return evt.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop); else return 0;
	}
	function follow(evt)
	{
		myX = (parseInt(mouseX(evt)))
		myY = (parseInt(mouseY(evt)))
		if (moveDiv == 1) {
			if (document.getElementById) {
				var obj = document.getElementById("popUp").style;
				obj.left = (parseInt(mouseX(evt)) - grabDivX) + 'px';
				obj.top = (parseInt(mouseY(evt)) - grabDivY) + 'px';
				window.event.cancelBubble = true;
				window.event.returnValue = false;
			}
		}
		if (moveDiv2 == 1) {
			if (document.getElementById) {
				var obj = document.getElementById("popUp2").style;
				obj.left = (parseInt(mouseX(evt)) - grabDivX) + 'px';
				obj.top = (parseInt(mouseY(evt)) - grabDivY) + 'px';
				window.event.cancelBubble = true;
				window.event.returnValue = false;
			}
		}
		if (divNamed != "") {
			if (document.getElementById) {
				var obj = document.getElementById(divNamed).style;
				obj.left = parseInt(mouseX(evt)) + 'px';
				obj.top = parseInt(mouseY(evt)) + 'px';
				window.event.cancelBubble = true;
				window.event.returnValue = false;
			}
		}
	}
	document.onmousemove = follow;
	
	function searchAction(myAction,playerID)
	{
		if (myAction == "add")
		{
			ajax("/ajax/requestFriend.asp?playerID=" + playerID,'myBot')
			chkPlayerSearchForm()
		}
		else if (myAction == "view")
		{
			window.location = "/player.asp?playerID=" + playerID
		}
		else if (myAction == "msg")
		{
			pmFriend(playerID)
		}
	}
	
	function multiFriends(which)
	{
		if (document.getElementById(which).style.display == "")
		{
			document.getElementById(which).style.display = "none"
		}
		else
		{
			document.getElementById(which).style.display = ""
		}
	}
	
	function ratePhoto(imgID)
	{
		ajax('/ajax/rateObject.asp?imgID=' + imgID,'myBot')
		enlargePhoto(imgID)
	}
	
	function swapEnlargedPhoto(imgID)
	{
		ajax('/ajax/swapEnlargedPhoto.asp?imgID=' + imgID,'curEnlarged')
	}
	
	function photoActions(myAction,imgID)
	{
		if (myAction == "delete")
		{
			var yourstate=window.confirm("Are you sure you want to delete this picture?")
			if (yourstate)
			{
				ajax('/ajax/swapEnlargedPhoto.asp?myAction=' + myAction + '&imgID=' + imgID,'myBot')
				closePopUp()
			}
		}
		else
		{
			ajax('/ajax/swapEnlargedPhoto.asp?myAction=' + myAction + '&imgID=' + imgID,'curEnlarged')
		}
	}
	
	var opacity = 98;
	var nextAboutPic = 2
	var fadePicOut = 
	{
		fade : function (id)
		{
			if (document.getElementById("pic" + nextAboutPic) != null)
			{
				this.fadeLoop(id, opacity);
				document.getElementById("pic" + nextAboutPic).style.display = "";
			}
			else
			{
				if (nextAboutPic > 2) {
					nextAboutPic = 1
					this.fadeLoop(id, opacity);
					document.getElementById("pic" + nextAboutPic).style.display = "";
				}
			}
		},
		fadeLoop : function (id, opacity)
		{
			if (document.getElementById("pic" + nextAboutPic) != null)
			{
				var curDiv = document.getElementById(id);
				if (opacity >= 5)
				{
					fadePicOut.setOpacity(curDiv, opacity);
					opacity -= 4;
					window.setTimeout("fadePicOut.fadeLoop('" + id + "', " + opacity + ")", 50);
				}
				else
				{
					curDiv.style.display = "none";
					fadePicOut.setOpacity(curDiv, 98);
					curDiv.style.zIndex = 19
					document.getElementById("pic" + nextAboutPic).style.zIndex = 20
					setTimeout("fadePicOut.fade('pic" + nextAboutPic + "')", 14000);
					nextAboutPic++
					if (nextAboutPic == 11) { nextAboutPic = 1 }
				}
			}
		},
		setOpacity : function (curDiv, opacity)
		{
			if (document.getElementById("pic" + nextAboutPic) != null)
			{
				curDiv.style.filter = "alpha(style=0,opacity:" + opacity + ")";	// IE
				curDiv.style.KHTMLOpacity = opacity / 100;				// Konqueror
				curDiv.style.MozOpacity = opacity / 100;					// Mozilla (old)
				curDiv.style.opacity = opacity / 100;					// Mozilla (new)
			}
		}
	}
	
	var opacity2 = 98;
	var nextAboutPic2 = 2
	var fadePicOut2 = 
	{
		fade : function (id2)
		{
			if (document.getElementById("friendInfo" + nextAboutPic2) != null)
			{
				this.fadeLoop(id2, opacity2);
				document.getElementById("friendInfo" + nextAboutPic2).style.display = "";
				opacity2 = 98
			}
			else
			{
				if (nextAboutPic2 != 2) {
					nextAboutPic2++
					if (nextAboutPic2 == 11) {
						nextAboutPic2 = 1
						if (document.getElementById("friendInfo" + nextAboutPic2) != null) {
							document.getElementById("friendInfo" + nextAboutPic2).style.zIndex = 5
							fadePicOut2.fade(id2)
						}
					}
					else {
						fadePicOut2.fade(id2)
					}
				}
			}
		},
		fadeLoop : function (id2, opacity2)
		{
			if (document.getElementById("friendInfo" + nextAboutPic2) != null)
			{
				var curDiv2 = document.getElementById(id2);
				if (opacity2 >= 5)
				{
					fadePicOut2.setOpacity(curDiv2, opacity2);
					opacity2 -= 4;
					window.setTimeout("fadePicOut2.fadeLoop('" + id2 + "', " + opacity2 + ")", 50);
				}
				else
				{
					curDiv2.style.display = "none";
					fadePicOut2.setOpacity(curDiv2, 98);
					//curDiv2.style.zIndex = 19
					if (nextAboutPic2 == 1) {
						document.getElementById("friendInfo1").style.zIndex = 20
					}
					setTimeout("fadePicOut2.fade('friendInfo" + nextAboutPic2 + "')", 4000);
					nextAboutPic2++
					if (nextAboutPic2 == 11) { nextAboutPic2 = 1 }
				}
			}
		},
		setOpacity : function (curDiv2, opacity2)
		{
			if (document.getElementById("friendInfo" + nextAboutPic2) != null)
			{
				curDiv2.style.filter = "alpha(style=0,opacity:" + opacity2 + ")";	// IE
				curDiv2.style.KHTMLOpacity = opacity2 / 100;				// Konqueror
				curDiv2.style.MozOpacity = opacity2 / 100;					// Mozilla (old)
				curDiv2.style.opacity = opacity2 / 100;					// Mozilla (new)
			}
		}
	}
	
	//setTimeout("getNewMsgs()",120000)
	function getNewMsgs()
	{
		if (acctID > 0) {
			ajax('/ajax/chk4Msgs.asp','myBot')
			setTimeout("newMsgReturn()",2000)
			setTimeout("getNewMsgs()",120000)
		}
	}
	
	function justGetMsgs()
	{
		if (acctID > 0) {
			ajax('/ajax/chk4Msgs.asp','myBot')
			setTimeout("newMsgReturn()",2000)
		}
	}
	
	function showMsg(num,updMsgs)
	{
		openPopUp("/ajax/readMsg.asp?id=" + num,400,300)
		setTimeout("ajax('/ajax/msgIcon.asp','newMsgBox')",1500)
		if (myCurTab3 == "MyMessages" && curPage == "My GiP") {
			setTimeout("ajax('/ajax/myMessages.asp','content3')",2000)
			setTimeout("ajax('/ajax/msgIcon.asp?tabData=1','msgTab')",1500)
		}
		else if (curPage == "My GiP") {
			setTimeout("ajax('/ajax/msgIcon.asp?tabData=1','msgTab')",1500)
		}
	}
	
	function newMsgReturn()
	{
		pHome = 0
		curTask = document.getElementById("myBot").innerHTML
		if (curTask == "login needed") { window.location = "/login.asp" }
		myInfo = curTask.split(";")
		curPage = String(window.location)
		curLen = parseInt(curPage.length)
		curPage = String(window.location).substring(curLen - 9, curLen)
		if (curPage == "/players/") { pHome = 1 }
		curPage2 = String(window.location).substring(curLen - 21, curLen)
		if (curPage2 == "/players/Default.asp?") { pHome = 1 }
		
		newMsgs = parseInt(myInfo[0])
		if (isNaN(myInfo[0]))
		{
			//No action required
		}
		else
		{
			if (newMsgs > 0)
			{
				if (pHome == 1)
				{
					document.getElementById("newMsgBox").innerHTML = "<a href='javascript:showMsg(" + myInfo[0] + ",0)'><img src='/images/structure/newMsg.jpg' border='0' width='85' height='49' /></a>"
					if (myInfo[2] == "1") { showSubMsg() }
					document.getElementById("msgTab").innerHTML = "<a href='javascript:showSubMsg()' style='font-weight:bold; color:#FFFFFF'>Messages (" + myInfo[1] + ")</a>"
					if (myInfo[3] == "1") { showFriends('auto') }
				}
				else
				{
					document.getElementById("newMsgBox").innerHTML = "<a href='javascript:showMsg(" + myInfo[0] + ",0)'><img src='/images/structure/newMsg.jpg' border='0' width='85' height='49' /></a>"
				}
			}
			else
			{
				document.getElementById("newMsgBox").innerHTML = "<a href='javascript:openPopUp('/ajax/msgBox.asp',0,0)'><img src='/images/structure/viewMessages.jpg' border='0' width='85' height='49' /></a>"
				if (pHome == 1)
				{
					document.getElementById("msgTab").innerHTML = "<a href='javascript:showSubMsg()' style='font-weight:bold; color:#FFFFFF'>Messages</a>"
					if (myInfo[2] == "1") { showSubMsg() }
					if (myInfo[3] == "1") { showFriends('auto') }
				}
			}
		}
	}
	
	function msgToList(checked,id,username)
	{
		if (checked == true)
		{
			curList = document.getElementById("toList").innerHTML
			if (curList.length > 0)
			{
				document.getElementById("toList").innerHTML = curList + "; " + username
			}
			else
			{
				document.getElementById("toList").innerHTML = username
			}
		}
		else
		{
			curList = document.getElementById("toList").innerHTML
			totalLen = curList.length
			for (i=0;i<curList.length;i++)
			{
				p = i + username.length
				if (curList.substring(i,p) == username)
				{
					if (i == 0)
					{
						if (curList.substring(i,(p + 1)) == username + ";")
						{
							document.getElementById("toList").innerHTML = curList.substring((p + 2),totalLen)
						}
						else
						{
							document.getElementById("toList").innerHTML = ""
						}
					}
					else
					{
						if (curList.substring(i,(p + 1)) == username + ";")
						{
							document.getElementById("toList").innerHTML = curList.substring(0,(i - 1)) + curList.substring((p + 1),totalLen)
						}
						else
						{
							document.getElementById("toList").innerHTML = curList.substring(0,(i - 2))
						}
					}
				}
			}
		}
	}
	
	function hideOthersContacts(friendList)
	{
		document.getElementById(friendList).style.display = "none"
	}
	
	function msgSelAction(val,num)
	{
		pHome = 0
		curPage = String(window.location)
		curLen = parseInt(curPage.length)
		curPage = String(window.location).substring(curLen - 9, curLen)
		if (curPage == "/players/") { pHome = 1 }
		curPage2 = String(window.location).substring(curLen - 21, curLen)
		if (curPage2 == "/players/Default.asp?") { pHome = 1 }
		
		if (val == "reply")
		{
			openPopUp("/ajax/replyBox.asp?id=" + num,100,350)
			setTimeout("document.pmForm.bodyTxt.focus()",2000)
		}
		if (val == "forward") {
			ajax('/ajax/forwardBox.asp?id=' + num,'popUp')
		}
		if (val == "replyAll")
		{
			openPopUp("/ajax/replyBox.asp?ra=1&id=" + num,100,350)
			setTimeout("document.pmForm.bodyTxt.focus()",2000)
		}
		else if (val == "unread")
		{
			closePopUp()
			ajax("/ajax/myMessages.asp?unread=1&id=" + num,"myBot")
			if (pHome == 1) { justGetMsgs() }
		}
		else if (val == "delete")
		{
			var yourstate=window.confirm("Are you sure you want to delete this message?")
			if (yourstate)
			{
				closePopUp()
				ajax('/ajax/myMessages.asp?delMsg=' + num,'content3')
			}
		}
	}
	
	function friendAction(val,num)
	{
		if (val == "Message") { pmFriend(num) }
		if (val == "Event") { chgFriend(num) }
		if (val == "Cancel") { cancelFriend(num) }
		if (val == "View") { window.location = "/player.asp?playerID=" + num }
		if (val == "Accepted")
		{
			closePopUp()
			ajax("/ajax/friendList.asp?val=main&action=Accepted&playerID=" + num,"content1")
		}
		if (val == "Declined")
		{
			closePopUp()
			ajax("/ajax/friendList.asp?val=main&action=Declined&playerID=" + num,"content1")
		}
		if (val == "Remove")
		{
			closePopUp()
			ajax("/ajax/friendList.asp?val=main&action=Remove&playerID=" + num,"content1")
		}
	}
	
	function cancelFriend(num)
	{
		closePopUp()
		ajax("/ajax/friendList.asp?action=cancel&playerID=" + num,"content1")
	}
	
	function chkType(val,limit)
	{
		if (val != "0")
		{
			document.getElementById("platBox").style.display = "none"
			document.getElementById("style1").style.display = "none"
			document.getElementById("style2").style.display = "none"
			if (val == "9")
			{
				document.getElementById("platBox").style.display = ""
				document.getElementById("style1").style.display = ""
				document.getElementById("style2").style.display = ""
			}
			else if (val == "10" || val == "11")
			{
				document.getElementById("style1").style.display = ""
				document.getElementById("style2").style.display = ""
			}
			ajax("/ajax/genreList.asp?limit=" + limit + "&catID=" + val,"genre2")
		}
		else
		{
			document.getElementById("platBox").style.display = ""
			document.getElementById("style1").style.display = ""
			document.getElementById("style2").style.display = ""
		}
	}
	
	function chkType2(val,limit)
	{
		if (val == "9")
		{
			document.getElementById("platBox").style.display = ""
			document.getElementById("gameStyle").style.display = ""
		}
		else
		{
			document.getElementById("platBox").style.display = "none"
			document.getElementById("gameStyle").style.display = "none"
		}
	}
	
	function addPlayer2Chg(which,playerID,chgID)
	{
		if (which == true) { add = 1 } else { add = 0 }
		if (add == 1)
		{
			var yourstate=window.confirm("Are you sure you want to add this player?")
			if (yourstate)
			{
				ajax("/ajax/add2Chg.asp?gName=" + gName + "&playerID=" + playerID + "&chgID=" + chgID + "&add=" + add,"myBot")
				setTimeout("updateCurPlayers(" + chgID + ")",1000)
			}
		}
		else
		{
			var yourstate=window.confirm("Are you sure you want to remove this player?")
			if (yourstate)
			{
				ajax("/ajax/add2Chg.asp?gName=" + gName + "&playerID=" + playerID + "&chgID=" + chgID + "&add=" + add,"myBot")
				setTimeout("updateCurPlayers(" + chgID + ")",1000)
			}
		}
	}
	
	function addPubSlot(chgID)
	{
		ajax("/ajax/add2Chg.asp?playerID=0&chgID=" + chgID + "&add=1","myBot")
		setTimeout("updateCurPlayers(" + chgID + ")",1000)
	}
	
	function updateCurPlayers(chgID)
	{
		ajax("/ajax/playersInvolved.asp?chgID=" + chgID,"playersInvolved")
	}
	
	function addNewGame()
	{
		openPopUp("/ajax/gameListAdd.asp?fPage=adminAction",0,0)
	}
	
	function pmFriend(num)
	{
		openPopUp("/ajax/messageNew.asp?new=1&id=" + num,0,0)
		if (num > 0)
		{
			setTimeout("document.pmForm.subject.focus()",2000)
		}
	}
	
	function enlargePhoto(num)
	{
		openPopUp("/ajax/enlargePhoto.asp?num=" + num,200,200)
	}
	
	function login()
	{
		openPopUp("/ajax/loginBox.asp",(myX-300),0)		
		if (myEmailLen > 0) {
			setTimeout("document.loginForm.myPass.focus()",2000)
		}
		else {
			setTimeout("document.loginForm.myEmail.focus()",2000)
		}
	}
	
	function ajax(newURL,rLoc)
	{
		//document.getElementById("testZone").innerHTML = "rLoc:" + rLoc + "\nnewURL:" + newURL
		var httpRequest;
		if (window.XMLHttpRequest) { // Mozilla, Safari, ...
			httpRequest = new XMLHttpRequest();
			if (httpRequest.overrideMimeType) {
				httpRequest.overrideMimeType('text/xml');
			}
		} else if (window.ActiveXObject) { // IE
			httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
		}
		httpRequest.open('GET', newURL, true);
		httpRequest.onreadystatechange = function(){
			if (httpRequest.readyState == 4) {
				if (httpRequest.status == 200)
				{
					badRun = 0
					var rVal = httpRequest.responseText
					document.getElementById("myBot").innerHTML = ""
					//alert("rLoc:" + rLoc + "\nrVal:" + rVal)
					if (rVal == "login needed") {
						window.location = "/login.asp"
					}
					else if (rVal != "no change") {
						//if (acctID == 2) { document.getElementById("holdingCell").innerHTML = rLoc }
						document.getElementById(rLoc).innerHTML = rVal
					}
					rVal = null;
				} else {
					badRun++
					if (badRun == 5) {
						if (acctID == 1 || acctID == 2) {
							window.location = "/default.asp?status=" + httpRequest.status + "errorOn=" + newURL + "&loc=" + rLoc
						}
						else {
							window.location = "/default.asp?error=1"
						}
					}
					else {
						setTimeout("ajax(newURL,rLoc)",500)
					}
				}
			}
		};
		httpRequest.send(null);
		//httpRequest = ""
	}
	
	function closePopUp() {
		document.getElementById("popUp").style.display = "none"
		document.getElementById("popUp").innerHTML = ""
	}
	
	function closePopUp2() {
		document.getElementById("popUp2").style.display = "none"
		document.getElementById("popUp2").innerHTML = ""
	}
	
	function closePopUp3() {
		document.getElementById("popUp3").style.display = "none"
		document.getElementById("popUp3").innerHTML = ""
	}
	
	function openPopUp(dataPage,xSize,ySize) {
		//document.getElementById("testZone").innerHTML = "dataPage:" + dataPage
		window.location = '#topAd'
		pageStart = document.getElementById("contentTopLeft").offsetLeft
		ajax(dataPage,"popUp")
		if (document.getElementById("popUp").style.display == "none") {
			ajax('/ajax/loadingData.asp','popUp2')
			showPopUp2(0)
			setTimeout("document.getElementById('popUp2').style.display = 'none'",1000)
			setTimeout("showPopUp()",1200)
		}		
	}
	
	function openPopUp2(dataPage,atMouse,slidePop) {
		pageStart = document.getElementById("contentTopLeft").offsetLeft
		document.getElementById("popUp2").style.display = "none"
		document.getElementById("popUp2").innerHTML = ""
		ajax(dataPage,"popUp2")
		showPopUp2(atMouse,slidePop)
	}
	
	function openPopUp3(dataPage,atMouse,slidePop) {
		pageStart = document.getElementById("contentTopLeft").offsetLeft
		document.getElementById("popUp3").style.display = "none"
		document.getElementById("popUp3").innerHTML = ""
		ajax(dataPage,"popUp3")
		showPopUp3(atMouse,slidePop)
	}
	
	function showPopUp() {
		document.getElementById('popUp').style.display = ''
		lap = 0
		curWidth = document.getElementById("popUp").scrollWidth
		while (curWidth == 0) {
			lap++
			curWidth = document.getElementById("popUp").scrollWidth
			if (lap == 1000) { break }
		}
		getCenter()
		setLeft('popUp',0)
		document.getElementById("popUp").style.top = 250 + 'px';
	}
	
	function showPopUp2(atMouse,slidePop) {
		document.getElementById('popUp2').style.display = ''
		lap = 0
		curWidth = document.getElementById("popUp2").scrollWidth
		while (curWidth == 0) {
			lap++
			curWidth = document.getElementById("popUp2").scrollWidth
			if (lap == 1000) { break }
		}
		getCenter2()
		setLeft('popUp2',atMouse)
		if (atMouse == 0) {
			document.getElementById("popUp2").style.top = 250 + 'px';
		}
		else {
			document.getElementById("popUp2").style.top = (myY - slidePop) + 'px';
		}
	}
	
	function showPopUp3(atMouse,slidePop) {
		document.getElementById('popUp3').style.display = ''
		lap = 0
		curWidth = document.getElementById("popUp3").scrollWidth
		while (curWidth == 0) {
			lap++
			curWidth = document.getElementById("popUp3").scrollWidth
			if (lap == 1000) { break }
		}
		getCenter2()
		setLeft('popUp3',atMouse)
		if (atMouse == 0) {
			document.getElementById("popUp3").style.top = 250 + 'px';
		}
		else {
			document.getElementById("popUp3").style.top = (myY - slidePop) + 'px';
		}
	}
	
	function setLeft(popBox,atMouse)
	{
		if (atMouse == 0) {
			document.getElementById(popBox).style.left = (pageStart + powerSlide) + 'px';
		}
		else {
			document.getElementById(popBox).style.left = (myX + 20) + 'px';
		}
	}
	
	function getCenter() {
		//alert("width: " + document.getElementById("popUp").scrollWidth)
		if(parseInt(document.getElementById("popUp").scrollWidth) == 0) {
			powerSlide = 0
		}
		else {
			powerSlide = 960 - parseInt(document.getElementById("popUp").scrollWidth)
			powerSlide = powerSlide / 2
		}
	}
	
	function getCenter2() {		
		if(parseInt(document.getElementById("popUp2").scrollWidth) == 0) {
			powerSlide = 0
		}
		else {
			powerSlide = 960 - parseInt(document.getElementById("popUp2").scrollWidth)
			powerSlide = powerSlide / 2
		}
	}
	
	function popAllCat()
	{
		openPopUp("/ajax/gameNav.asp",0,0)
		setTimeout("ajax('/ajax/searchByCat.asp?nav=1','navBox')",1000)
	}
	
	function popCat(catID)
	{
		curCatID = catID
		curStyleID = -1
		curGenreID = -1
		openPopUp("/ajax/gameNav.asp",0,0)		
		setTimeout("popResults()",1000)
	}
	
	function popGenre(catID,styleID,genreID)
	{
		curCatID = catID
		curStyleID = styleID
		curGenreID = genreID
		openPopUp("/ajax/gameNav.asp",0,0)
		setTimeout("popResults()",1000)
	}
	
	function popResults()
	{
		ajax("/ajax/gameSearch.asp?nav=1&genre=" + curGenreID + "&style=" + curStyleID + "&rating=-1&category=" + curCatID,'navBox')
	}
	
	function addToMyGames(num)
	{
		if (num == 1) {
			playersAdded = parseInt(document.getElementById("gipPlayers").innerHTML) + 1
			document.getElementById("gipPlayers").innerHTML = playersAdded
			ajax("/ajax/addToMyGames.asp?gameID=" + gameID,"myBot")
			document.getElementById("addGameBttn").innerHTML = "<a href='javascript:addToMyGames(0)'><img src='/images/player/removeGame.gif' border='0' width='125' height='25' /></a>"
		}
		else {
			playersAdded = parseInt(document.getElementById("gipPlayers").innerHTML) - 1
			document.getElementById("gipPlayers").innerHTML = playersAdded
			ajax("/ajax/addToMyGames.asp?dir=remove&gameID=" + gameID,"myBot")
			document.getElementById("addGameBttn").innerHTML = "<a href='javascript:addToMyGames(1)'><img src='/images/player/addGame.gif' border='0' width='125' height='50' /></a>"
		}
	}
	
	function verifyGipForm(formName) {
		x = document.getElementById(formName).length
		for (i=0;i<x;i++) {
			if(eval("document." + formName + ".elements[" + i + "].name.substring(0,4)") == "req_") {
				if (eval("document." + formName + ".elements[" + i + "].value == ''")) {
					alert("You must enter all required information")
					eval("document." + formName + ".elements[" + i + "].focus()")
					return false
				}
			}
		}
		eval("document." + formName + ".submit()")
	}