// <![CDATA[
$().ready(function(){		

	$(".info_extra,.tr_info,.tr_info_perm").hide();

	$("a.cerrar_ayuda").click(
		function () {
			$(".infoContrato").hide();
			return false;			
		}			
	);
	
	$("input[name='tipoContrato']").click(
		function () {
			tipoContrato=$(this).attr("id");		
			tipo=tipoContrato.substring(13).split("_")[0];
			mostrarOpciones(tipo);
			obtenerPromos(tipoContrato);					
			obtenerPacks(tipoContrato);					
		}		
	);

	$("input[name='tipoADSL']").click(
		function () {
			
			$("#tabla_terminales_fijos,#contenedor_regalos,#contenedor_packs_especiales").html('');
			
			tipoContrato=$(this).attr("id");		
			tipo=tipoContrato.substring(9).split("_")[0];

			tipoH=encodeURIComponent($("#"+tipoContrato).attr("value"));
			mostrarTelefonosFijos(tipoH);

			if (tipo=="ADSLTP12" || tipo=="ADSLTP6"){
				tipo=encodeURIComponent($("#"+tipoContrato).attr("value"));					
			}else{
				tarifaMostrada=tipo;
				$('#tabla_terminales_fijos').html('');
			}
			obtenerPromos(tipoContrato);	
			obtenerPacks(tipoContrato);					
		}		
	);

	$(":radio[name=tipoADSL]:eq(0)").click();

	$("label.tipoContrato").click(
		function () {
			var tipoContrato=$(this).attr("for");
			$("#"+tipoContrato).click();
		}
	);

	$(".ayuda_bloque").click(	
		function () {
			var status=$("#" + $(this).attr("rel")).css('display');
			var capa=$(this).attr("rel");
			$(this).toggleClass("t_cerrar");			
//			$("#" + $(this).attr("rel")).toggle(); //<-- no funciona en IE8
			if (status == 'none') {					
			try
				{
				$("#" + capa).css({"display":"table-row"})
				}
			catch(err)
				{
				$("#" + capa).css({"display":"block"})
				}										
				
			}else{
				$("#" + capa).css({"display":"none"})
			}						
		}
	);

});
// ]]>
