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;

// 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;
}