// Used for sessions types that are not available
function NoSessionGroup(){
	alert("This feature is not available for this Session.") 
}

function ClearBox(myBox){
myBox.value = ""

}

function ResetBox(myBox){
	if(myBox.value ==""){
		myBox.value="Search"
	}
	
}

function NotAvail(){
	alert("This feature is not yet available.") 
}

//Used to keep user from selecting tabs wo a visits
function CH_Tab(){
alert("Please Create or Select a Visit.")
}
//Used to keep user from selecting tabs wo lodging data
function CH_TabLodge(){
alert("If you wish to enter Lodging information for this group, select Lodging as a part of this visit.")
}

//Used to keep user from selecting tabs wo prog data
function CH_TabProg(){
alert("If you wish to enter Program information for this group, select Programs as a part of this visit.")
}

//Used to keep user from selecting tabs wo MR data
function CH_TabMR(){
alert("If you wish to enter Meeting Area information for this group, select Meeting Areas as a part of this visit.")
}

//Used to keep user from selecting tabs wo Meal data
function CH_TabMeal(){
alert("If you wish to enter Meal information for this group, select Meals as a part of this visit.")
}

//Used if visit has been cancelled
function CH_TabCancelled(){
alert("This visit has been cancelled.  You may view summary information on the FINANCIAL tab.")
}

//Creates a remote window
function PWWin(URL){
	remote17=window.open("","WinName133","width=450,height=175,scrollbars=0,menubar=0,addressbar=0,status=0,resize=0,top=200,left=200");
	remote17.location.href=URL;
	if(remote17.opener==null) remote17.opener=window;
	remote17.opener.name="nav";
}


//Creates a remote window
function QueryWin(URL){
	remoteQ=window.open("","WinNameQuery","width=600,height=500,scrollbars=0,menubar=0,addressbar=0,status=0,resize=0,top=300,left=500");
	remoteQ.location.href=URL;
	if(remoteQ.opener==null) remoteQ.opener=window;
	remoteQ.opener.name="nav";
}

//Creates a remote window
function QueryWin2(URL){
	remoteQ2=window.open("","WinNameQuery2","width=600,height=500,scrollbars=0,menubar=0,addressbar=0,status=0,resize=0,top=300,left=500");
	remoteQ2.location.href=URL;
	if(remoteQ2.opener==null) remoteQ2.opener=window;
	remoteQ2.opener.name="content";
}


//Creates a remote window
function NewWin(URL){
	remote1=window.open("","remotewin1","width=500,height=225,scrollbars=1,menubar=0,addressbar=0,status=1,top=0,left=0");
	remote1.location.href=URL;
	if(remote1.opener==null) remote1.opener=window;
	remote1.opener.name="content";
}



//Creates a remote window
function NewMemWindow(URL){
	remote100=window.open("","remotewin100","width=475,height=160,scrollbars=1,menubar=0,addressbar=0,status=1,top=50,left=100");
	remote100.location.href=URL;
	if(remote100.opener==null) remote100.opener=window;
	remote100.opener.name="contentTop";
}

//Creates a remote window
function HelpWin(URL){
	remote2=window.open("","remotewin2","width=450,height=400,scrollbars=1,menubar=0,addressbar=0,status=1,top=0,left=0");
	remote2.location.href=URL;
	if(remote2.opener==null) remote2.opener=window;
	remote2.opener.name="nav";
}

//Creates a remote window
function NewWin2(URL){
	remote3=window.open("","WinName22","width=400,height=130,scrollbars=0,menubar=0,addressbar=0,status=0,resize=0,top=200,left=200");
	remote3.location.href=URL;
	if(remote3.opener==null) remote3.opener=window;
	remote3.opener.name="content";
}

//Creates a remote window
function CreateRepWin(URL){
	remote28=window.open("","CreateRep","width=400,height=200,scrollbars=0,menubar=0,addressbar=0,status=0,resize=0,top=200,left=200");
	remote28.location.href=URL;
	if(remote28.opener==null) remote28.opener=window;
	remote28.opener.name="content";
}

//Creates a remote window
function NewWin2B(URL){
	remote7=window.open("","WinName33","width=400,height=130,scrollbars=0,menubar=0,addressbar=0,status=0,resize=0,top=200,left=200");
	remote7.location.href=URL;
	if(remote7.opener==null) remote7.opener=window;
	remote7.opener.name="nav";
}

function CalWin(URL){
	remote6=window.open("","WinName26","width=600,height=450,scrollbars=1,menubar=1,addressbar=0,status=0,resizable=yes,top=5,left=5");
	remote6.location.href=URL;
	if(remote6.opener==null) remote6.opener=window;
	remote6.opener.name="contentTop";
}

function CalWin2(URL){
	remote6=window.open("","WinName26","width=600,height=450,scrollbars=1,menubar=1,addressbar=0,status=0,resizable=yes,top=5,left=5");
	remote6.location.href=URL;
	if(remote6.opener==null) remote6.opener=window;
	remote6.opener.name="content";
}

function CalWin3(URL){
	remote16=window.open("","WinName29","width=600,height=450,scrollbars=1,menubar=1,addressbar=0,status=0,resizable=yes,top=5,left=5");
	remote16.location.href=URL;
	if(remote16.opener==null) remote16.opener=window;
	remote16.opener.name="MRCalFrame";
}

function RepWin(URL){
	remote12=window.open("","RepWin","width=600,height=450,scrollbars=1,menubar=1,addressbar=0,status=0,resizable=yes,top=5,left=5");
	remote12.location.href=URL;
	if(remote12.opener==null) remote12.opener=window;
	remote12.opener.name="nav";
}

function RepWin2(URL){
	remote12=window.open("","RepWin","width=600,height=450,scrollbars=1,menubar=1,addressbar=0,status=0,resizable=yes,top=5,left=5");
	remote12.location.href=URL;
	if(remote12.opener==null) remote12.opener=window;
	remote12.opener.name="content";
}

function RepWin3(URL){
	remote125=window.open("","RepWin","width=600,height=450,scrollbars=1,menubar=1,addressbar=0,status=0,resizable=yes,top=5,left=5");
	remote125.location.href=URL;
	if(remote125.opener==null) remote125.opener=window;
	remote125.opener.name="contentTop";
}

function POWin(URL){
	remote45=window.open("","POWin","width=600,height=450,scrollbars=1,menubar=1,addressbar=0,status=0,resizable=yes,top=5,left=5");
	remote45.location.href=URL;
	if(remote45.opener==null) remote45.opener=window;
	remote45.opener.name="contentTop";
}

//Creates the EDIT contract window

function confirmOpenWin(Msg2,URL){
        if(confirm(Msg2 + '?')){

	remote4=window.open("","WinName23","width=600,height=450,scrollbars=1,menubar=1,addressbar=0,status=0,resizable=yes,top=5,left=5");
	remote4.location.href=URL;
	if(remote4.opener==null) remote4.opener=window;
	remote4.opener.name="content";
	}
	//else {
	//return(false)
	//}
}

//Creates the VIEW Contract Window
function ContractWin(Msg3,URL){
	if(confirm(Msg3 + '?')){
remote5=window.open("","WinName24","width=600,height=450,scrollbars=1,menubar=1,addressbar=0,status=0,resizable=yes,top=5,left=5");
	remote5.location.href=URL;
	if(remote5.opener==null) remote5.opener=window;
	remote5.opener.name="content";
		}
	}
	
	
//Creates the VIEW Contract Window
function DirWin(URL){
remote7=window.open("","WinName27","width=600,height=450,scrollbars=1,menubar=1,addressbar=0,status=0,resizable=yes,top=5,left=5");
	remote7.location.href=URL;
	if(remote7.opener==null) remote7.opener=window;
	remote7.opener.name="contentTop";
	}

//This function changes the color of the table cell
function CellOver(src,colorOver) {
if(document.all){ 
if (!src.contains(event.fromElement)) { 
src.style.cursor = 'hand'; src.bgColor = colorOver;
		}
	}


}

function CellOver22(src,colorOver) {
if(document.all){ 
if (!src.contains(document.getElementById(src))) { 
src.style.cursor = 'hand'; src.bgColor = colorOver;
		}
	}


}


//This function changes the color of the table cell back
//to its default color
function CellOut(src,colorOut) {
if(document.all){ 
if (!src.contains(event.toElement)){
 src.style.cursor = 'default'; src.bgColor = colorOut; 
		}
	
	}
}


function CellOverRES(src,colorOver) {
if(document.all){ 
if (!src.contains(event.fromElement)) { 
src.style.cursor = 'hand'; src.bgColor = colorOver;
		}
	}
}

function CellOutRES(src,colorOut) {
if(document.all){ 
if (!src.contains(event.toElement)){
 src.style.cursor = 'default'; src.bgColor = colorOut; 
		}
	}
}

//Expanding menu
function Expand(xBtn, sub){
	var myButton = document.all.item(xBtn)
	var myObj = document.all.item(sub)
	if (myObj.style.display == "none"){
		myObj.style.display = ""
		myObj.style.cursor = "hand"
		myButton.src = "images/down.gif"
		myButton.style.cursor = "hand"
	}
	else{
		myObj.style.display = "none"
		myObj.style.cursor = "hand"
		myButton.src = "images/right.gif"
		myButton.style.cursor = "hand"
	}
}

//Expanding menu
function ExpandB(xBtnB, subB){
	var myButtonB = document.all.item(xBtnB)
	var myObjB = document.all.item(subB)
	if (myObjB.style.display == "none"){
		myObjB.style.display = ""
		myObjB.style.cursor = "hand"
		myButtonB.src = "images/down.gif"
		myButtonB.style.cursor = "hand"
	}
	else{
		myObjB.style.display = "none"
		myObjB.style.cursor = "hand"
		myButtonB.src = "images/right.gif"
		myButtonB.style.cursor = "hand"
	}
}

//Expanding grid
function ExpandGrid(sub){
	
	var myObj = document.all.item(sub)
	if (myObj.style.display == "none"){
		myObj.style.display = ""
		myObj.style.cursor = "hand"
	}
}




//Expanding Amenities ection
function ExpandAm(sub){
	var myObj = document.all.item(sub)
	if (myObj.style.display == "none"){
		myObj.style.display = ""
		myObj.style.cursor = "hand"
	}
	else{
		myObj.style.display = "none"
		myObj.style.cursor = "hand"
	}
}
var SyncBttn= document.all.SyncX

//Returns to prev frame
function RSync(){
var SyncBttn= document.all.SyncX
SyncBttn.src = "images/syncIconSm.jpg";
parent.nav.history.go(-1)
}


//Message and returns false
function NoDelete(Msg)
	{
	alert(Msg);
	return(false); 
	}

//Alerts user of a deletion
function confirmDel(Msg){
        if(confirm(Msg + '?'))
		return(true)
			else 
		return(false) 
			
}

//Syncs Frames
function Sync(){
var SyncBttn= document.all.SyncX
SyncBttn.src = "images/Unsynciconsm.jpg";
parent.nav.location="defaultNav.asp"
}

var strNav = "parent.location.href"
var imgString = "images/syncIconSm.jpg"

//Sync toggle
function Toggle(){
var SyncBttn= document.all.SyncX
var strNav = "parent.location.href"
	 if(strNav != "default.asp"){
		Sync();
	 }else if(strNav = "default.asp"){
		RSync();
	}
}

//Used to seclect text in text boxes etc onFocus
function Select(n){
n.select()
}

function linkRaise(mLink, mBGcolor,Light,Dark){
	mLink.bgColor = mBGcolor
	mLink.style.color = Light
	
mLink.style.cursor = "hand"
}

function tdmouseover(el, BgColor) {
	el.style.backgroundColor = BgColor
	
	
}
function tdmouseout(el, BgColor) {
	el.style.backgroundColor = BgColor
}

function linkTextColorChange(el, NewClass)
{
    document.getElementById(el).className=NewClass;

}


function linkLower(mLink,BorderOut){
mLink.bgColor = BorderOut
//sets color of border
	mLink.style.borderBottomColor = BorderOut
	mLink.style.borderLeftColor = BorderOut
	mLink.style.borderTopColor = BorderOut
	mLink.style.borderRightColor = BorderOut
//sets style of border
	mLink.style.borderBottomStyle = "none"
	mLink.style.borderLeftStyle = "none"
	mLink.style.borderTopStyle = "none"
	mLink.style.borderRightStyle = "groove"
//sets thickness of border
	mLink.style.borderBottomWidth = "0px"
	mLink.style.borderLeftWidth = "0px"
	mLink.style.borderTopWidth = "0px"
	mLink.style.borderRightWidth = "0px"
}

function linkClick(mLink, mBGcolor,Light,Dark){
	mLink.bgColor = mBGcolor
//sets color of border
	mLink.style.borderBottomColor = Light
	mLink.style.borderLeftColor = Dark
	mLink.style.borderTopColor = Dark
	mLink.style.borderRightColor = Light
//sets style of border
	mLink.style.borderBottomStyle = "solid"
	mLink.style.borderLeftStyle = "solid"
	mLink.style.borderTopStyle = "solid"
	mLink.style.borderRightStyle = "solid"
//sets thickness of border
	mLink.style.borderBottomWidth = "2px"
	mLink.style.borderLeftWidth = "1px"
	mLink.style.borderTopWidth = "1px"
	mLink.style.borderRightWidth = "1px"

	
}


//This function makes the navigational menus visible
function show(mylink) {
//if(document.all){
	mylink.style.visibility = "visible"
	mylink.style.cursor = "hand";
	}
//}

//This function makes the navigational menus visible
function showSub(mylink) {
//if(document.all){
	mylink.style.visibility = "visible"
	mylink.style.cursor = "hand";
	}
//}

//This function hides the navigational menus
function hide(mylink) {
//if(document.all){
	mylink.style.visibility = "hidden"
	mylink.style.cursor = "default";
	//setTimeout(hide(mylink), 1000);
		}
//}

//for Date Script
var day=""; 
var month=""; 
var myweekday=""; 
var year=""; 
mydate = new Date(); 
myday = mydate.getDay(); 
mymonth = mydate.getMonth(); 
myweekday= mydate.getDate(); 
weekday= myweekday; 
myyear= mydate.getYear(); 
year = myyear; 
if(myday == 0)day = "Sunday," 
else if(myday == 1) day = "Monday," 
else if(myday == 2) day = "Tuesday," 
else if(myday == 3) day = "Wednesday, " 
else if(myday == 4) day = " Thursday, " 
else if(myday == 5) day = " Friday, " 
else if(myday == 6) day = " Saturday, " 
if(mymonth == 0) { month = "January "} 
else if(mymonth ==1) month = "February " 
else if(mymonth ==2) month = "March " 
else if(mymonth ==3) month = "April " 
else if(mymonth ==4) month = "May " 
else if(mymonth ==5) month = "June " 
else if(mymonth ==6) month = "July " 
else if(mymonth ==7) month = "August " 
else if(mymonth ==8) month = "September " 
else if(mymonth ==9) month = "October " 
else if(mymonth ==10) month = "November " 
else if(mymonth ==11) month = "December " 


//Code for Camper Info Sub set of Tabs
function fnTabClick( nTab )
	{
		nTab = parseInt(nTab);
		var oTab;
		var prevTab = nTab-1;
		var nextTab = nTab+1;
		event.cancelBubble = true;
		el = event.srcElement;

		for (var i = 0; i < newsContent.length; i++)
		{
			oTab = tabs[i];
			oTab.className = "clsTab";
			oTab.style.borderLeftStyle = "";
			oTab.style.borderRightStyle = "";
			newsContent[i].style.display = "none";
		}
		newsContent[nTab].style.display = "block";
		tabs[nTab].className = "clsTabSelected";
		oTab = tabs[nextTab];
		if (oTab) oTab.style.borderLeftStyle = "none";
		oTab = tabs[prevTab];
		if (oTab) oTab.style.borderRightStyle = "none";
		event.returnValue = false;
	}
	
	function fnSaveState() {
		var iTabSelected = 0;
		var iLength = tabs.length;
		for (var i = 0; i < iLength; i++) {
			if (tabs[i].className == "clsTabSelected") iTabSelected = i;
		}
		idTabs.setAttribute("tabstate", iTabSelected);
	}
	
	function fnGetState() {
		var iTabSelected = idTabs.getAttribute("tabstate");
		var iLength = tabs.length;
		for (var i = 0; i < iLength; i++) {
			if ( i != iTabSelected) {
				tabs[i].className = "clsTab";
				if (newsContent[i]) newsContent[i].style.display = "none";
			} else {
				tabs[i].className = "clsTabSelected";
				if (newsContent[i]) newsContent[i].style.display = "block";			
			}
		}	
	}
	
	
	//Code for Camper Visits Sub set of Tabs
function fnTabClickV( nTabV )
	{
		nTabV = parseInt(nTabV);
		var oTabV;
		var prevTabV = nTabV-1;
		var nextTabV = nTabV+1;
		event.cancelBubble = true;
		elV = event.srcElement;

		for (var i = 0; i < newsContentV.length; i++)
		{
			oTabV = tabsV[i];
			oTabV.className = "clsTab";
			oTabV.style.borderLeftStyle = "";
			oTabV.style.borderRightStyle = "";
			newsContentV[i].style.display = "none";
		}
		newsContentV[nTabV].style.display = "block";
		tabsV[nTabV].className = "clsTabSelected";
		oTabV = tabsV[nextTabV];
		if (oTabV) oTabV.style.borderLeftStyle = "none";
		oTabV = tabsV[prevTabV];
		if (oTabV) oTabV.style.borderRightStyle = "none";
		event.returnValue = false;
	}
	
	function fnSaveStateV() {
		var iTabSelectedV = 0;
		var iLengthV = tabsV.length;
		for (var i = 0; i < iLengthV; i++) {
			if (tabsV[i].className == "clsTabSelected") iTabSelectedV = i;
		}
		idTabsV.setAttribute("tabstate", iTabSelectedV);
	}
	
	function fnGetState() {
		var iTabSelectedV = idTabsV.getAttribute("tabstate");
		var iLengthV = tabsV.length;
		for (var i = 0; i < iLengthV; i++) {
			if ( i != iTabSelectedV) {
				tabsV[i].className = "clsTab";
				if (newsContentV[i]) newsContentV[i].style.display = "none";
			} else {
				tabsV[i].className = "clsTabSelected";
				if (newsContentV[i]) newsContentV[i].style.display = "block";			
			}
		}	
	}
	
	
	//Code for Top set of Tabs
function fnTabClickT( nTabT )
	{
		nTabT = parseInt(nTabT);
		var oTabT;
		var prevTabT = nTabT-1;
		var nextTabT = nTabT+1;
		event.cancelBubble = true;
		elT = event.srcElement;

		for (var i = 0; i < pageContent.length; i++)
		{
			oTabT = tabsT[i];
			oTabT.className = "clsTabT";
			oTabT.style.borderLeftStyle = "";
			oTabT.style.borderRightStyle = "";
			pageContent[i].style.display = "none";
		}
		pageContent[nTabT].style.display = "block";
		tabsT[nTabT].className = "clsTabSelectedT";
		oTabT = tabsT[nextTabT];
		if (oTabT) oTabT.style.borderLeftStyle = "none";
		oTabT = tabsT[prevTabT];
		if (oTabT) oTabT.style.borderRightStyle = "none";
		event.returnValue = false;
	}
	
	function fnSaveStateT() {
		var iTabSelectedT = 0;
		var iLengthT = tabsT.length;
		for (var i = 0; i < iLengthT; i++) {
			if (tabsT[i].className == "clsTabSelectedT") iTabSelectedT = i;
		}
		idTabsT.setAttribute("tabstateT", iTabSelectedT);
	}
	
	function fnGetStateT() {
		var iTabSelectedT = idTabsT.getAttribute("tabstateT");
		var iLengthT = tabsT.length;
		for (var i = 0; i < iLengthT; i++) {
			if ( i != iTabSelectedT) {
				tabsT[i].className = "clsTabT";
				if (pageContent[i]) pageContent[i].style.display = "none";
			} else {
				tabsT[i].className = "clsTabSelectedT";
				if (pageContent[i]) pageContent[i].style.display = "block";			
			}
		}	
	}
	
function SecurityAlert()
	{
	alert("You do not have a high enough Security Level to access this item.  Please contact your Resolution Administrator if you need to access this feature.")
	}	


function DisableButton(FormName, ButtonName)
{

	i = -1;
	do
		{
		i = i + 1;
		if (i > 30)
			break;
		}
	while(document.forms[i].name != FormName);

	setTimeout("DisableButton",20000)
	ButtonName.disabled = "true"
	document.forms[i].submit()
		
}





//
//
// Pass in the Form and the Element Name.
// Returns the Value of the Element.
//
function GetElementValue(TheForm, searchText)
{
var i;
var temp;
var value;

	
	// find the form object that matches the passed in text
	for(i=0; i<TheForm.length; i++)
		{
		if(TheForm.elements[i].name == searchText)
			{
			value = TheForm.elements[i].value;

			break;
			}
		}			
return value;	
}

