

//===============================
//image hilite without submenu-popup
//==============================
function mainButton(whichImg,offsrc,onsrc) {
	this.imgname = new Object(whichImg);
	this.imgname.createHiliteImages = createImgObjs;
	this.imgname.createHiliteImages(offsrc,onsrc,'');
}

//function for module m581
function stageButton(whichImg,offsrc,onsrc,hisrc) {
	this.imgname = new Object(whichImg);
	this.imgname.createHiliteImages = createImgObjs;
	this.imgname.createHiliteImages(offsrc,onsrc,hisrc);
}

//hilite-image method
function createImgObjs(offsrc,onsrc,hisrc,midsrc,big800,big1024,big1280) {
	this.offimg = new Image();
	this.offimg.src = offsrc;
	this.onimg = new Image();
	this.onimg.src = onsrc;
	this.hiliteimg = new Image();
	this.hiliteimg.src = hisrc;
	if (arguments.length > 3) {
		this.midimg = midsrc;
		this.big800 = big800;
		if (big1024) this.big1024 = big1024;
		if (big1280) this.big1280 = big1280;
	}
}

function showHigh(whichButton,whichPic) {
	if (whichPic == 0) document.images[whichButton.imgname].src = whichButton.imgname.onimg.src;
}

function resetHigh(whichButton,whichPic) {
	if (whichPic == 0) document.images[whichButton.imgname].src = whichButton.imgname.offimg.src;
}

/**
 * Functions for m581 highlighting
 */

var activeStagePic;

function changeStageHigh (pButton, pURL, pCacheKiller) {
	var stageId = "gallery_media";
	var stageImg = document.getElementById(stageId + '_container');
	if (!stageImg) {
		stageImg = document.getElementById(stageId);
	}
	if (!stageImg) {	
		return;	
	}
	var iFrame = document.createElement('iframe');
	iFrame.setAttribute('width', 479);
	iFrame.setAttribute('height', 300);
	iFrame.setAttribute('frameborder', '0');
	iFrame.setAttribute('scrolling', 'no');
	iFrame.setAttribute('id', stageId);
	if (pCacheKiller) {
		iFrame.setAttribute('src', pURL + "?" + pCacheKiller);
	} else {
		iFrame.setAttribute('src', pURL);
	}
	iFrame.setAttribute('align', 'middle');
	stageImg.parentNode.replaceChild(iFrame, stageImg);
	if (activeStagePic && activeStagePic != pButton.imgname) {
		document.images[activeStagePic].src = activeStagePic.offimg.src;
	}
	activeStagePic = pButton.imgname;
}

function showStageHigh(whichButton,whichPic) {
	if (whichPic == 0) {
		document.images[whichButton.imgname].src = whichButton.imgname.onimg.src;
	}
}

function resetStageHigh(whichButton,whichPic) {
	if (whichPic == 0 && activeStagePic != whichButton.imgname) {
		document.images[whichButton.imgname].src = whichButton.imgname.offimg.src;
	}
}

function setOffStage(whichImg) {
	stageimgsrc = whichImg;
}

