
function CheckCheckBox(frm,formfield) {
	
	var pavilionIndex	= 0;
	var countryIndex 	= 0;
	var continentIndex 	= 0;
		
		
	
		
	if ("undefined" != typeof(frm.vcPavilion))
		 pavilionIndex=frm.vcPavilion.selectedIndex;
		 
	if ("undefined" != typeof(frm.CountryID))
		countryIndex=frm.CountryID.selectedIndex;
	
	if ("undefined" != typeof(frm.ContinentID))
		continentIndex=frm.ContinentID.selectedIndex;

	if (formfield == 'pavilion') {
		if (pavilionIndex != 0) {
			if ("undefined" != typeof(frm.ContinentID))
				frm.ContinentID.disabled=true;				
			
			if ("undefined" != typeof(frm.CountryID))
				frm.CountryID.disabled=true;			
		} else {
			if ("undefined" != typeof(frm.ContinentID))
				frm.ContinentID.disabled=false;				
			
			if ("undefined" != typeof(frm.CountryID))
				frm.CountryID.disabled=false;	
		}
	} else if (formfield == 'country') {
		if (countryIndex != 0) {
			if ("undefined" != typeof(frm.vcPavilion))
				frm.vcPavilion.disabled=true;			
					
			if ("undefined" != typeof(frm.ContinentID))
				frm.ContinentID.disabled=true;			
		} else {
			if ("undefined" != typeof(frm.vcPavilion))
				frm.vcPavilion.disabled=false;				
			
			if ("undefined" != typeof(frm.ContinentID))
				frm.ContinentID.disabled=false;	
		}
	} else if (formfield == 'continent') {
		if (continentIndex != 0) {
			if ("undefined" != typeof(frm.vcPavilion))
				frm.vcPavilion.disabled=true;				
			
			if ("undefined" != typeof(frm.CountryID))
				frm.CountryID.disabled=true;			
		} else {
			if ("undefined" != typeof(frm.vcPavilion))
				frm.vcPavilion.disabled=false;				
			
			if ("undefined" != typeof(frm.CountryID))
				frm.CountryID.disabled=false;	
		}		
	}
	
	/*		
	if(frm.CountryID.options[countryIndex].value == 0  && frm.vcPavilion.options[pavilionIndex].value == 0 && frm.ContinentID.options[continentIndex].value != 0 )
	{	       		
		frm.ContinentID.disabled=false;
		frm.vcPavilion.disabled=true;		
		frm.CountryID.disabled=true;
	}
	
	if(frm.CountryID.options[countryIndex].value !=0  && frm.vcPavilion.options[pavilionIndex].value == 0 && frm.ContinentID.options[continentIndex].value == 0 )
	{	       		
		frm.ContinentID.disabled=true;
		frm.vcPavilion.disabled=true;		
		frm.CountryID.disabled=false;
	}

	if(frm.CountryID.options[countryIndex].value == 0  && frm.vcPavilion.options[pavilionIndex].value != 0 && frm.ContinentID.options[continentIndex].value == 0 )
	{	       		
		frm.ContinentID.disabled=true;
		frm.vcPavilion.disabled=false;		
		frm.CountryID.disabled=true;
	}
	*/					
}
			
		
// ensure the user can never select more than two select boxes : NRR
 function selectMenuIntegrityContinent(frm) {

 	if (("undefined" != typeof(frm.CountryID) && frm.CountryID.selectedIndex > 0) || ("undefined" != typeof(frm.vcPavilion) && frm.vcPavilion.selectedIndex > 0 )){
		// alert('you cannot select this menu when you have selected a Country or Pavilion!');
		frm.ContinentID.disabled=true;
		
		return false;	 		
	}
 
 }
		
		
// ensure the user can never select more than two select boxes : NRR
 function selectMenuIntegrityCountry(frm) {

//if("undefined" == typeof(document.frm.vcPavilion) { 
//	document.write("<input type='hidden' name='vcPavilion' value='0'>")
//	}
 


 	if (("undefined" != typeof(frm.ContinentID) && frm.ContinentID.selectedIndex > 0) || ("undefined" != typeof(frm.vcPavilion) && frm.vcPavilion.selectedIndex > 0 )) {
		// alert('you cannot select this menu when you have selected a Continent or Pavilion!');
		frm.CountryID.disabled=true;
		
		return false;	 		

	}
 
 }
		
		
// ensure the user can never select more than two select boxes : MM
 function selectMenuIntegrityPavilion(frm) {
  
  	if (("undefined" != typeof(frm.CountryID) && frm.CountryID.selectedIndex > 0) || ("undefined" != typeof(frm.ContinentID) && frm.ContinentID.selectedIndex > 0 )){
		// alert('you cannot select this menu when you have selected a Country or Continent!');
		frm.vcPavilion.disabled=true;
		
		return false;	 		
	}
 
 }

		
// this will ensure the form is always reset to default values, even when a form object has been disabled.		
function resetDefaultValues(what) {

	what.CountryID.disabled=false;
	what.ContinentID.disabled=false;
	what.vcPavilion.disabled=false;
	
    for (var i=0, j=what.elements.length; i<j; i++) {
        myName = what.elements[i].name;
        if (myName.indexOf('checkbox') > -1 || myName.indexOf('radio') > -1)
            what.elements[i].checked = what.elements[i].defaultChecked;
        if (myName.indexOf('hidden') > -1 || myName.indexOf('password') > -1 || myName.indexOf('text') > -1)
            what.elements[i].value = what.elements[i].defaultValue;
        if (myName.indexOf('select') > -1)
            for (var k=0, l=what.elements[i].options.length; k<l; k++)
                what.elements[i].options[k].selected = what.elements[i].options[k].defaultSelected;
    }
}
		
				

		
		
		/*if(frm.ContinentID.options[countinentIndex].value != ''){
					frm.CountryID.disabled=true;
			}
			else if (frm.ContinentID.options[countinentIndex].value == '')
			{
				frm.CountryID.disabled=false;
			}*/




