function showBg(id,count)
{
	if(id == 'Tab0' || id == 'Tab1' || id == 'Tab2' || id == 'Tab3')
	{
		if(NN6)
		{
			if(count == 1)
				{ var Bme = '#FFFFCC' }
			else if(count == 0)
				{ var Bme = 'lightgrey' }
			document.getElementById(id).style.backgroundColor=Bme
		}
		else if(MS4)
		{
			if(count == 1) { var Bme = '#FFFFCC' }
			else if(count == 0) { var Bme = 'lightgrey' }
			document.all[id].style.backgroundColor=Bme
		}
		else if(NN4)
		{
			if(count == 1) { var Bme = '#FFFFCC' }
			else if(count == 0) { var Bme = 'lightgrey' }
			document.layers[id].bgColor=Bme
		}
	}
	else
	{
		if(NN6)
		{
			if(count == 1)
				{ var Bme = '#c0c0c0'; var txcolor = 'navy'; }
			else if(count == 0)
				{ var Bme = 'navy'; var txcolor = '#FFF';}
			document.getElementById(id).style.backgroundColor=Bme
			//document.getElementById('advances').style.color=txcolor
			//advances.style.color=txcolor
		}
		else if(MS4)
		{
			if(count == 1) { var Bme = '#a9a9a9'; var txcolor = 'navy'; }
			else if(count == 0) { var Bme = 'navy'; var txcolor = '#FFF'; }
			document.all[id].style.backgroundColor=Bme
			//document.getElementById('advances').style.color=txcolor
			//advances.style.color=txcolor
		}
		else if(NN4)
		{
			if(count == 1) { var Bme = '#3366CC' }
			else if(count == 0) { var Bme = 'navy' }
			document.layers[id].bgColor=Bme
		}
	}
}
function showBgAll()
{
	var flTab = "Tab";
	var flbg = "bg";
	for(i=0; i<=3; i++)
	{
		flTab = "Tab" +i;
		flbg = "bg" +i;
		if(NN6)
		{
			document.getElementById(flTab).style.backgroundColor='lightgrey'
			document.getElementById(flbg).style.backgroundColor='white'
		}
		else if(MS4)
		{
			document.all[flTab].style.backgroundColor="lightgrey"
			document.all[flbg].style.backgroundColor="white"
		}
		else if(NN4)
		{
			document.layers[flTab].bgColor='lightgrey'
			document.layers[flbg].bgColor='white'
		}
	}
	for(i=4; i<=11; i++)
	{
		flTab = "Tab" +i;
		flbg = "bg" +i;
		if(NN6)
		{
			document.getElementById(flTab).style.backgroundColor='navy'
			document.getElementById(flbg).style.backgroundColor='white'
		}
		else if(MS4)
		{
			document.all[flTab].style.backgroundColor="navy"
			document.all[flbg].style.backgroundColor="white"
		}
		else if(NN4)
		{
			document.layers[flTab].bgColor='navy'
			document.layers[flbg].bgColor='white'
		}
	}

	var box = "Tab";
	var selbox = "selTab";
	var slBg = "bg";
	var slBut = "but";
	var selBg = "selbg";
	var subBg = "subbg";
	for(i=20; i<=27; i++)
	{
		box = "Tab" +i;
		selbox = "selTab" +i;
		slBg = "bg" +i;
		slBut = "but" +i;
		selBg = "selbg" +i;
		subBg = "subbg" +i;
		if(NN6)
		{
			document.getElementById(slBg).style.backgroundColor='#000'
			document.getElementById(slBut).style.backgroundColor='#eeeeee'
			document.getElementById(selBg).style.backgroundColor='#000'
			document.getElementById(subBg).style.backgroundColor='#eeeeee'
		}
		else if(MS4)
		{
			document.all[slBg].style.backgroundColor='#000000'
			document.all[slBut].style.backgroundColor='#eeeeee'
			document.all[selBg].style.backgroundColor='#000000'
			document.all[subBg].style.backgroundColor='#eeeeee'
		}
		else if(NN4)
		{
			document.layers[box].document.layers[slBg].bgColor='#000'
			document.layers[box].document.layers[slBut].bgColor='#eeeeee'
			document.layers[selbox].document.layers[selBg].bgColor='#000'
			document.layers[selbox].document.layers[subBg].bgColor='#eeeeee'
		}
	}
}
function showTabs(id,count)
{
	if(MS4)
	{
		if(count == 1) { var Cme = 'visible' }
		else if(count == 0) { var Cme = 'hidden' }
		document.all[id].style.visibility=Cme
	}
	else if(NN6)
	{
		if(count == 1) { var Cme = 'visible' }
		else if(count == 0) { var Cme = 'hidden' }
		document.getElementById(id).style.visibility=Cme
	}
	else if(NN4){
		if(count == 1) { var Cme = 'show' }
		else if(count == 0) { var Cme = 'hide' }
		document.layers[id].visibility=Cme
		}
}
function showSLtabs(num)
{
	num=parseInt(num);
	showTabs("Tab2" + num, 1);
	showTabs("selTab2" + num, 1);
	var prev=parseInt(num) - 1;
	for(i=prev; i>=0; i--)
	{
		showTabs("Tab2" + i, 0);
		showTabs("selTab2" + i, 0);
	}
	var next=parseInt(num) + 1;
	for(i=next; i<=7; i++)
	{
		showTabs("Tab2" + i, 0);
		showTabs("selTab2" + i, 0);
	}
}
function hideAll2()
{
	var TheTab = "Tab";
	var TheselTab = "selTab";
	for(i=20; i<=27; i++)
	{
		TheTab = "Tab"+i;
		TheselTab = "selTab"+i;
		if (NN6)
		{
		document.getElementById(TheTab).style.visibility = "hidden"
		document.getElementById(TheselTab).style.visibility = "hidden"
		}
		else if (NN4)
		{
		document.layers[TheTab].visibility = "hide";
		document.layers[TheselTab].visibility = "hide";
		}
		else
		{
		document.all[TheTab].style.visibility = "hidden"
		document.all[TheselTab].style.visibility = "hidden"
		}
	}
}

function isRefundOther()
{
	var answer =confirm("You have selected to complete a Refunds/Other form.\nPatient or Medical Insurance related refunds may not be filled out on this form.\n\nClick OK to continue with this Refunds/Other form \nor\nClick Cancel to return, and select the Refunds/Patient form.");
	if (answer==true)
	{
		// Output when OK is clicked
		//window.location.href = "<%=pq_jsp%>rf/rf_form_other.jsp";
		return true;
	}
	else
	{
		// Output when Cancel is clicked
		//window.location.href = "<%=pq_jsp%>rf/rf_form_patient.jsp";
		//window.close();
		return false;
	}
}

function isSMCashierOLD()
{
	var answer =confirm("You have selected to complete a reimbursement on the Supplies & Materials/Cash from Cashier form.\nEach of your receipts must be under $100 (including tax), per vendor, per day \nand \nyour reimbursement must include all original receipts.\n\nClick OK to continue with this Supplies & Materials/Cash form \nor \nClick Cancel to return, and select the Supplies & Materials/Check or EFT form.");
	if (answer==true)
	{
		// Output when OK is clicked
		//window.location.href = "<%=pq_jsp%>sm/sm_form_cash.jsp";
		return true;
	}
	else
	{
		// Output when Cancel is clicked
		//window.location.href = "<%=pq_jsp%>sm/sm_form_chkeft.jsp";
		//window.close();
		return false;
	}
}

function isSMCashier()
{
var msg = "The form Supplies & Materials/Cash from Cashier is no longer available.  Please click OK and select the Supplies & Materials/Check or EFT form.  Contact Accounts Payable for further assistance.";

alert (msg);
/***
	var answer =confirm("You have selected to complete a reimbursement on the Supplies & Materials/Cash from Cashier form.\nEach of your receipts must be under $100 (including tax), per vendor, per day \nand \nyour reimbursement must include all original receipts.\n\nClick OK to continue with this Supplies & Materials/Cash form \nor \nClick Cancel to return, and select the Supplies & Materials/Check or EFT form.");
	if (answer==true)
	{
		// Output when OK is clicked
		//window.location.href = "<%=pq_jsp%>sm/sm_form_cash.jsp";
		return true;
	}
	else
	{
		// Output when Cancel is clicked
		//window.location.href = "<%=pq_jsp%>sm/sm_form_chkeft.jsp";
		//window.close();
		return false;
	}
	***/

}

function isRegistration()
{
	var answer =confirm("You have selected the Registration form.\nIf there are going to be any travel expenses associated with this Registration, you\nmay NOT use this form.  Please contact Travel Accounting.\n\nClick OK to continue with this Registration form \nor\nClick Cancel to return to the previous screen");
	if (answer==true)
	{
		// Output when OK is clicked
		return true;
	}
	else
	{
		// Output when Cancel is clicked
		return false;
	}
}

function formNotAvailable()
{
	alert("This form is not yet available in PayQuest,\nplease continue to use the paper Form5 process until further notice.");
}

function formNotAvailableTR()
{
	alert("This form is not yet available in PayQuest,\n please continue to use the paper Travel Expense Voucher process until further notice.");
}




