	function valida_questionario(){
		var elementos = document.getElementsByTagName("input");
		var radios=Array();
		var j=0;
		var k=0;
		var flag=false;
		for(i=0;i<elementos.length; i++){
			if (elementos[i].type == "radio"){
				radios[j]=elementos[i];
				j++;
			}
		}
		var encontrados=conta_grupo_radios(radios);
		for(i=0;i<encontrados.length;i++){
			flag=false;
			for(j=0;j<encontrados[i];j++){
				if(radios[k].checked==true)
					flag=true;
				k++;
			}
			if(!flag){
                alert ('Please Select Canada or USA before performing a search');             //include here any alert if wanted;
				return false
			}
		}
		return true;
	}

	function conta_grupo_radios(radios){
		var j=0;
		var k=1;
		var encontrados=Array();
		for(i=1;i<radios.length;i++){
			if(radios[i].name!=radios[i-1].name){
				encontrados[j]=k;
				j++;
				k=1;
			}
			else{
				k++;
			}
		}
		encontrados[j]=k;
		return encontrados;
	}


 ////////////////////Media info Javascript to check before selection//////////////////////////////////
  
	  //Change theme for hidden variable change
	   function chngeTheme(thme)
	   {
		   return  document.frmmedia.theme.value=thme;  
		  
	   }
	   
	 
	  //Change theme for hidden variable change
	   function chngeThemeBlog(thme)
	   {
		   return  document.frmblogeagle.theme.value=thme;  
		  
	   } 
	   
	   
	function category_checker()
	{
	// set var radio_choice to false
	var radio_choice = false;
	
	// Loop from zero to the one minus the number of radio button selections
	for (counter = 0; counter < frmmedia.category.length; counter++)
	{
		// If a radio button has been selected it will return true
		// (If not it will return false)
		if (frmmedia.category[counter].checked)
		radio_choice = true; 
		}
		
		if (!radio_choice)
		{
			// If there were no selections made display an alert box 
			alert("Please select Images or Video before performing a search")
			return false;
		}
		else
		{
			return true;
		}
	}
	
	
	function blog_options()
	{
	// set var radio_choice to false
	var radio_choice = false;
	
	// Loop from zero to the one minus the number of radio button selections
	for (counter = 0; counter < frmblogeagle.category.length; counter++)
	{
		// If a radio button has been selected it will return true
		// (If not it will return false)
		if (frmblogeagle.category[counter].checked)
		radio_choice = true; 
		}
		
		if (!radio_choice)
		{
			// If there were no selections made display an alert box 
			alert("Please select Blogs or Forums before performing a search")
			return false;
		}
		else
		{
			return true;
		}
	}
	
/////////////////////////////////////////////////////////////////////////////////////////////////	
