var commonImgArray = new Array();

// ev2JsImgCommon for common changing image 

function ev2JsImgCommon( imgName, ref, imgOffSrc, imgOnSrc, statusText ) {
	if (imgok == 1){
		this.name = imgName;
		this.ref = ref;
		this.on = new Image();
		this.on.src = imgOnSrc;
		this.off = new Image();
		this.off.src = imgOffSrc;
		if ( statusText ) {
			this.text = statusText;
		}
		else {
			this.text = "";
		}
	}
}

// addImageCommon for common changing image

function addImageCommon( imgName, ref, imgOffSrc, imgOnSrc, statusText ) {
	if (imgok == 1){
		commonImgArray[imgName] = new ev2JsImgCommon( imgName, ref, imgOffSrc, imgOnSrc, statusText );
	}
}


// showOnImageCommon for common changing image

function showOnImageCommon( imgName ) {
	if ( imgok == 1 ) {
		ref = commonImgArray[imgName].ref;
		document.images[ref].src = commonImgArray[imgName].on.src;
		if ( commonImgArray[imgName].text.length > 0 ) {
			status = commonImgArray[imgName].text;
		}
		else {
			status = defaultStatus;
		}
	}
}

// showOffImageCommon for common changing image

function showOffImageCommon( imgName ) {
	if ( imgok == 1 ) {
		ref = commonImgArray[imgName].ref;
		document.images[ref].src = commonImgArray[imgName].off.src;
		status = defaultStatus;
	}
}

var imgArray = new Array();

// ev2JsImg 

function ev2JsImg( imgName, imgOffSrc, imgOnSrc, statusText ) {
	if (imgok == 1){
		this.name = imgName;
		this.on = new Image();
		this.on.src = imgOnSrc;
		this.off = new Image();
		this.off.src = imgOffSrc;
		if ( statusText ) {
			this.text = statusText;
		}
		else {
			this.text = "";
		}
	}
}

// addImage

function addImage( imgName, imgOffSrc, imgOnSrc, statusText ) {
	if (imgok == 1){
		imgArray[imgName] = new ev2JsImg( imgName, imgOffSrc, imgOnSrc, statusText );
	}
}


// showOnImage

function showOnImage( imgName ) {
	if ( imgok == 1 ) {
		document.images[imgName].src = imgArray[imgName].on.src;
		if ( imgArray[imgName].text.length > 0 ) {
			status = imgArray[imgName].text;
		}
		else {
			status = defaultStatus;
		}
	}
}

// showOffImage

function showOffImage( imgName ) {
	if ( imgok == 1 ) {
		document.images[imgName].src = imgArray[imgName].off.src;
		status = defaultStatus;
	}
}



