//Drop Down/ Overlapping Content: http://www.dynamicdrive.com
//**Updated: Dec 19th, 07': Added ability to dynamically populate a Drop Down content using an external file (Ajax feature)
//**Updated: Feb 29th, 08':
				//1) Added ability to reveal drop down content via "click" of anchor link (instead of default "mouseover")
				//2) Added ability to disable drop down content from auto hiding when mouse rolls out of it
				//3) Added hidediv(id) public function to directly hide drop down div dynamically

//**Updated: Sept 11th, 08': Fixed bug whereby drop down content isn't revealed onClick of anchor in Safari/ Google Chrome

// JavaScript Document Dropdown Menu
function Checkbox(checkgroup, limit) {
	var checkgroup=checkgroup
	var limit=limit
	for (var i=0; i<checkgroup.length; i++){
		var checkedcount=0
		for (var i=0; i<checkgroup.length; i++)
		document.getElementById('ListActivity').value = String("You have selected ") + parseInt(checkedcount+=(checkgroup[i].checked)? 1 : 0) + String(" activities");
						
		if (checkedcount==0){
		document.getElementById('ListActivity').value = "Select your activity";
		this.checked=false
		}
		
		if (checkedcount==1){
		document.getElementById('ListActivity').value = "You have selected 1 activity";
		}
	
	}
}

// JavaScript Document Dropdown Menu
function CheckboxActivity(checkgroup, limit) {
	var checkgroup=checkgroup
	var limit=limit
	for (var i=0; i<checkgroup.length; i++){
		checkgroup[i].onclick=function()
		{
		var checkedcount=0
		for (var i=0; i<checkgroup.length; i++)
		document.getElementById('ListActivity').value = String("You have selected ") + parseInt(checkedcount+=(checkgroup[i].checked)? 1 : 0) + String(" activities");
						
		if (checkedcount==0){
		document.getElementById('ListActivity').value = "Select your activity";
		this.checked=false
		}
		
		if (checkedcount==1){
		document.getElementById('ListActivity').value = "You have selected 1 activity";
		}
		}
	}
}


// JavaScript Document Dropdown Menu Genre
function CheckboxGenre(checkgroup, limit) {
	var checkgroup=checkgroup
	var limit=limit
	for (var i=0; i<checkgroup.length; i++){
		checkgroup[i].onclick=function()
		{
		var checkedcount=0
		for (var i=0; i<checkgroup.length; i++)
		document.getElementById('ListGenre').value = String("You have selected ") + parseInt(checkedcount+=(checkgroup[i].checked)? 1 : 0) + String(" genre");
		
		
				
		if (checkedcount==0){
		document.getElementById('ListGenre').value = "Select your genre";
		this.checked=false
		}			
	
		}
	}
}

// JavaScript Document Dropdown Menu Country
function CheckboxCountry(checkgroup, limit) {
	var checkgroup=checkgroup
	var limit=limit
	for (var i=0; i<checkgroup.length; i++){
		checkgroup[i].onclick=function()
		{
		var checkedcount=0
		for (var i=0; i<checkgroup.length; i++)
		document.getElementById('ListCountry').value = String("You have selected ") + parseInt(checkedcount+=(checkgroup[i].checked)? 1 : 0) + String(" countries");
						
		if (checkedcount==0){
		document.getElementById('ListCountry').value = "Select your Continent/Country";
		this.checked=false
		}
		
		
		if (checkedcount>limit){
			document.getElementById('ListCountry').value = "You can select one Continent or Country";
			dropdowncontent.hidediv('DropdownCountry');
			this.checked=false
			}
			
		
		}
	}
}

// JavaScript Document Dropdown Menu Gnre
function CheckboxParticipant(checkgroup, limit) {
	var checkgroup=checkgroup
	var limit=limit
	for (var i=0; i<checkgroup.length; i++){
		checkgroup[i].onclick=function()
		{
		var checkedcount=0
		for (var i=0; i<checkgroup.length; i++)
		document.getElementById('ListParticipant').value = String("You have selected ") + parseInt(checkedcount+=(checkgroup[i].checked)? 1 : 0) + String(" participants");
		
		
				
				
		if (checkedcount==0){
		document.getElementById('ListParticipant').value = "Select your participant type";
		this.checked=false
		}
		
		if (checkedcount==1){
		document.getElementById('ListParticipant').value = "You have selected 1 participant type";
		}
	
		
		}
	}
}