var wAtt;
			
			function checkForm()
			{		
				var AlertMsg_1 = "Please select at least one (1) site to continue.";
				var AlertMsg_2 = "Please select at most one (1) site to continue.";
				var count = 0;		
				
				// check the first radio button encountered
				for (var j = 0; j < document.Form1.length; j++)
				{         
					if (document.Form1[j].type == "checkbox" )
					{           
						if (document.Form1[j].checked)
						{
							count += 1;						
						}
					}
				}
				if (count == 0)
				{
					alert(AlertMsg_1);
					return false;
				}
				if (count > 2)
				{
					alert(AlertMsg_2);
					return false;
				}
			}
			
			function showAttributesWindow(sid, sname, sWindowType)
			{	
				var str = "";		
				var sname2 = escape(sname);
				
				if (sWindowType == "ATTR") // Attribute
				{
					str = "showAttributes.aspx?siteId=" + sid;
					str+= "&";
					str+="siteName="+sname2;
					wAtt = window.open(str,'attwindow','width=540,height=550,resizable=yes,scrollbars');
				}
				
				if (sWindowType == "LOOP") // Loops
				{
					str = "showLoop.aspx?loopId=" + sid;
					str+= "&";
					str+="loopName="+sname2;
					wAtt = window.open(str,'attwindow','width=540,height=550,resizable=yes,scrollbars');
				}
				
				if (sWindowType == "PARK") // Loops
				{
					str = "showParkDetail.aspx?pkId=" + sid;
					str+= "&";
					str+="pkName="+sname2;
					wAtt = window.open(str,'attwindow','width=580,height=550,resizable=yes,scrollbars');
				}
				
				if (sWindowType == "CAMP") // Loops
				{
					str = "showCampDetail.aspx?campId=" + sid;
					str+= "&";
					str+="pkName="+sname2;
					wAtt = window.open(str,'attwindow','width=580,height=550,resizable=yes,scrollbars');
				}
				
				//alert(str);
			}
			
			function closeAttributesWindow()
			{	try
				{
					wAtt.close();
				}
				catch (e) {}
			}
function ParkSelected()
{
	if (document.all.ListProp.selectedIndex == 0)
	{
		alert ("Please select a property type.");
		document.all.ListProp.focus();
		return false;
	}
}

function isCheckBoxSelected(arrElemIDs ,maxElemCounts, msg, maxSelectedAllowed)
{
	if (maxSelectedAllowed != null)
	{
		return isCheckBoxSelected1(arrElemIDs ,maxElemCounts, msg, maxSelectedAllowed)
	}	
	else
	{
		return isCheckBoxSelected2(arrElemIDs ,maxElemCounts, msg)
	}	
}

function isCheckBoxSelected1(arrElemIDs ,maxElemCounts,  msg, maxSelectedAllowed)
{
	var numRows = -1;
	var sArrelem = new String();
	var SelectedVal = -1;
	var AlertMsg = msg;
	var selectedCount = 0;
		
	var tempElemArr = arrElemIDs.split("|");
	var tempElemMaxCnt =12;// maxElemCounts.split("|");	
	var Elemslist = (tempElemArr.length) ;		
		
	for (var i = 0; i < Elemslist; i++)
	{
		var elemID = tempElemArr[i];		
		var numMaxCnt = 12;//parseInt ( tempElemMaxCnt [i] );
		
		for (var j=0; j < numMaxCnt; j++)
		{
			var objElem = eval ( "document.all." + elemID + "_" + j ) ;
			if (objElem.checked)
			{	
			   			
				SelectedVal = j;
				selectedCount = selectedCount + 1;
				if(objElem.id == "ParkChkList_5" )
			    {
			       alert("Warren Island State Park is a true island tenting adventure.\nThere are no bridges or roads to the island, and  no public\n transportation via boat.You must have your own boat or \narrange for transportation via private water taxi.\n NOTE: Warren Island is three miles offshore,and the route\n crosses commercial shipping lanes.\n For more information please call (207)941-4014.");
			    }
			    else if(objElem.id == "ParkChkList_10" )
			    {
			    alert("No pets are allowed in the Sebago Lake State Park campground.");
			    }
			}	
		}	
	}	
	if (SelectedVal == -1)
	{
		alert(AlertMsg);
		return false;
	}
	else
	{		
		if (maxSelectedAllowed >= selectedCount)
		{
			return true;
		}	
		else
		{
			alert("At most " + maxSelectedAllowed + " Parks can be selected.");
			return false;
		}
	}
}
function warren()
{
alert("Warren Island State Park is a true island tenting adventure.\nThere are no bridges or roads to the island, and  no public\n transportation via boat.You must have your own boat or \narrange for transportation via private water taxi.\n NOTE: Warren Island is three miles offshore,and the route\n crosses commercial shipping lanes.\n For more information please call(207)941-4014.");
}

function sebago()
{
alert("No pets are allowed in the Sebago Lake State Park campground.");
}

function isCheckBoxSelected2(arrElemIDs ,maxElemCounts, msg)
{
	var numRows = -1;
	var  sArrelem = new String();
	var SelectedVal = -1;
	var AlertMsg = msg;
		
	var tempElemArr = arrElemIDs.split("|");
	var tempElemMaxCnt = maxElemCounts.split("|");	
	var Elemslist = (tempElemArr.length) ;		
		
	for (var i = 0; i < Elemslist; i++)
	{
		var elemID = tempElemArr[i];		
		var numMaxCnt = parseInt ( tempElemMaxCnt [i] );
		
		for (var j=0; j < numMaxCnt; j++)
		{
			var objElem = eval ( "document.all." + elemID + "_" + j ) ;
			if(typeof( objElem ) != 'undefined')
			{
				if (objElem.checked)
				{			
					SelectedVal = j;
				}	
			}
		}	
	}	
	if (SelectedVal == -1)
	{
		alert(AlertMsg);
		return false;
	}
	else
	{
		return true;
	}	
}

function checkSearchCriteria(blnFlag)
{
	if ((typeof( blnFlag ) == 'undefined') || (blnFlag))
	{
		if(typeof(document.forms[0].btnPlsWait) != 'undefined')	
		{	
		    document.forms[0].btnPlsWait.style.display='block';
		}
		if(typeof(document.forms[0].btnSubmit) != 'undefined')		
		{
		    document.forms[0].btnSubmit.style.display='none';	
		}
		if(typeof(document.forms[0].btnNext) != 'undefined')		
		{
		    document.forms[0].btnNext.style.display='none';	
		}		
		return true;
	}
	else
	{
		if(typeof(document.forms[0].btnPlsWait) != 'undefined')		
		{
		    document.forms[0].btnPlsWait.style.display='none';
		}
		if(typeof(document.forms[0].btnSubmit) != 'undefined')		
		{
		    document.forms[0].btnSubmit.style.display='block';
		}
		if(typeof(document.forms[0].btnNext) != 'undefined')		
		{
		    document.forms[0].btnNext.style.display='block';	
		}		
		return false;	
	}
}
function flipAdd2Cart(blnFlag)
{
	
	var btnName, btnPlsWaitName;
	if (typeof( document.forms[0].btnAddSites ) != 'undefined' )
	{
		btnName = document.forms[0].btnAddSites ;
		btnPlsWaitName = document.forms[0].btnPlsWait;
	}
	else
	{
		btnName = document.forms[0].btnAddSiteStandard;
		btnPlsWaitName = document.forms[0].btnPlsWait2;
	}
	
	if ((typeof( blnFlag )=='undefined') || (blnFlag))
	{
		btnName.style.display = 'none';
		btnPlsWaitName.style.display = 'block';	
		return;
	}
	else
	{
		btnPlsWaitName.style.display = 'none';
		btnName.style.display = 'block';
		return false;	
	}

	
}
function flipWW(blnFlag)
{
	if ((typeof( blnFlag )=='undefined') || (blnFlag))
	{
		document.forms[0].btnPlsWait.style.display='block';
		document.forms[0].btnSubmit.style.display='none';	
		return;
	}
	else
	{
		document.forms[0].btnPlsWait.style.display='none';
		document.forms[0].btnSubmit.style.display='block';
		return false;	
	}
}
function isWWPassEmpty()
{
	var AlertMsg = "Please enter a valid rafting season pass number.";
	var countNotNull = 0;				
	// check the first radio button encountered
	for (var j = 0; j < document.forms[0].length; j++)
	{         		
		if (document.forms[0][j].type == "text" )
		{           
			var val = trim( document.forms[0][j].value );					
			if (val != "" )
			{
				countNotNull = countNotNull + 1;
			}			
		}		
	}	
	if (countNotNull > 0)
	{	
		return true;				
	}
	else
	{
		alert(AlertMsg);
		return false;	
	}
}
function trim ( s ) 
  {
    var theString = s;
    var NewString = theString.replace(/^\s+/, "");
    var NewestString = NewString.replace(/\s+$/, "");
	return NewestString;
  } 
  
 
function fnShowMeError()
	{
		try
		{
			if(document.getElementById("lblErrorMessage")!=null)
			{
				if (typeof( document.getElementById("lblErrorMessage") )!='undefined')
				{
					if (document.getElementById("lblErrorMessage").innerHTML!='')
					{
						alert(document.getElementById("lblErrorMessage").innerHTML);
					}
				}
			}
		}
		catch(e)
		{
			alert(e);
		}
	}

function fnHideSelectBox()
{
//try
//	{		
		var xArr = document.getElementsByTagName('select');		
		var iCounter = 0;
	//	alert(xArr.length);
		for(i=0;i<xArr.length;i++)
		{		
			var x = xArr[i];			
			//if (x!=null && x.name !=null &&  x.type=="select")
			//{			
				var selectName = new String();
				selectName = x.id;
				var iIndex = selectName.indexOf("ddlMultiplier",0);
				//alert(iIndex);
				if (iIndex > -1)
				{							    
				    if(x.options.length==1)
				    {					  
					    x.className = "myNone";				    
				    }
				    iCounter=iCounter+1;
				}
			//}
		}
//	}
//	catch(e)
//	{
//		alert(e);
//	}

}
function petpop(myThis)
{
	if(myThis.checked)
	{
	    alert("You have indicated that you will be bringing a pet with you on your camping trip.\nAlthough we welcome pets at most of our campgrounds,No pets are allowed at\n Sebago Lake State Park Campground or on any beaches during the camping season.\nAt all other areas pets are allowed, but campers are responsible for keeping their\npets on a leash not exceeding four feet at all times and cleaning up after them.\n Failure to comply could result in eviction.");
	}
}

function adapop(myThis)
{
	if(myThis.checked)
	{
	    alert("You have selected a campsite that is specifically designed to be accessible for  visitors with disabilities.\n You can expect that the campsite will have  easier access to toilet facilities, a specially designed picnic\n table and fire ring, and a firm level surface. The Bureau of Parks and Lands encourages visitors to\ncontact parks directly to discuss their individual needs and abilities with experienced staff.");
	}
}

function elecpop(myThis)
{
    if(myThis.checked)
    {
        alert("Electric and water hook ups are available only at select sites at Camden Hills and Sebago Lake State Park campgrounds. The fee for this service is an additional $10.00 per night.  There will be no reduction in fees if services are not utilized.");
    }
}

function parkpop(myThis)
{
	if(myThis.value==10476)
	{
	    alert("Warren Island State Park is a true island tenting adventure.\n There are no bridges or roads to the island, and  no public\n transportation via boat.You must have your own boat or \narrange for transportation via private water taxi.\n NOTE: Warren Island is three miles offshore,and the route\n crosses commercial shipping lanes.\n For more information,call(207)941-4014.");
	}
	else if(myThis.value==10465)
	{
	    alert("No pets are allowed in the Sebago Lake State Park campground.");
	}
}

