function twoStates(intHsize,intVsize,stat1,stat2) {
	if (document.images) {
		this.imgStat1		= new Image(intHsize,intVsize);
		this.imgStat1.src	= stat1;
		this.imgStat2		= new Image(intHsize,intVsize);
		this.imgStat2.src	= stat2;
		}
	}

function fourStates(intHsize,intVsize,stat1,stat2,stat3,stat4) {
	if (document.images) {
		this.imgStat1		= new Image(intHsize,intVsize);
		this.imgStat1.src	= stat1;
		this.imgStat2		= new Image(intHsize,intVsize);
		this.imgStat2.src	= stat2;
		this.imgStat3		= new Image(intHsize,intVsize);
		this.imgStat3.src	= stat3;
		this.imgStat4		= new Image(intHsize,intVsize);
		this.imgStat4.src	= stat4;
		}
	}

function show(name,state){
	if (document.images){
		document.images[name].src	= object[name][state].src;
	}
}

// MISC CLEANING-AFTER-MICROSOFT STUFF

function isUndefined(v) { /*
	returns true if [v] is not defined, false otherwise

	IE 5.0 does not support the undefined keyword, so we cannot do a direct 
	comparison such as v===undefined. 
	*/
	var undef;
	return v===undef;
}

/* Pop-up Functions from list apart */

var _POPUP_FEATURES = 'location=0,statusbar=0,menubar=0,width=650,height=400';

function raw_popup(url, target, features) {
    // pops up a window containing url optionally named target, optionally having features
    if (isUndefined(features)) features = _POPUP_FEATURES;
    if (isUndefined(target  )) target   = '_blank';
    var theWindow = window.open(url, target, features);
    theWindow.focus();
    return theWindow;
}

function link_popup(src, features) {
    // to be used in an html event handler as in: <a href="..." onclick="link_popup(this,...)" ...
    // pops up a window grabbing the url from the event source's href
    return raw_popup(src.getAttribute('href'), src.getAttribute('target') || '_blank', features);
}

function event_popup(e) {
    // to be passed as an event listener
    // pops up a window grabbing the url from the event source's href
    link_popup(e.currentTarget);
    e.preventDefault();
}

function event_popup_features(features) {
    // generates an event listener similar to event_popup, but allowing window features
    return function(e) { link_popup(e.currentTarget, features); e.preventDefault() }
}
