var demoTab=1;
var demoSlide=1;
var maxSlide;
function init(){
	document.a.login.focus();
}
function SubmitLogin(){
	document.a.SWidth.value = document.body.clientWidth;
	document.a.SHeight.value = document.body.clientHeight;
}
function MM_showHideLayers(){
	var i,l,v,args=MM_showHideLayers.arguments;
	for (i=0; i<(args.length-2); i+=3){
		l=args[i];
		v=args[i+2];
		if (v=="show"){
			showElement(l);
		}else{
			hideElement(l);
		}
	}
}
function hideElement(element_id){
	if (document.getElementById && document.getElementById(element_id) && document.getElementById(element_id).style)
		document.getElementById(element_id).style.visibility="hidden";
}
function showElement(element_id){
	if (document.getElementById && document.getElementById(element_id) && document.getElementById(element_id).style)
		document.getElementById(element_id).style.visibility="visible";
}
function gotoTab(strTab){
	if(strTab=="exec")	{
		formatTab(1,"on");
		formatTab(2,"off");
		formatTab(3,"off");
	}else if(strTab=="ops"){
		formatTab(1,"off");
		formatTab(2,"on");
		formatTab(3,"off");
	}else if(strTab=="store"){
		formatTab(1,"off");
		formatTab(2,"off");
		formatTab(3,"on");
	}
}
function formatTab(tabNum, onoff){
	document.getElementById("tab"+tabNum+"_1").className="tab1_"+onoff;
	document.getElementById("tab"+tabNum+"_2").className="tab1_"+onoff;
	document.getElementById("tab"+tabNum+"_3").className="tab1_"+onoff;
	document.getElementById("tab"+tabNum+"_4").className="tab1_shadow_"+onoff;
	document.getElementById("tab"+tabNum+"_5").className="tab1_shadow_"+onoff;
	document.getElementById("tab"+tabNum+"_6").className="tab1_shadow_"+onoff;

}
var aCommentsTop = new Array(
'',  // not used
'Reports in Mirus Intelligence are very flexible and informative.  Here we see key performance indicators'+
' for all stores in the Charlotte DMA.  The measures are color-coded based on pre-determined thresholds. '+
' We are also comparing this week so far to the same period one week and one year ago.',
'If you are not sure what the cut-offs are for red/yellow/green lights, hold your mouse over the meaure '+
'name and a pop-up box will show you the thresholds.',
'Calculations are performed on the fly in Mirus Intelligence, but if you ever want to know the source '+
'numbers and/or the formula, just hover your mouse over one of the values.  A pop-up box will appear and '+
'show you the formula and the base values.',
'You can save screen \"real estate\" by showing store numbers and having Mirus Intelligence show you the '+
'store name by hovering your mouse over the number.'
)
var aCommentsBottom = new Array(
'',  // not used
'',
'',
'This is useful, for example, when you have a labor percentage that is too high, and you do not '+
'know if it is too much labor or too few sales causing the percentage to be off.',
''
)
function initDemo() {
	document.getElementById("demoSlideImg").src="/common/images/demo50/demo_01.gif";
	document.getElementById("demoCommentTop").innerHTML=aCommentsTop[1]
	document.getElementById("demoCommentBottom").innerHTML=aCommentsBottom[1]
}
function demoGoPrev(){
	if(demoSlide-- <= 1){
		demoSlide=1;
	}
	strSlide=demoSlide;
	if(strSlide<10){
		strSlide="0"+strSlide;
	}
	document.getElementById("demoSlideImg").src="/common/images/demo50/demo_"+strSlide+".gif";
	document.getElementById("demoCommentTop").innerHTML=aCommentsTop[demoSlide]
	document.getElementById("demoCommentBottom").innerHTML=aCommentsBottom[demoSlide]
	setNumOfMax();
}
function demoGoNext(){
	if(demoSlide++ >= maxSlide){
		demoSlide=maxSlide;
	}
	strSlide=demoSlide;
	if(strSlide<10){
		strSlide="0"+strSlide;
	}
	document.getElementById("demoSlideImg").src="/common/images/demo50/demo_"+strSlide+".gif";
	document.getElementById("demoCommentTop").innerHTML=aCommentsTop[demoSlide]
	document.getElementById("demoCommentBottom").innerHTML=aCommentsBottom[demoSlide]
	setNumOfMax();
}
function setMaxSlide(){
	if(demoTab==1){
		maxSlide=maxBiz;
	}else{
		maxSlide=maxTech;
	}		
}
function setNumOfMax(){
	document.getElementById("demoSlideNumOfMax").firstChild.nodeValue=demoSlide+" of "+maxSlide;
}
function showLayer(layerNum){
	var objLayer;
	for(var i=1;i<7;i++) {
		objLayer=document.getElementById("Layer"+i);
		if(i==layerNum){
			objLayer.style.visibility="visible";
		}else{
			objLayer.style.visibility="hidden";
		}
	}
	var objImg=document.getElementById("circleImg");
	switch(layerNum) {
		case 0:
			objImg.src="/common/images/circle_about.gif";
			break;
		case 1:
			objImg.src="/common/images/circle_about.gif";
			break;
		case 2:
			objImg.src="/common/images/circle_products.gif";
			break;
		case 3:
			objImg.src="/common/images/circle_services.gif";
			break;
		case 4:
			objImg.src="/common/images/circle_news.gif";
			break;
		case 5:
			objImg.src="/common/images/circle_about.gif";
			break;
		case 6:
			objImg.src="/common/images/circle_tb.gif";
			break;
	}
}