var st = new function()
{
	this.defvar = function(mVal,mDef)
		{return typeof mVal != 'undefined'?mVal:mDef;}
	this.exists = function(oObj,sProperty)
	{
		return typeof oObj[sProperty] != 'undefined';
	}
	this.open = function(oA,iWidth,iHeight,sResize,sScroll)
	{
		iWidth = this.defvar(iWidth,540);
		iHeight = this.defvar(iHeight,550);
		sResize = this.defvar(sResize,'yes');
		sScroll = this.defvar(sScroll,'yes');
		oPopUpWin = window.open(oA.href,''==oA.target?'_blank':oA.target,'height='+iHeight+',width='+iWidth+',resizable='+sResize+',scrollbars='+sScroll);
		oPopUpWin.focus();
		return false;
	}
	
	this.img = new function(oBase)
	{
		this.oBase = oBase;
		this.aImg = new Object();
		this.sBaseDir = 'http://www.toolbook.com/_images/';
		this.sName = '.';
		this.add = function(sName)
		{
			this.sName = sName;
			this.aImg[sName] = new Object();
			
			switch(arguments.length)
			{
				case 4:
					this.addstate('down',arguments[3]);
				case 3:
					this.addstate('over',arguments[2]);
				case 2:
					this.addstate('out',arguments[1]);
			}
		}
		this.addstate = function(sState,sPath,sBaseDir)
		{
			this.aImg[this.sName][sState] = new Image();
			this.aImg[this.sName][sState].src = this.oBase.defvar(sBaseDir,this.sBaseDir)+sPath;
		}
		this.state = function(sName,sState)
			{window.document.images[sName].src = this.aImg[sName][sState].src;}
		this.out = function (sName)
			{this.state(sName,'out');}
		this.over = function (sName)
			{this.state(sName,'over');}
		this.down = function (sName)
			{this.state(sName,'down');}
		return this;
	}(this);
	
	this.menu = new function(oBase)
	{
		this.oBase = oBase;
		this.add = function (sName,bCurrent)
		{
			bCurrent = this.oBase.defvar(bCurrent,false);
			sCurrent = bCurrent?'c/':'';
			this.oBase.img.add(sName,'nav-new/'+sCurrent+'out/'+sName+'.png','nav-new/'+sCurrent+'over/'+sName+'.png');
		}
		this.hide = function(sName)
			{this.oBase.img.out(sName);}
		this.show = function(sName)
			{this.oBase.img.over(sName);}
		return this;
	}(this);
	
	this.roll = new function(oBase)
	{
		this.oBase = oBase;
		this.sName = '.';
		this.add = function(sName)
			{this.sName = sName;}
		this.addstate = function (sState, sText)
			{this.oBase.img.add('ro'+this.sName+sState, 'ro.'+this.sName+'.'+sState+'.out.gif','ro.'+this.sName+'.'+sState+'.over.gif');}
		this.hide = function(sName,sState)
			{this.oBase.img.out('ro'+sName+sState);}
		this.show = function (sName,sState)
			{this.oBase.img.over('ro'+sName+sState);}
		return this;
	}(this);
	
	this.onload = function(sBrowserID)
	{
		if(this.exists(this.menu,'onload')) this.menu.onload(sBrowserID);
		if(this.exists(this,'roll') && this.exists(this.roll,'onload')) this.roll.onload(sBrowserID);
	}
	this.checkform = function(oForm)
	{
		//sOutput = '';
		//for(sKey in oForm.Submit) sOutput += '['+sKey+'] '+oForm.Submit[sKey]+"\n";
		//document.write(sOutput);
		
		oForm.sSubmit.disabled = true;
		return true;
	}
	return this;
}





