function submitGS_Series() {
//	if (document.frmThis.id != undefined) document.frmThis.id.value = "";
	document.frmThis.sub.value = "2";
	document.frmThis.submit();
}
function gearZoom(iID) { winPopup = new csWin("popimage.asp?id=" + iID, "Zoom", 555, 500, 0); }
function popGuide() { winPopup = new csWin("popguide.asp", "RodGuide", 755, 500, 1); }
function popAnalyzer() { winPopup = new csWin("popanalyzer.asp", "CastingAnalyzer", 640, 450, 0); }
function popGuideSpacing(iID) { winPopup = new csWin("popguidespacing.asp?id=" + iID, "GuideSpacing", 510, 420, 1); }
function popDealers(sCountry, sRegion) { winPopup = new csWin("popdealers.asp?c=" + sCountry +
	"&r=" + sRegion, "DealerGuide", 455, 400, 1);
}
function popFlash(sSWFName) { winPopup = new csWin("popflash.asp?f=" + sSWFName, "Flash", 700, 375, 0); }
function submitDealer() {
	if (document.frmThis.region != undefined)
		document.frmThis.region.selectedIndex = 0;
	document.frmThis.submit()
}
var iLastCategory = 1;
var iLastDetail = 0;
function blankModel() {
	var sID = document.frmThis.model.value;
	if (sID != "0") {
		if (iLastDetail != 0) {
			oThis = document.getElementById("col_detail_item" + iLastDetail);
			oThis.style.display = "none";
		}
		oThis = document.getElementById("col_detail_item" + sID);
		oThis.style.display = "block";
		iLastDetail = parseInt(sID);
	}
	document.frmThis.lineweight.selectedIndex = 0;
}
function blankWeight() {
	var oThis;
	var sID = document.frmThis.lineweight.value;
	if (sID != "0") {
		if (iLastDetail != 0) {
			oThis = document.getElementById("col_detail_item" + iLastDetail);
			oThis.style.display = "none";
		}
		oThis = document.getElementById("col_detail_item" + sID);
		oThis.style.display = "block";
		iLastDetail = parseInt(sID);
	}
	document.frmThis.model.selectedIndex = 0;
}
function showReel(iID) {
	var oThis;
	if (iLastDetail != 0) {
		oThis = document.getElementById("cat" + iLastDetail);
		oThis.className = "sernav";
		oThis = document.getElementById("col_md_pimg" + iLastDetail);
		oThis.style.visibility = "hidden";
		oThis = document.getElementById("col_detail_item" + iLastDetail);
		oThis.style.display = "none";
	}
	if (iID != 0) {
		oThis = document.getElementById("cat" + iID);
		oThis.className = "sernavdn";
		oThis = document.getElementById("col_md_pimg" + iID);
		oThis.style.visibility = "visible";
		oThis = document.getElementById("col_detail_item" + iID);
		oThis.style.display = "block";
		iLastDetail = iID;
	}
}
var iLastImage = 0;
function showOutfit(iID, iImageID) {
	var oThis;
	if (iLastDetail != 0) {
		oThis = document.getElementById("detaillink_" + iLastDetail);
		oThis.className = "sernav";
		oThis = document.getElementById("col_detail_item_" + iLastDetail);
		oThis.style.display = "none";
		oThis = document.getElementById("col_md_pimg" + iLastImage);
		oThis.style.visibility = "hidden";
	}
	if (iImageID != 0) {
		oThis = document.getElementById("col_md_pimg" + iImageID);
		oThis.style.visibility = "visible";
	}
	oThis = document.getElementById("detaillink_" + iID);
	oThis.className = "sernavdn";
	oThis = document.getElementById("col_detail_item_" + iID);
	oThis.style.display = "block";
	iLastDetail = iID;
	iLastImage =  iImageID;
}
function showCategory(iID) {
	var oThis;
	if (iLastCategory != 0) {
		oThis = document.getElementById("cat" + iLastCategory);
		oThis.className = "sernav";
		oThis = document.getElementById("col_item" + iLastCategory);
		oThis.style.display = "none";
	}
	showDetail(0, 0);
	if (iID != 0) {
		oThis = document.getElementById("cat" + iID);
		oThis.className = "sernavdn";
		oThis = document.getElementById("col_item" + iID);
		oThis.style.display = "block";
		iLastCategory = iID;
	}
	showDetail(1, 1);
}
function showDetail(iID, iImageID) {
	var oThis;
	if (iLastDetail != 0) {
		oThis = document.getElementById("detaillink" + iLastCategory + "_" + iLastDetail);
		oThis.className = "sernav";
		oThis = document.getElementById("col_detail_item" + iLastCategory + "_" + iLastDetail);
		oThis.style.display = "none";
	}
	for (i = 1; i <= 5; i++) {
		oThis = document.getElementById("col_md_pimg" + i);
		oThis.style.visibility = "hidden";
	}
	if (iImageID != 0) {
		oThis = document.getElementById("col_md_pimg" + iImageID);
		oThis.style.visibility = "visible";
	}
	if (iID != 0) {
		oThis = document.getElementById("detaillink" + iLastCategory + "_" + iID);
		oThis.className = "sernavdn";
		oThis = document.getElementById("col_detail_item" + iLastCategory + "_" + iID);
		oThis.style.display = "block";
	}
	iLastDetail = iID;
}
function showFly(iID) {
	var oThis;
	if (iLastDetail != 0) {
		oThis = document.getElementById("detaillink" + iLastDetail);
		oThis.className = "sernav";
		oThis = document.getElementById("col_detail_item" + iLastDetail);
		oThis.style.display = "none";
	}
	if (iID != 0) {
		oThis = document.getElementById("detaillink" + iID);
		oThis.className = "sernavdn";
		oThis = document.getElementById("col_detail_item" + iID);
		oThis.style.display = "block";
		iLastDetail = iID;
	}
}

// form validation functions
function checkString(sFieldText, sFieldName, bFormOK, bBlankOK) {
	if (bFormOK) {
		if (hasScript(eval("document.frmThis." + sFieldName).value)) {
			alert(sFieldText + " contains illegal script text\nthat can cause problems with your information");
			eval("document.frmThis." + sFieldName).focus();
			return true;
		} else {
			if (!bBlankOK && isWhitespace(eval("document.frmThis." + sFieldName).value)) {
				alert("Please fill in all of the required fields before clicking submit");
				eval("document.frmThis." + sFieldName).focus();
				return true;
			} else {
				return false;
			}
		}
	}
	return false;
}
var sWhitespace = " \t\n\r";

function isEmpty(s){
	return ((s == null) || (s.length == 0))
}

function isWhitespace (s) {
	var i;
	if (isEmpty(s)) return true;
	for (i = 0; i < s.length; i++) {
		var c = s.charAt(i);
		if (sWhitespace.indexOf(c) == -1) return false;
	}
	return true;
}
function hasScript (inString) {
	var tmpString = stripWhitespace(inString).toUpperCase();
	if (tmpString.indexOf("<" + "SCRIPT") != -1) return true;
	if (tmpString.indexOf("<" + "/" + "SCRIPT") != -1) return true;
	if (tmpString.indexOf("<" + "%") != -1) return true;
	if (tmpString.indexOf("%" + ">") != -1) return true;
	if (tmpString.indexOf("<" + "?") != -1) return true;
	if (tmpString.indexOf("php" + ">") != -1) return true;
	if (tmpString.indexOf("language=") != -1) return true;
	return false;
}
function stripWhitespace (s) {
	return stripCharsInBag (s, sWhitespace);
}
function stripCharsInBag (s, bag){
	var i;
	var returnString = "";
	for (i = 0; i < s.length; i++) {
		var c = s.charAt(i);
		if (bag.indexOf(c) == -1) returnString += c;
	}
	return returnString;
}
function isInteger (s){
	var i;
	if (isEmpty(s))
		if (isInteger.arguments.length == 1) return defaultEmptyOK;
		else return (isInteger.arguments[1] == true);
	for (i = 0; i < s.length; i++){
		var c = s.charAt(i);
		if (!isDigit(c)) return false;
	}
	return true;
}
function isDigit (c){
	return (((c >= "0") && (c <= "9")) || c == ".");
}
function buttonRoll(oThis, sClass) {
	oThis.className = sClass;
}
// windowing
function csWin(popUrl,popName,w,h,scrollbars,x,y,toolbar,menubar,resizable,status,directories){
	this.popUrl = popUrl;
	this.popName = popName;
	this.w = w ? w : screen.width;
	this.h = h ? h : screen.height;
	this.scrollbars = scrollbars ? scrollbars : 0;
	this.toolbar = toolbar ? toolbar : 0;
	this.menubar = menubar ? menubar : 0;
	this.resizable = resizable ? resizable : 0;
	this.status = status ? status : 0;
	this.directories = directories ? directories : 0;
	var winl = x ? x : ((screen.width - this.w) / 2);
	var wint = y ? y : ((screen.height - this.h) / 2);
	if (wint < 0) wint = 1;
	if (winl < 0) winl = 0;
	this.popWin = window.open(
		this.popUrl,
		this.popName,
		"top=" + wint + "," +
		"left=" + winl + "," +
		"toolbar=" + this.toolbar.toString() + "," +
		"directories=" + this.directories.toString() + "," +
		"status=" + this.status.toString() + "," +
		"menubar=" + this.menubar.toString() + "," +
		"scrollbars=" + this.scrollbars.toString() + "," +
		"resizable=" + this.resizable.toString() + "," +
		"width=" + this.w.toString() + "," +
		"height=" + this.h.toString()
	);
}
// rollover code
var isLoaded = false;
roll = new csRoll("_over","_out");

// primary object
function csRoll(overSuffix, outSuffix){
	this.overSuffix = overSuffix;
	this.outSuffix = outSuffix;
	this.images = new Object()
	this.initialized = false;
}

// out and over methods
csRoll.prototype.over = csRollOver;
function csRollOver(imgName){
	if (this.initialized) this.images[imgName].over();
}

csRoll.prototype.out = csRollOut;
function csRollOut(imgName, bDeactivateOK){
	if (this.initialized) this.images[imgName].out();
}

// initialize roll object by mapping named images
csRoll.prototype.init = csRollInit;
function csRollInit(){
	var imgs = document.getElementsByTagName("img");
	for(var i = 0; i < imgs.length; i++) this.mapImage(imgs[i]);
	this.initialized = true;
}

// map images
csRoll.prototype.mapImage = csRollMapImage;
function csRollMapImage(img){
	if(img.name.indexOf("_ROLL") != -1)
		this.images[img.name.substr(0,img.name.lastIndexOf("_"))] = new csRollImage(img, this.overSuffix, this.outSuffix);
}

function csRollImage(img, overSuffix, outSuffix){
	this.img = img;
	var lastDotPos = this.img.src.lastIndexOf(".");
	this.baseSuffix = this.img.src.substr(lastDotPos);
	var baseSrc = this.img.src.substr(0,this.img.src.lastIndexOf("_"));
	this.overSrc = baseSrc + overSuffix + this.baseSuffix;
	this.outSrc = baseSrc + outSuffix + this.baseSuffix;
	this.preloadOver = new Image(); 
	this.preloadOver.src = this.overSrc; 
	this.preloadOut = new Image();
	this.preloadOut.src = this.outSrc;
}

csRollImage.prototype.deactivate = csRollImageDeactivate;
function csRollImageDeactivate() {
	this.img.src = this.preloadInactive.src;
}

csRollImage.prototype.over = csRollImageOver;
function csRollImageOver() {
	this.img.src = this.preloadOver.src;
}

csRollImage.prototype.out = csRollImageOut;
function csRollImageOut() {
	this.img.src = this.preloadOut.src;
}