
	// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	//																														
	//		BYE BYE BUMS JAVASCRIPT
	//		(c) 2010 Why Whimsy																					
	//		file byebye_js4.js																	
	//		  06-01-2010  V.4.3.9.a.  																			
	//																														
	// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


	// ==========================================
	//		COOKIE DATA APPLICATION INTERFACE
	// ==========================================
	
	// ------------------------------------------------
	//		instance of cookie data object
	// ------------------------------------------------

		var ClientCookie = new CookieData();
		var DefCookie = new CookieDefaults();

	// ---------------------------------------------------------
	//		GET
	//		get a cookie value 
	// ---------------------------------------------------------

		function cookieGet(ckkey) {
	
			return ClientCookie[ckkey];
			
		}

	// ---------------------------------------------------------
	//		PUT
	//		put a validated value in a key node
	//		use this if the value is to be validated and cookie made and saved
	// ---------------------------------------------------------
	
		function cookiePut(ckkey, ckvalue) {

			// validation 

			if(cookieKeyValidate(ckkey))															// validate the cookie keyname passed
			{
				if(cookieValueValidate(ckkey, ckvalue))										// validate the cookie value passed
				{
					ClientCookie[ckkey] = ckvalue;												// put the value in the set values node array
					ClientCookie.changed = true;
					ClientCookie.saved = false;													// flag the cookie needs rebuild and saving
				}
				else																							// if key was validated but number was not
				{
					return false;																			// failed somewhere
				}
			}
			else
			{
				return false;																				// validation failed
			}

			return true;
		}
		
	// ==========================================
	//		DATA INTERFACE
	// ==========================================
	
	// ---------------------------------------------------------
	//		return the cookie item key index (-1 if not found)
	// ---------------------------------------------------------

		function ckitemKeyIndex(ckkey) {

			return inArray(ClientCookie.keys, ckkey);
		}
			
				
	// ---------------------------------------------------------
	//		DEFAULT
	//		return the default value for the item, as a string with units
	// ---------------------------------------------------------

		function cookieDefault(ckkey) {

			return DefCookie[ckkey];

		}

	// ---------------------------------------------------------
	//		MAKE
	//		make a cookie using client values; if they're not set, don't
	// ---------------------------------------------------------
	
		function cookieMake() {
	
			var ckkey = '';
			var ckval = '';
			var ckitems = [];
			var temp = [];
			var ckstr = '';
			var i=0;
		
			// convert client values to cookie items

			for(i=0; i<ClientCookie.keys.length; i++)																	// step through keys
			{
				ckkey = ClientCookie.keys[i];																				// key node name
				ckval = ClientCookie[ckkey];																					// client cookie key value
				
				if(ckval === null)																									// if a value hasn't been set, use the default
				{
					ckval = cookieDefault(ckkey);
				}

				ckitems.push(cookieItem(ckkey, ckval));																// convert key and value to a cookie item and put in an array
				
			}
			
			// concatenate the cookie items into a cookie string

			ClientCookie.clientcookiestr = null;																			// first get rid of the old string

			for(i=0; i<ckitems.length; i++)
			{
				ckstr = ckstr + ckitems[i];																						// cookie items
			}

			ckstr = ckstr + CK_VERSION;																						// append the version

			ClientCookie.clientcookiestr = ckstr;																		// set the data obj node

			ClientCookie.changed = true;																					// truthify the changed status
			ClientCookie.saved = false;																						// falsify the saved status
			
		}

	// ---------------------------------------------------------
	//		ITEM
	//		make a cookie	item
	// ---------------------------------------------------------

		function cookieItem(ckkey, ckval)	 {
	
			var cknbr = real2cookie(ckval);															// convert the real number to a cookie item number
	
			var ckitem = "/" + ckkey + cknbr;														// prepend the delimiter
	
			return ckitem;
	
		}

	// ---------------------------------------------------------
	//		REAL2COOKIE
	//		make a cookie	item-format number from a real number
	// ---------------------------------------------------------

		function real2cookie(inpnbr) {
		
			var enbr, eposn, esign, epwr, tmpnbr, strnbr, i, tohere;
			
			tmpnbr = parseFloat(inpnbr,10);														// make sure we're dealing with a real float				
			enbr = tmpnbr.toExponential(CKPRECIS);											// convert to exponential and limit precision to 5 digits		
			eposn = enbr.indexOf('e');																// find the position of the 'e'			
			esign = enbr.substr(eposn+1,1);														// position of the plus/minus sign			
			epwr = enbr.substr(eposn+2,1);														// position of the power of ten		
			enbr = enbr.substr(0,eposn);															// the number is all digits up to the 'e'		
			enbr = enbr.substr(0,1) + enbr.substr(2);											// drop the decimal point
	
			tohere = 0;																						// to drop trailing zeroes
			i = enbr.length-1;																			// i is a character pointer
			while(i > 0)
			{
				if(enbr.charAt(i) != "0") { break; }													// non-zero digit; break out
				if(enbr.charAt(i) == "0") { tohere = i; }											// if zero, move pointer back one
				i--;
			}
	
			if(tohere > 0) { enbr = enbr.substr(0, tohere); }									// if trailing zeroes were found, drop them
		
			esign == '+' ? enbr = enbr + 'E' : enbr = enbr + 'e';							// append uppercase E for 'e+' and lowercase for 'e-'		
			enbr = enbr + epwr;																			// append the power
			
			return enbr;																						// return it
		}
	
	// ---------------------------------------------------------
	//		SAVE
	// 	save the cookie string to document cookie
	// ---------------------------------------------------------
	
		function cookieSave() {
																						
			var ckstr = ClientCookie.clientcookiestr;															// current cookie string																

			cookieWrite(CK_CURNAME, ckstr);															// put the cookie string to document cookie
			
			ClientCookie.changed = false;
			ClientCookie.saved = true;
		}

	// ---------------------------------------------------------
	//		LOAD
	//		load cookie data into the data object
	// ---------------------------------------------------------

		function cookieLoad() {
			
			recursions++;																					// infinite recursion protection

			if(recursions > 5) { return false; }

			oldcookiesKill();																				// delete any old cookies if present
	
			var precookie = cookieRead(CK_CURNAME);
			var ckstr = null;
			var okckstr = false;
			var ckitems = [];
			var ckitem;
	
			if((precookie === null) || (precookie.length === 0))						// if there's no cookie
			{
				ckstr = DefCookie.defcookiestr;													// use the default cookie string
			}
			else
			{
				ckstr = precookie;																		// use the cookie got from document cookie
			}

			if(stringValidate(ckstr))																		// is this a valid string
			{
				if(cookieVersion(ckstr))																	// does it have the current cookie version
				{
					cookieKeysFill(ckstr);																// yes, fill the cookie keys from this cookie string

					ClientCookie.changed = true;													// so the cookie gets saved
					ClientCookie.saved = false;

					recursions = 0;																			// can be reset when coming down the correct path

					return true;
				}
				else																								// not a valid current cookie
				{
					cookieKill(CK_CURNAME, '', 'kill');												// delete the bad cookie
	
					return cookieLoad();																	// and do over

				}
			}
			else																									// neither cookie can be used
			{
				return false;
			}
		}

	// ---------------------------------------------------------
	//		ITEMS
	//		split a cookiestring into cookie items
	// ---------------------------------------------------------

		function cookieItems(cookiestr)	{

			var cookieitems = cookiestr.split('/');											// split cookiestring into array of cookie items
			cookieitems.pop();																		// get rid of outside delimiters
			cookieitems.shift();																		

			return cookieitems;																			// return the list of cookie items
		}

	// ---------------------------------------------------------
	//		FILL
	//		fill the cookie data key nodes from cookie string
	// ---------------------------------------------------------

		function cookieKeysFill(ckstring) {
			
			var ckitems = cookieItems(ckstring);																// divide the string into an array of cookie items

			for(i=0; i<ckitems.length; i++)																		// process array of cookie items
			{
				ckitem = ckitems[i];																					// one cookie item

				if(ckitem.indexOf('bbbv') >=0)																	// this is the version item
				{
					continue;																								// skip over it
				}
				ckkey = ckitem.substr(0,4);																		// key name
				ckvalstr = ckitem.substring(4);																	// cookie format value string
				ckvalue = cookie2real(ckvalstr);																// convert to real number

				cookiePut(ckkey, ckvalue);																		// put in node and validate

			}
		}

	// ---------------------------------------------------------
	//		COOKIE2REAL
	//		convert cookie string format number to real number
	// ---------------------------------------------------------

		function cookie2real(cknbr) {
		
			var esign, epower, edigits, emant, rnbr, snbr;
		
			var eminus = cknbr.indexOf('e');															// find lower-case 'e' if it's here
			var eplus = cknbr.indexOf('E');																// find upper-case 'e' if it's here
		
			if(eminus == -1) 																					// an uppercase 'E' was found
			{
				esign = 1;																							// sign of the exponent
				epower = cknbr.substr(eplus + 1, 1);													// power of the exponent
				edigits = cknbr.substr(0, eplus);														// mantissa
			}
			else if(eplus == -1)																				// lower case 'e' found
			{
				esign = -1;																						// exponent sign
				epower = cknbr.substr(eminus + 1, 1);												// power
				edigits = cknbr.substr(0, eminus);													// mantissa
			}
																														// insert decimal point and
			emant = parseFloat(edigits.substr(0,1) + '.' + edigits.substr(1),10);		// convert mantissa to float
		
			epower = epower * esign;																		// signed power of ten
			
			rnbr = emant * Math.pow(10, epower);													// multiply mantissa by power of 10
		
			snbr = rnbr.toPrecision(CKPRECIS+1);													// create number of given precision
			
			return parseFloat(snbr, 10);																	// return that number
		
		}
		
	// ---------------------------------------------------------
	//		DELETE
	//		delete the cookie who name is passed
	// ---------------------------------------------------------

		function cookieDelete(ckname) {
	
			cookieKill(ckname);
	
		}

	// ---------------------------------------------------------
	// 	VALIDATE VALUE
	//		return boolean
	// ---------------------------------------------------------
	
		function cookieValueValidate(ckkey, keyval) {
			var badval = false;
			var tmpval = '', cklim;
	
			// if value is a string 
			
			if(typeof keyval == 'string')													// if this is a string
			{
				if(!stringValidate(keyval))													// if it doesn't validate as a string
				{
					tmpval = keyval;															// if not, save it temp
					keyval = 'undefined';														// undefine it
					keyval = parseFloat(tmpval,10);									// convert to float
					
					if(!keyval)																		// if conversion failed
					{
						return false;																// set the flag and send it on through
					}
				}
				else
				{
					keyval = parseFloat(keyval, 10);									// convert to number
				}
			}
			
			// if the value is supposed to be a real number
			if(keyval === null)																// if null value
			{
				return false;
			}
			
			else if(isNaN(keyval))																// if it's not a number
			{
				return false;
			}
			
			else if(keyval <= 0)																// there are no negative values
			{
				return false;
			}
	
			// if the value failed validation
			
			if(badval)	
			{
				return false;
			}
			else																							// value passes validation as is
			{
				return	true;																			// return validated value
			}
		}
		
	// ---------------------------------------------------------
	// 	STRING VALIDATION
	//		just verify it's a string; return boolean
	// ---------------------------------------------------------
	 
		 function stringValidate(chkstr) {
		
			var badval = false;
		
			 if(typeof chkstr === 'undefined')											// undefined
			 {
				 badval = true;
			 }
			 else if(typeof chkstr !== 'string')											// not a string
			{
				badval = true;
			}
			 else if(chkstr === null)															// null
			 {
				 badval = true;
			 }
			 else if(chkstr.length === 0)													// empty
			 {
				 badval = true;
			 }
		
			 if(badval) { return false; } else { return true; }							// if bad return false
		}
	

	// ---------------------------------------------------------
	//		KEY NAME
	//		verify it's a cookie key name; return boolean
	// ---------------------------------------------------------
	
		function cookieKeyValidate(ckkey) {

			var keyfound = false;

			for(var i=0; i<ClientCookie.keys.length; i++)
			{
				if(ClientCookie.keys[i] == ckkey)
				{
					return true;
				}
			}

			return false;
		}

	// ---------------------------------------------------------
	// 	LIMITS
	//		just checks for outlandish, obviously errors, so only returns bool
	// ---------------------------------------------------------

		function cookieValueLimits(keyname, keyvalue) {
	
			var keydef = cookieKeyDefault(keyname);									// get default this property
			var toplimit = keydef * UBOUND;												// top and bottom limits									
			var bottomlimit = keydef * LBOUND;
	
			if(keyvalue > toplimit)																// top limit exceeded
			{
				return false;																			// failed top limit
			}
			else if(keyvalue < bottomlimit)													// ditto to above in opposite direction
			{
				return false;																			// failed limit check
			}
			else																							// value is between the two limits
			{
				return true;																			// send good news
			}

		}
	

	// ---------------------------------------------------------
	//		VERSION
	// 	checks the cookie string version number; returns bool
	// ---------------------------------------------------------
	
		function cookieVersion(cookiestr) {
		
			if(cookiestr.indexOf(CK_VERSION) < 0) { return false; } else { return true; }
			
		}
	
	// ==========================================
	//		COOKIE INTERFACE
	// ==========================================

	// ---------------------------------------------------------
	//		READ
	//		read cookie and return cookie string for this name
	// ---------------------------------------------------------
	
		function cookieRead(ckname)
		{
		
			var ck_str = '' + document.cookie;										// document cookie string
			
			if(ck_str === '') { return ''; }													// no cookie string
			
			var cksrch = ckname + '=';													// search string
			
			var here = ck_str.indexOf('; ' + cksrch);								// look for in cookie string
			
			if(here == -1)																		// if no semicolon then look at beginning
			{
				here = ck_str.indexOf(cksrch);					
				
				if(here !== 0)																	// if it's not here
				{
					return '';
				}
			}
			else																						// but if in middle, then use two digits after
			{
				here += 2;
			}
			
			var end = ck_str.indexOf(';', here);										// next semicolon is end of data
			
			if(end == -1) { end = ck_str.length; }									// no more semicolon, that's all the data
			
			// send back what we got, unescaped
			return unescape(ck_str.substring(here + cksrch.length, end));
			
		}
	
	// ---------------------------------------------------------
	//		WRITE
	//	 	write a new/modified document cookie
	// ---------------------------------------------------------
	
		function cookieWrite(ckname, ckstr) {
	
			var exp_date = new Date();
			var exp_str = '';
			var exptime = 30*24*60*60*1000;
			
			exp_date.setTime(exp_date.getTime() + exptime);				// expires on GMT date string
			exp_str = exp_date.toGMTString();
			
			ckstr = ckname + '=' + escape(ckstr);									// value		
			ckstr = ckstr + '; expires=' + exp_str;									// expiration			
			ckstr = ckstr + '; path=' + CK_PATH;									// path
			
			document.cookie = ckstr;														// set the cookie
			
		}
		
	// ---------------------------------------------------------
	//		DELETE
	//		delete old cookies
	// ---------------------------------------------------------

		function oldcookiesKill() {
	
			var ckstr = "";

			// delete named cookies

			var oldcknames = CKS_TOKILL;											// list of old cookie names
			var tstckstr = "";																
	
			for(var i=0; i<oldcknames.length; i++)							// delete that cookie if found
			{
				tstckstr = cookieRead(oldcknames[i]);							// look for a cookie string with this name
				if(tstckstr.length > 0)													// if a string was found
				{
					cookieKill(oldcknames[i]);											// delete it
				}
			}

			// delete outdated cookies of same name

			ckstr = cookieRead(CK_CURNAME);												// try to get a cookie for current name

			while((ckstr.length > 0)	 && (cookieVersion(ckstr) === false))		// if there is a cookie string for that name and old version
			{
				cookieKill(CK_CURNAME);															// delete it
				ckstr = cookieRead(CK_CURNAME);											// and see if there's any more
			}

			
		}
		
	// ---------------------------------------------------------
	//		delete a particular cookie
	// ---------------------------------------------------------

		function cookieKill(ckname) {
	
			var ckstr = "xxx";																	// dummy cookie value
			var exp_date = new Date();
			var exp_str = '';
			var exptime = -1000*60*60;												// set negative expiration time
			exp_date.setTime(exp_date.getTime() + exptime);
			exp_str = exp_date.toGMTString();										// expiration date & time
	
			ckstr = ckname + "=" + ckstr + "; expires=" + exp_str + "; path=" + CK_PATH;
	
			document.cookie = ckstr;														// set the cookie
	
		}

	/* ===================================================
		 MISC MULTIPLE-PURPOSE FUNCTIONS
	 =================================================== */

	// ---------------------------------------------------------
	//		look in array for passed value; if found, return index, -1 if not
	// ---------------------------------------------------------

		function inArray(arrlookin, lookfor) {

			var foundit = -1;																	// init the return value

			for(var i=0; i<arrlookin.length; i++)										// step through array passed
			{
				if(arrlookin[i] === lookfor)												// if the value here matches the lookfor value
				{
					foundit = i;																	// set the return to the location of the match
					break;
				}
			}

			return foundit;																		// return to caller
			
		}

	/* ===================================================
		 EVENT HANDLING
	 =================================================== */
	
	/* --------------------------------------------------------------------
	 	registered event handling
		 - onresize event for window width resize
	 --------------------------------------------------------------------- */
	
		function resizeRegister() {
		
			if(typeof window.addEventListener != 'undefined')
			{
				window.addEventListener('resize', resizingrescaling, true);
			}
			else if(typeof window.attachEvent != 'undefined')
			{
				window.attachEvent('onresize', resizingrescaling);
			}	
		
		}
		
	/* =====================================================	 
	 	DOCUMENT FONT SIZE
	=====================================================  */
	
	/* ----------------------------------------------------------
	 	takes a font size value as style string and strips the units,
	 	returning a real number, and its units, in separate cells
	 ------------------------------------------------------------ */
	
		function font2nbruni(fontstr) {
		
			var valuni = [null, 'px'];																	// default to px first level

			var sizetype = fontstr.indexOf('px');												// is it px
		
			if(sizetype == -1)																			// if it's not px
			{
				valuni[1] = "pc";																			// default to percent this level
				sizetype = fontstr.indexOf('%');													// is it percent
				if(sizetype == -1)
				{
					valuni[1] = 'em';																	// same with ems
					sizetype = fontstr.indexOf('em');											// if it's not that is it ems
					if(sizetype == -1)
					{
						return sizetype;																// if we have an error
					}
				}
			}
		
			valuni[0] = parseFloat(fontstr.substring(0, sizetype),10);				// return as a floating point

			return valuni;
		}

	/* ----------------------------------------------------------
		this is similar to above but just returns the number
	----------------------------------------------------------- */

		function font2number(fontstr) {

			var sizetype = fontstr.indexOf('px');												// is it px
		
			if(sizetype == -1)																			// if it's not px
			{
				sizetype = fontstr.indexOf('%');													// is it percent
				if(sizetype == -1)
				{
					sizetype = fontstr.indexOf('em');											// if it's not that is it ems
					if(sizetype == -1)
					{
						return sizetype;																// if we have an error
					}
				}
			}
		
			return parseFloat(fontstr.substring(0, sizetype),10);						// return as a floating point

		}


	/* ------------------------------------------------------------
		 increase/decrease font size
	 ------------------------------------------------------------- */
	
		function fs_updown(clickobj)
		{
			var dfasset = cookieGet('dcfs');																	// current cookie doc font size
			var fsdir = 0;
			var hr;
		
			if(clickobj.id == "downclick")	{ fsdir = -1; } else { fsdir = 1; }					// get click direction
		
			var dftoset = dfasset + (fsdir * FSINCR);													// compute new size

			if(dftoset > DOCFNTMAX) { dftoset = DOCFNTMAX; }								// limit doc fontsize
			else if(dftoset < DOCFNTMIN) { dftoset = DOCFNTMIN; }
		
			cookiePut('dcfs', dftoset);																			// set the data object
	
			sizingscaling();																							// compute any changes on scalable objects
			sizingscalingset();																						// set the font size
	
		}

	
	/* ================================================
	 	DOCUMENT OBJECTS SIZING & SCALING
	=================================================  */

	/* ------------------------------------------------------------
		sizing and scaling of header and contained objects and font size
	------------------------------------------------------------ */

		function sizingscaling() {

			var docfont, hdrfont, hdrfont_df, hdrfont_hh, hdrwidth, pgwidth, hdrheight;

			// document font

			docfont = cookieGet('dcfs');																		// get document font size from cookie
			if(docfont === null)																					// if there is no cookie or doc font not set
			{
				docfont = font2number(document.body.style.fontSize);						// use the body font as set inline style
				cookiePut('dcfs', docfont);																		// put doc font size in cookie data object
			}

			// computation for header font based on header width and ratios

			hdrfont_df = docfont * HF2DF;																			// use a ratio of document font

			pgwidth = document.body.clientWidth;														// window width px
			hdrwidth = pgwidth * HW2PW;																	// header width px per ratio

			hdrheight = hdrwidth / HW2HH;																// desired header height in px per ratio of width

			hdrfont_hh = hdrheight / HH2HF;																	// recompute header font


			hdrfont = trimprecis(((hdrfont_df + hdrfont_hh)/2), 3);							// use an average and trim precision
	
			cookiePut('hdfs', hdrfont);																			// put header font in cookie

			cookieMake();
			cookieSave();
			
		}

		function sizingscalingset() {

			var docfont = cookieGet('dcfs');
			var hdrfont = cookieGet('hdfs');

			document.body.style.fontSize = docfont + 'px';
			document.getElementById('header-box').style.fontSize = hdrfont + 'px';

		}

		function resizingrescaling() {

			sizingscaling();
			sizingscalingset();

		}

	// -----------------------------------------------------------
	//		trims uneeded digits, given value and desired precision
	// -----------------------------------------------------------
	
		function trimprecis(trimval, trimpoints) {

			var exp10 = Math.pow(10, trimpoints);

			trimval = trimval * exp10;			
			trimval = Math.round(trimval);		
			trimval = trimval / exp10;
		
			return trimval;
		
		}
		

	/* =======================================================
	 FORMS AND FORM SUBMITTALS
	=======================================================  */
	
	/* --------------------------------------------------------------
	 	form reset
	 --------------------------------------------------------------- */
	
		function fieldReset(fieldID)
		{
			fieldObj = document.getElementById(fieldID);
			fieldObj.className = "mainForm";
		}
		
		function allfieldsReset()
		{
			var fieldID = "field_email";
			fieldReset(fieldID);
			
			fieldID = "field_website";
			fieldReset(fieldID);
			
			fieldID = "field_nname";
			fieldReset(fieldID);
			
			fieldID = "field_howmsg";
			fieldReset(fieldID);
			
			window.location.reload();
			
		}
	
	/* ------------------------------------------------------------------
		 image width status: normal/wide
	 ------------------------------------------------------------------- */
	
		function iswidth(objid) {
			var objclname = document.getElementById(objid).className;
			if(objclname.indexOf("-wide") > 0)
			{
				return "wide";
			}
			else
			{
				return "normal";
			}
		}
	
	/* -------------------------------------------------------------------
		 resize one image
	 --------------------------------------------------------------------- */
	
		function vimg_resize(imgnbr, vsize) {
			
			var otoresize = new Object();
			otoresize = document.getElementById("img" + imgnbr + "box");			// image container box
			var oclname = otoresize.className;													// class name
			var vfocus = oclname.indexOf("unfocus");											// focus state
			
			/* main present focus state */
			
			if(vfocus > 0)																						// is unfocus
			{
				oclname = "testimage-unfocus-";														// build class name
			}
			else
			{
				oclname = "testimage-focus-";															// focus state
			}
			
			/* set  width state per arg */
			
			if(vsize == "wide")																				// current is normal
			{
				oclname = oclname + "wide";															// class name for wide
			}
			else
			{
				oclname = oclname + "normal";														// class name for normal
			}
			otoresize.className = oclname;															// set the name of the box
			
			/* set the dimension attributs of the img */
			
			otoresize = document.getElementById("img" + imgnbr)						// ref the object
			if(vsize == "wide")																				// current state is normal
			{
				otoresize.className = "clickimage-wide";										// set wide
				otoresize.width = "150";																	// img attributes
				otoresize.height = "150";
			}
			else																										// set normal
			{
				otoresize.className = "clickimage";
				otoresize.width = "110";
				otoresize.height = "110";
			}
			
		}
		
	/* -------------------------------------------------------------------------
		 resize images
	 --------------------------------------------------------------------------- */
	
		function vimgs_resize() {
			
			var i = 0;
			var otoresize = new Object();
			otoresize = document.getElementById("images-validation");					// start with outermost box
			var resizecn = otoresize.className;														// get the class name
			if(resizecn.substr(resizecn.length - 5) == "-wide")								// if it ends in -wide then reduce size
			{
				otoresize.className = "validation-images";										
				otoresize = document.getElementById("images-choices");				// change class name to normal width
				otoresize.className = "img-choices-box";										// next box
				for(i=0; i<4; i++)																				// and all four images
				{
					vimg_resize(i, "norm");
				}
			}
			else																										// otherwise it's narrow,now set wide
			{
				otoresize.className = "validation-images-wide";
				otoresize = document.getElementById("images-choices");
				otoresize.className = "img-choices-box-wide";
				for(i=0; i<4; i++)
				{
					vimg_resize(i, "wide");
				}
			}
			
		}
	
	/* ---------------------------------------------------------------------
		 image state check
	 ------------------------------------------------------------------------ */
	
		function imgsStatus() {
			var boxid = "";
			var boxval = "";
			
			for(var i=0;  i<4; i++)																// step through the four images
			{
				boxid = "img" + i + "box";
				boxval = document.getElementById("img"+i).value;				// check the value attribute
				if(boxval == "1")																	// if this object is highlighted
				{
					return "img" + i;																// return the id of the contained image
				}
			}
			
			return "none";																			// no highlighted images were found
		}
	
	/* -------------------------------------------------------------------
		 unfocus the highlighted image
	 --------------------------------------------------------------------- */
	
		function unfocusImage(imgid) {
			
			document.getElementById(imgid+"box").className = "testimage-unfocus-" + iswidth(imgid);
			document.getElementById(imgid).value = "0";
		}
		
	/* --------------------------------------------------------------------
	 	focus the image
	 --------------------------------------------------------------------- */
	
		function focusImage(imgid) {
			
			document.getElementById(imgid+"box").className = "testimage-focus-" + iswidth(imgid);
			document.getElementById(imgid).value = "1";
		}
	
	/* -------------------------------------------------------------------
		 set/unset the image answer based on image clicked
	 --------------------------------------------------------------------- */
	
		function setAnswer(imgid, setunset) {
			
			objinvis = document.getElementById("field_invis");						// pointer to the object
			var curval = objinvis.value;															// current value of the invisible value attribute
			
			var imgpath = document.getElementById(imgid).src;					// get the image source
			var imgfile = imgpath.substr(imgpath.lastIndexOf("/") + 1);			// split the file name off the path
			var imgname = imgfile.substr(0, imgfile.indexOf("."));					// drop the extension
			
			if(setunset == "unset")																	// if unsetting previously set image
			{
				imgname = "XXX";																	// just x it out
			}
			
			if(curval.substr(curval.length-1) != "=")										// if the last character isn't equals sign
			{
				curval = curval.substring(0,curval.indexOf("=") + 1);				// drop the image name already there
			}
			
			curval = curval + imgname;															// now append the image name
			objinvis.value = curval;																	// append the image picked
			
		}
	
	/* -----------------------------------------------------------------
		 set/unset the clicked image
	 ------------------------------------------------------------------- */
	
		function setChoice(imgid) {	
			
			var setimg = imgsStatus();										// check status of all images
			
			if(setimg == "none")													// if no other image highlighted
			{
				focusImage(imgid);												// focus this one
				setAnswer(imgid, "set");										// record the pick
				return;
			}
			if(setimg == imgid)													// if the image clicked is already highlighted
			{
				unfocusImage(imgid);											// then unfocus this one
				setAnswer(imgid, "unset");
				return;
			}
			unfocusImage(setimg);												// unhighlight this one
			setAnswer(setimg, "unset");										// and remove as answer
			focusImage(imgid);													// highlight the clicked image
			setAnswer(imgid, "set");											// record the pick
		}
	
	/* ----------------------------------------------------------------------
		 highlight the focused input field
	 ------------------------------------------------------------------------- */
	
		function field_setborder(obj) {
			
			if(obj.value.length > 0)
			{
				obj.className = "field-contactform-notnull-focus";
			}
			else
			{
				obj.className = "field-contactform-focus";
			}
		}
		
	/* ----------------------------------------------------------------------
		 unhighlight input field
	 ---------------------------------------------------------------------- */
	
		function field_unsetborder(obj) {
			
			if(obj.value.length > 0)
			{
				obj.className = "field-contactform-notnull";
			}
			else
			{
				obj.className = "field-contactform";
			}
			
		}
	
	/* ======================================================
	 	PAGE LOAD AND UNLOAD
	=======================================================  */

	/* ----------------------------------------------------------------------
		 no valid cookie was found pre-load; executes immediately after page body
	 ---------------------------------------------------------------------- */

		// hide everything until cookie is written and styles are sized and scaled
		// this will no execute if javascript is disabled, and the defaults will be rendered

		function nocookiePreload() {
			
			document.body.style.visibility = "hidden";	

			return false;

		}

	/* ----------------------------------------------------------------------
		 on load this executes if there's no cookie
	 ---------------------------------------------------------------------- */
	
		function nocookiePgload() {

			resizeRegister();																					// register event handler for window resize

			sizingscaling();																						// do the sizing & scaling

			cookieMake();																						// save the cookie results
			cookieSave();

			sizingscalingset();																					// set the styles

			document.body.style.visibility = "visible";												// make them visible
			
			return false;

		}
	
	/* ----------------------------------------------------------------------
		 normal onload when a cookie is found
	 ---------------------------------------------------------------------- */
	
		function normalPreload() {

			return false;																							// normal preload does nothing
				
			
		}
			
		function normalPgload() {

			cookieLoad();																						// load cookie data object

			resizeRegister();																					// register event handler		
																												
			sizingscaling();																						// do the resize/scaling

			if((ClientCookie.changed === true) && (ClientCookie.saved === true))		// if cookie node value changed
			{
				cookieMake();																						// save the cookie results
				cookieSave();																					// and save it
			}

			return false;	

		}
		
	/* ----------------------------------------------------------------------
		save cookie on page unload
	 ---------------------------------------------------------------------- */	

		function pgUnload() {

			sizingscaling();
			cookieMake();																						// save the cookie results
			cookieSave();

		}
	
	// --------------------------------------------------------------
	//	BROWSER QUIRKS COMPENSATION
	//	special cases
	
	// IE6
	
	function ie6comp1() {

		document.getElementById("title-box").style.visibility = "hidden";
	}

	function ie6comp2() {
		
		document.getElementById("pumper-box").style.width = "43%";
		document.getElementById("title-box").style.width = "20%";
		document.getElementById("bye1box").style.width = "100%";
		document.getElementById("bye2box").style.width = "100%";
		document.getElementById("bumsbox").style.width = "100%";
		document.getElementById("title-box").style.visibility = 'visible';
	}
	