
shotcount = 258
currentshot = shotcount - 1

win = -1

suntzu = [
	"\"Be extremely subtle, even to the point of formlessness. Be extremely mysterious, even to the point of soundlessness. Thereby you can be the director of the opponent's fate.\", Sun Tzu",
	"\"The best victory is when the opponent surrenders of its own accord before there are any actual hostilities...It is best to win without fighting.\", Sun Tzu",
	"\"A military operation involves deception. Even though you are competent, appear to be incompetent. Though effective, appear to be ineffective.\", Sun Tzu",
	"\"Victorious warriors win first and then go to war, while defeated warriors go to war first and then seek to win.\", Sun Tzu",
	"There is one simple rule in war: win and live, or lose and die",
	"\"On the battlefield, move like water\", Sun Tzu",
	"\"If you can see the whole battlefield, the whole battlefield can see you\", Arto",
	"\"Let us commence to r0x0r!\", Allicorn",
	"\"Feck! They're all here\", Aveox"
	]
	
function random(r) {
	rv = Math.floor(Math.random() * r)
	return rv
}
function thes(a) {
	return a[random(a.length)]
}	

function writeSunTzu() {
	document.write(thes(suntzu))
}

function updateShot() {

	s1 = document.getElementById("shot1")
	s2 = document.getElementById("shot2")
	s3 = document.getElementById("shot3")

	s1.src = s2.src
	s1.alt = s2.alt
	s1.title = s2.title
	
	s2.src = s3.src
	s2.alt = s3.alt
	s2.title = s3.title

	s3.src = "/gallery/isw"+currentshot+".jpg"
	s3.alt = screencaps[currentshot]
	s3.title = screencaps[currentshot]
	
	if (--currentshot<=0) currentshot = shotcount-1
	
	setTimeout("updateShot()",5000)
}

function zoomShot(e) {
	s = e.src
	s = s.substring(0,s.indexOf("/isw"))+"/sw"+s.substring(s.indexOf("/isw")+4)
	win = window.open(s,"","menubar=off")
}

function allThumbnails() {

	i = 0
	while (++i <= shotcount) {
		if (i==1) {
			document.writeln("<div class=shot ><img src=\"/gallery/isw"+i+".jpg\" alt=\""+screencaps[i]+"\" width=102 height=77 onClick=\"javascript:zoomShot(this)\"><br>"+screencaps[i]+"</div>")
		} else {
			document.writeln("<div class=thumb><img src=\"/gallery/isw"+i+".jpg\" alt=\""+screencaps[i]+"\" width=102 height=77 onClick=\"javascript:zoomShot(this)\"><br>"+screencaps[i]+"</div>")
		}
	}

}

function writeCerts(s) {
	a = eval(s)
	
	if (a.length==0) return
	
	i = -1
	while (++i < a.length) {
		p = a[i]
		document.write(p[0]+" ")
	}
}
function getCookie(n) {
	v = document.cookie
	v = v.substring(v.indexOf(n))
	if (v.indexOf(";")!=-1) v = v.substring(0,v.indexOf(";"))
	v = v.substring(v.indexOf("=")+1)
	return v
}
function approveAccess(n) {
	access = getCookie(n)
	if (access.substring(0,1)!="_") {
		location.href = "/denied.html"
	} else {
		location.href= access.substring(1)
	}	
}

function toggle(n) {
	if (n=="forum_menu") {
		document.getElementById("stats_menu").style.display="none"
	} else {
		document.getElementById("forum_menu").style.display="none"
	}
	
	
	e = document.getElementById(n)
	
	if (e.style.display!="block") {
		e.style.display = "block";
	} else {
		e.style.display = "none"
	}
}

function openLog() {
	document.getElementById("logtable").style.height="440px"
	document.getElementById("logdiv").style.height="436px"
	//document.getElementById("logdiv").style.overflow="auto"
}
