function cambiarProvincias(){

var url="/provincias/provincias.php";
codPais=$F("paises");
var param="codPais=" + codPais;
var ajax;
ajax=new Ajax.Request(url,{parameters:param,method:"get",onComplete: mostrarProvincias.bind(this)})

}

function mostrarProvincias(Respuesta){
	$('capaProvincias').innerHTML = Respuesta.responseText;
}

function aceptar(){	
   if(!document.formulario.condiciones.checked){
        alert("Debe aceptar las condiciones legales para acceder a la suscripción");
        return false;
   }
   else{
   var seleccionado = "";
  	for(i=0;i<document.formulario.elements.length;i++){
		if(document.formulario.elements[i].type == "checkbox" ){
			if(document.formulario.elements[i].checked == 1){
				if(document.formulario.elements[i].value!='ofertas' && document.formulario.elements[i].value!='condiciones'){
					seleccionado=seleccionado + document.formulario.elements[i].value + ",";
				}
			}
		}
	}
	if(seleccionado!=""){
		document.getElementById("stringAltaSorteos").value=seleccionado;
		document.formulario.submit();
		return true;
	}
	else{
		alert("Debe seleccionar al menos un sorteo");
		return false;
	}
  }	
}
  


function crearStringSorteos(idSorteo){

if(document.getElementById(idSorteo).checked==true){

	var contenido=document.getElementById('stringSorteos').value;
	document.getElementById('stringSorteos').value=contenido + document.getElementById(idSorteo).value + ",";	

}

else{

	var contenido =document.getElementById('stringSorteos').value;
	contenido=contenido.replace(document.getElementById(idSorteo).value + "," , "");
	document.getElementById('stringSorteos').value=contenido;

	
}

}

function vaciarArea(idArea){

document.getElementById(idArea).value='';

}



