//preload images
var inActiveImg = new Image();
inActiveImg.src = "/images/mminaktht.gif";
var activeImg = new Image();
activeImg.src = "/images/mmaktht.gif";

function setBG(tdID, activeState) // tdId: a TD ID-ja, ERTEM??? ;)) | activeState: 0, vagy 1. ha 0, akkor inaktiv; ha 1 akkor aktiv a cucc
{
	
	if (activeState == 1)
	{
		if (document.all) //IE
			document.getElementById(tdID).background = activeImg.src;
			else
				if (document.getElementById && !document.all) //NS6+
					document.getElementById(tdID).style.backgroundImage = "url(" + activeImg.src + ")";
	} else
	  {
			if (document.all) //IE
				document.getElementById(tdID).background = inActiveImg.src;
				else
					if (document.getElementById && !document.all) //NS6+
						document.getElementById(tdID).style.backgroundImage = "url(" + inActiveImg.src + ")";
	  }	
}

//preload images
var tinActiveImg = new Image();
tinActiveImg.src = "/images/fmenuinaktht.gif";
var tactiveImg = new Image();
tactiveImg.src = "/images/fmenuaktht.gif";

function settBG(tdID, activeState) // tdId: a TD ID-ja, ERTEM??? ;)) | activeState: 0, vagy 1. ha 0, akkor inaktiv; ha 1 akkor aktiv a cucc
{
	
	if (activeState == 1)
	{
		if (document.all) //IE
			document.getElementById(tdID).background = tactiveImg.src;
			else
				if (document.getElementById && !document.all) //NS6+
					document.getElementById(tdID).style.backgroundImage = "url(" + tactiveImg.src + ")";
	} else
	  {
			if (document.all) //IE
				document.getElementById(tdID).background = tinActiveImg.src;
				else
					if (document.getElementById && !document.all) //NS6+
						document.getElementById(tdID).style.backgroundImage = "url(" + tinActiveImg.src + ")";
	  }	
}

//preload images
var binActiveImg = new Image();
binActiveImg.src = "/images/inaktbuttonht.gif";
var bactiveImg = new Image();
bactiveImg.src = "/images/aktbuttonht.gif";

function setbBG(tdID, activeState) // tdId: a TD ID-ja, ERTEM??? ;)) | activeState: 0, vagy 1. ha 0, akkor inaktiv; ha 1 akkor aktiv a cucc
{
	
	if (activeState == 1)
	{
		if (document.all) //IE
			document.getElementById(tdID).background = bactiveImg.src;
			else
				if (document.getElementById && !document.all) //NS6+
					document.getElementById(tdID).style.backgroundImage = "url(" + bactiveImg.src + ")";
	} else
	  {
			if (document.all) //IE
				document.getElementById(tdID).background = binActiveImg.src;
				else
					if (document.getElementById && !document.all) //NS6+
						document.getElementById(tdID).style.backgroundImage = "url(" + binActiveImg.src + ")";
	  }	
}

	var activeBg = new Image();
	activeBg.src = "/images/mmaktht.gif";
	var inActiveBg = new Image();
	inActiveBg.src = "/images/mminaktht.gif";
	var activeImg = new Image();
	activeImg.src = "/images/mmaktbottom.gif";
	var inActiveImg = new Image();
	inActiveImg.src = "/images/mminaktbottom.gif";

		function menuOver(mID,mState)
	{
		if (mState == "active")
		{
			if (document.all) // ie
			{
				document.getElementById(mID).background = activeBg.src;
				document["pic" + mID].src = activeImg.src;
			} else
				if (document.getElementById && !document.all) // ns6+
				{
					document.getElementById(mID).style.backgroundImage = "url(" + activeBg.src + ")";
					document["pic" + mID].src = activeImg.src;
				}
		} else
			{
				if (document.all) // ie
				{
					document.getElementById(mID).background = inActiveBg.src;
					document["pic" + mID].src = inActiveImg.src;
				} else
					if (document.getElementById && !document.all) // ns6+
					{
						document.getElementById(mID).style.backgroundImage = "url(" + inActiveBg.src + ")";
						document["pic" + mID].src = inActiveImg.src;
					}
			}
	}
	
var inActivImages = new Array("/images/mminaktbottom.gif","/images/mminaktbottom.gif","/images/mminaktbottom.gif","/images/cmbottominakt.gif","/images/cmbottominakt.gif","/images/cmbottominakt.gif");
var inActivBackground = new Array("/images/mminaktht.gif","/images/mminaktht.gif","/images/mminaktht.gif","/images/cmnoteinakt.gif","/images/cmdcaminakt.gif","/images/cmkieginakt.gif");

var activImages = new Array("/images/mmaktbottom.gif","/images/mmaktbottom.gif","/images/mmaktbottom.gif","/images/cmbottomakt.gif","/images/cmbottomakt.gif","/images/cmbottomakt.gif");
var activBackground = new Array("/images/mmaktht.gif","/images/mmaktht.gif","/images/mmaktht.gif","/images/cmnoteakt.gif","/images/cmdcamakt.gif","/images/cmkiegakt.gif");
//********************* dynamic img start
var PInactiveArr = new Array();
var PInactiveBackgroundArr = new Array();
var PActiveArr = new Array();
var PActiveBackgroundArr = new Array();

function addNewRollOverImg(activeImg, inactiveImg, count, reverse) {
	PInactiveArr[count] = new Image();
	PInactiveArr[count].src = (reverse ? "/images/cmbottomakt.gif" : "/images/cmbottominakt.gif");

	PInactiveBackgroundArr[count] = new Image();
	PInactiveBackgroundArr[count].src = inactiveImg;
	
	PActiveArr[count] = new Image();
	PActiveArr[count].src = (reverse ? "/images/cmbottominakt.gif" : "/images/cmbottomakt.gif");
	
	PActiveBackgroundArr[count] = new Image();
	PActiveBackgroundArr[count].src = activeImg;
}

function changeImgState(arrIndex, ID, state) {
	var kep = getObj(ID);

	if (IE) {
		if (state == 1) {
			kep.background = PActiveBackgroundArr[arrIndex].src;
			document["menu_pict_" + arrIndex].src = PActiveArr[arrIndex].src;
		} else {
			kep.background = PInactiveBackgroundArr[arrIndex].src;
			document["menu_pict_" + arrIndex].src = PInactiveArr[arrIndex].src;
		}
	}
}
//********************* dynamic img end
//preload
var PinActivImages = new Array();
var PinActivBackground = new Array();

var PactivImages = new Array();
var PactivBackground = new Array();

//preload images
for (var i=0; i<inActivImages.length; i++)
{
	PinActivImages[i] = new Image();
	PinActivImages[i].src = inActivImages[i];
	
	PinActivBackground[i] = new Image();
	PinActivBackground[i].src = inActivBackground[i];
	
	PactivImages[i] = new Image();
	PactivImages[i].src = activImages[i];
	
	PactivBackground[i] = new Image();
	PactivBackground[i].src = activBackground[i];
}

var NN=false; var IE=false;
function getObj(name)
{	
        if (document.getElementById && !document.all)
        {
				NN = true;
                return document.getElementById(name).style;
        }
        else if (document.all)
        {
				IE = true;
                return document.all[name];
        }
        else if (document.layers)
        {
                return document.layers[name];
        }
        else return false;
}

function changeMP(arrIndex, ID, state)
{
	var kep = getObj(ID);
	if(IE)
	{
	if (state == 1)
	{
		kep.background = PactivBackground[arrIndex].src;
		//if(NN) kep.backgroundImage = "url(" +PactivBackground[arrIndex].src + ")";
		document["pic" + ID].src = PactivImages[arrIndex].src;
	} else {
		kep.background = PinActivBackground[arrIndex].src;
		//if(NN) kep.backgroundImage = "url(" +PinActivBackground[arrIndex].src + ")";
		document["pic" + ID].src = PinActivImages[arrIndex].src;
	}
	}
}
/*
function changeMP(arrIndex, ID, state)
{
	if (state == 1)
	{
		if (document.all)
		{
			document.getElementById(ID).background = PactivBackground[arrIndex].src;
			document["pic" + ID].src = PactivImages[arrIndex].src;
//alert('balna'+document.getElementById(ID).background);
		} else
			if (document.getElementById && !document.all)
			{
				document.getElementById(ID).style.backgroundImage = "url(" +PactivBackground[arrIndex].src + ")";
				document["pic" + ID].src = PactivImages[arrIndex].src;
alert('balna2'+PactivBackground[arrIndex].src);
			}
	} else
	  {
			if (document.all)
			{
				document.getElementById(ID).background = PinActivBackground[arrIndex].src;
				document["pic" + ID].src = PinActivImages[arrIndex].src;
			} else
				if (document.getElementById && !document.all)
				{
					document.getElementById(ID).style.backgroundImage = "url(" +PinActivBackground[arrIndex].src + ")";
alert('balan'+document.getElementById(ID).style.backgroundImage);
					document["pic" + ID].src = PinActivImages[arrIndex].src;
				}
	  }
}
*/
