function tabstate(tabdiv,tabimage)
{

//var tabimageover = 'url(/imgs/'+tabimage+'-on.gif) bottom no-repeat';

//MM_swapImgRestore();
//MM_swapImage(tabid,'',tabimageover,0);

//tabstaterestore();
//setStyleById(tabid,'background',tabimageover);

var tablayeron = tabimage+'-on';
var tablayeroff = tabimage+'-off';

hidelayer('tab-mailinglist-on');
hidelayer('tab-coupon-on');
hidelayer('tab-login-on');
showlayer('tab-mailinglist-off');
showlayer('tab-coupon-off');
showlayer('tab-login-off');
hidelayer(tablayeroff);
showlayer(tablayeron);

hidelayer('loginbardiv');
hidelayer('couponbardiv');
hidelayer('mailinglistbardiv');
hidelayer('lostpassbardiv');
showlayer(tabdiv);
}

function setStyleById(i, p, v) {
//  i - element id
//  p - property
//  v - value
	var n = document.getElementById(i);
	n.style[p] = v;
}

function tabstaterestore()
{
	setStyleById('mailinglisttab','background','url(/imgs/tab-mailinglist-off.gif) bottom no-repeat');
	setStyleById('coupontab','background','url(/imgs/tab-coupon-off.gif) bottom no-repeat');
	setStyleById('logintab','background','url(/imgs/tab-login-off.gif) bottom no-repeat');
}

function showlayer(layerid)
{	
	if (document.getElementById)
	{
		// this is the way the standards work
		var style2 = document.getElementById(layerid).style;
		style2.display = "block";
	}
	else if (document.all)
	{
		// this is the way old msie versions work
		var style2 = document.all[layerid].style;
		style2.display = "block";
	}	
}

function hidelayer(layerid)
{
	if (document.getElementById)
	{
		// this is the way the standards work
		var style2 = document.getElementById(layerid).style;
		style2.display = "none";
	}
	else if (document.all)
	{
		// this is the way old msie versions work
		var style2 = document.all[layerid].style;
		style2.display = "none";
	}
}
