var mainmtabs={
	subcontainers:[], last_accessed_tab:null,
	revealsubmenu:function(curtabref){
	this.hideallsubs()
	if (this.last_accessed_tab!=null)
		this.last_accessed_tab.className=""
	if (curtabref.getAttribute("rel")) //If there's a sub menu defined for this tab item, show it
	document.getElementById(curtabref.getAttribute("rel")).style.display="block"
	var test6= new String(curtabref);
	curtabref.className="current"+test6.substring(test6.length-1);
	this.last_accessed_tab=curtabref;
	},

	hideallsubs:function(){
	for (var i=0; i<this.subcontainers.length; i++)
		document.getElementById(this.subcontainers[i]).style.display="none"
	},

	init:function(menuId, selectedIndex){
	var tabItems=document.getElementById(menuId).getElementsByTagName("a")
		for (var i=0; i<tabItems.length; i++){
			if (tabItems[i].getAttribute("rel"))
				this.subcontainers[this.subcontainers.length]=tabItems[i].getAttribute("rel") //store id of submenu div of tab menu item
			if (i==selectedIndex){ //if this tab item should be selected by default
				var ttt="current"+selectedIndex;
				tabItems[i].className=ttt;
				this.revealsubmenu(tabItems[i])
			}
		tabItems[i].onclick=function(){
		mainmtabs.revealsubmenu(this)
		}
		} //END FOR LOOP
	}
}



function getCenter() {
		var myWidth = 0, myHeight = 0;
		if( typeof( window.innerWidth ) == 'number' ) {	//Non-IE
		myWidth = window.innerWidth;myHeight = window.innerHeight;
		} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;myHeight = document.documentElement.clientHeight;
		} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;myHeight = document.body.clientHeight;
		}
		scc = getScrollXY();var sc = scc[1];
		var sc2 = scc[0];
	if (navigator.userAgent.indexOf("Firefox")!=-1){
		document.getElementById('mmymmsg').style.marginTop = sc + ((myHeight - 150)/2) - 150 + "px";
		document.getElementById('mmymmsg').style.marginLeft = (myWidth - 650)/2 +"px";
	}else{
		document.getElementById('mmymmsg').style.marginTop = sc + ((myHeight - 150)/2) - 150 + "px";
		document.getElementById('mmymmsg').style.marginLeft = (myWidth - 650)/2 +"px";
	}
	
}
function myclose(){	document.getElementById('mmymmsg').style.display='none';}
function getScrollXY() {
		var scrOfX = 0, scrOfY = 0;
		if( typeof( window.pageYOffset ) == 'number' ) {//Netscape compliant
		scrOfY = window.pageYOffset;scrOfX = window.pageXOffset;
		} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {	//DOM compliant
		scrOfY = document.body.scrollTop;scrOfX = document.body.scrollLeft;
		} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		//IE6 standards compliant mode
		scrOfY = document.documentElement.scrollTop;scrOfX = document.documentElement.scrollLeft;}return [ scrOfX, scrOfY ];
	}
function bbbshow2(){
	getCenter();
	document.getElementById('mmymmsg').style.display='block';
}
function getHHH(){

if( window.innerHeight && window.scrollMaxY ) {
pageWidth = window.innerWidth + window.scrollMaxX;
pageHeight = window.innerHeight + window.scrollMaxY;
}
else if( document.body.scrollHeight > document.body.offsetHeight ) 
{
pageWidth = document.body.scrollWidth;
pageHeight = document.body.scrollHeight;
}
else 
{ pageWidth = document.body.offsetWidth + document.body.offsetLeft; pageHeight = document.body.offsetHeight + document.body.offsetTop; }
return pageHeight;
}
