var imageDir = "/images/"
/*
*******************
standard roll overs
*******************
*/
/* rollOver()
	gets called by an element, breaks its image source name down,
	adds _o to the basename, and sets it as source
*/
function rollOver(){
	imgSourceName = this.src
	lastSlash = imgSourceName.lastIndexOf("/")
	imgSourceName = imgSourceName.substring(lastSlash+1)
	imgSourceName = imgSourceName.split(".")
	baseName = imgSourceName[0]
	extension = imgSourceName[1]
	baseName += "_o"
	this.src = imageDir+baseName+"."+extension
}
/* rollOut()
	gets called by an element, breaks down its image source name,
	finds _o, removes it, and sets the new string as the source
*/
function rollOut(){
	imgSourceName = this.src
	lastSlash = imgSourceName.lastIndexOf("/")
	imgSourceName = imgSourceName.substring(lastSlash+1)
	imgSourceName = imgSourceName.split(".")
	baseName = imgSourceName[0]
	extension = imgSourceName[1]
	overPos = baseName.lastIndexOf("_o")
	baseName = baseName.substring(0,overPos)
	this.src = imageDir+baseName+"."+extension
}
/*
****************************
challenge solution rollovers
****************************
*/

/*
both functions are done the cheap way. it would be better if i went down 
the dom from the element that calls the the function, found img tags and then
called rollOver and rollOut.

however, this works and I don't see needing to use this script over and over agian.
*/
function specialOver(){
	x = document.getElementById("cs-title-arrow")
	imgSourceName = x.src
	lastSlash = imgSourceName.lastIndexOf("/")
	imgSourceName = imgSourceName.substring(lastSlash+1)
	imgSourceName = imgSourceName.split(".")
	baseName = imgSourceName[0]
	extension = imgSourceName[1]
	baseName += "_o"
	x.src = imageDir+baseName+"."+extension
}

function specialOut(){
	x = document.getElementById("cs-title-arrow")
	imgSourceName = x.src
	lastSlash = imgSourceName.lastIndexOf("/")
	imgSourceName = imgSourceName.substring(lastSlash+1)
	imgSourceName = imgSourceName.split(".")
	baseName = imgSourceName[0]
	extension = imgSourceName[1]
	overPos = baseName.lastIndexOf("_o")
	baseName = baseName.substring(0,overPos)
	x.src = imageDir+baseName+"."+extension
}

/* Window Pop script */
function windowPop(url, name, width, height, scrollboolean) {
	var params;
	if (scrollboolean != "") {
		params = "scrollbars="+scrollboolean;
	} else {
		params = "scrollbars=0";
	}
	params= params + ",location=0,menubar=0,status=0,toolbar=0,resizable=1,top=40,left=40,";
	params = params + "width=" + width + ",height=" + height; 
	window.open(url, name, params).focus();
}
