function getURLParam(strParamName){
  var strReturn = "";
  var strHref = window.location.href;
  if ( strHref.indexOf("?") > -1 ){
    var strQueryString = strHref.substr(strHref.indexOf("?")).toLowerCase();
    var aQueryString = strQueryString.split("&");
    for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){
      if (
aQueryString[iParam].indexOf(strParamName.toLowerCase() + "=") > -1 ){
        var aParam = aQueryString[iParam].split("=");
        strReturn = aParam[1];
        break;
      }
    }
  }
  return unescape(strReturn);
}


window.onload = function() {
	if(document.forms['f']['y'].selectedIndex==0){
		document.forms['f']['m'].disabled=true;
	}
	document.forms['f']['y'].onchange = function() {

		//Cuando cambia el componente "y"
        var ano_seleccionado = this.options[this.selectedIndex].value
		var dp_id = getURLParam('dp_id');
		if(ano_seleccionado != "-"){
			calendario_combo_mes(dp_id,ano_seleccionado);
//			var url = "http://"+document.location.host+"/includes/pet_ajax.php?id="+dp_id+"&y="+ano_seleccionado+"&l="+idioma;
//				var lista_meses = makeRequest(url);

//				document.getElementById("m").innerHTML = lista_meses;
//				document.forms['f']['m'].disabled=false;


	//			var ano = getURLParam('y');
		//		window.location = "catalogo_archivo.php?dp_id="+dp_id+"&y="+topcion;
		}else{
			document.forms['f']['m'].disabled=true;
		}
	}
}

/*
// Version Recarga Completa (Sin Ajax)

window.onload = function() {
	if(document.forms['f']['y'].selectedIndex==0){
		document.forms['f']['m'].disabled=true;
	}
	document.forms['f']['y'].onchange = function() {
		var topcion = this.options[this.selectedIndex].text;
		if(topcion!="Aņo" && topcion!="Urtea"){
			document.forms['f']['m'].disabled=false;
			var dp_id = getURLParam('dp_id');
			var ano = getURLParam('y');
			window.location = "catalogo_archivo.php?dp_id="+dp_id+"&y="+topcion;
		}else{
			document.forms['f']['m'].disabled=true;
		}
	}
}
*/
