var message="";
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if 
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
document.oncontextmenu=new Function("return false")


var sImages = [
 '/images/mini_login_load.gif',
 '/script/loading2.gif',
 '/images/loader_pay_process.gif',
 '/images/html/bgHosting.png',
 '/images/calendar.png',
 '/images/html/index_box_01_r1_c1_r1_c1.png',
 '/images/html/index_box_01_r1_c1_r1_c7.png',
 '/images/html/index_box_01_r1_c1_r2_c1.png',
 '/images/html/index_box_01_r1_c1_r2_c5.png',
 '/images/html/index_box_01_r1_c1_r2_c6.png',
 '/images/html/index_box_01_r1_c1_r3_c1.png',
 '/images/html/index_box_01_r1_c1_r3_c3.png',
 '/images/html/index_box_01_r1_c1_r4_c2.png',
 '/images/html/index_box_01_r1_c1_r5_c2.png',
 '/images/html/index_box_01_r1_c1_r6_c2.png',
 '/images/html/index_box_01_r1_c1_r7_c2.png',
 '/images/html/index_box_01_r1_c1_r8_c2.png',
 '/images/html/index_box_01_r1_c1_r9_c1.png',
 '/images/html/InfoGN.png',
 '/images/html/SearchDomain_r1_c1.png',
 '/images/html/SearchDomain_r2_c1.png',
 '/images/html/SearchDomain_r2_c3.png',
 '/images/html/SearchDomain_r2_c4.png',
 '/images/html/SearchDomain_r3_c2.png',
 '/images/html/tit1_pl.png',
 '/images/html/tit2_pl.png',
 '/images/ClientsCP.png',
 'http://gr.alturaweb.com/altura/img_num/1.gif',
 'http://gr.alturaweb.com/altura/img_num/2.gif',
 'http://gr.alturaweb.com/altura/img_num/3.gif',
 'http://gr.alturaweb.com/altura/img_num/4.gif',
 'http://gr.alturaweb.com/altura/includeTax_.png',
 'http://gr.alturaweb.com/altura/main_bg.jpg',
 'http://gr.alturaweb.com/altura/SignLink.png'
];

for(mg=0; mg<sImages.length; mg++) {
 var _img = new Image(0,0);
 _img.src = sImages[mg];
}

function replaceText(text){ while(text.lastIndexOf("&") > 0){ text = text.replace('&', '[i-Stats]'); } return text; }
var web_referrer = replaceText(document.referrer);

istat = new Image(0,0);
istat.src = "./arkitech/include/web/stats/counter.php?sw="+screen.width+"&sc="+screen.colorDepth+"&referer="+web_referrer+"&page="+location.href;

// Fecha y Hora
var show5 = function (){
	var Digital=new Date();
	var hours=Digital.getHours();
	var minutes=Digital.getMinutes();
	var seconds=Digital.getSeconds();
	var day=Digital.getDay();
	var month=Digital.getMonth();
	var year=Digital.getYear();
	var daym=Digital.getDate();
	var dn="AM";
	
	if (hours>12){ dn=""; hours=hours-12 }
	if (hours==0) { hours=12; }
	if (minutes<=9) { minutes="0"+minutes; }
	if (seconds<=9) { seconds="0"+seconds; }
	if (year < 1000) { year+=1900; }
	if (daym<10) { daym="0"+daym; }
	
	var dayarray=new Array("Domingo","Lunes","Martes","Miercoles","Jueves","Viernes","S&aacute;bado");
	var montharray=new Array("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre");
	myclock=hours+":"+minutes+":"+seconds+" "+dn;
	//$('#theHour').html(dayarray[day] + " " + daym + " de " + montharray[month] + " de " + year +" - "+ myclock);
    $('#theHour').html(montharray[month] + " de " + year);
	setTimeout("show5()",1000);
}

// Domain Search
searchDomainData = function() {
  if($("#frmDomainSearch_id").val() == "sudominio.com") { 
   alert('Escriba el Nombre de Dominio'); $("#frmDomainSearch_id").get(0).focus(); return false;
  }
  if($("#frmDomainSearch_id").get(0).value.indexOf('.',0) == -1) { 
   alert('Escriba un Nombre de Dominio válido, no utlice espacios'); 
   $("#frmDomainSearch_id").get(0).select(); return false;
  }
  
  $("#maskContent").removeClass("txtNormalWhite");
  
  ssrDomain = $("#frmDomainSearch_id").get(0).value.split('.');
  nDomain = new Array('com','net','org');
  
  if(ssrDomain[1] == nDomain[0] || ssrDomain[1] == nDomain[1] || ssrDomain[1] == nDomain[2]) {
	$("#maskContent").css("display","none");
    $("#BtnImage").attr("src","http://gr.alturaweb.com/altura/progress.gif");
	$.post("/script/checkDomain.arkx","rsDomain="+$("#frmDomainSearch_id").val(),function(rp) {
       if(rp == '1') {
        $("#maskContent").addClass("txtNormalWhite").html('<span style="font-weight:normal; font-size:10px;">'+$("#frmDomainSearch_id").val()+'</span> <br /> <span style="color:#FFFF00;"><strong>LIBRE - DISPONIBLE</strong></span>').css("display","block");
        $("#BtnImage").attr("src","/images/html/SearchDomain_r2_c3.png");
       } else {
        $("#maskContent").addClass("txtNormalWhite").html('<span style="font-weight:normal; font-size:10px;">'+$("#frmDomainSearch_id").val()+'</span> <br /> <span style="color:#FFCC00;"><strong>NO DISPONIBLE</strong></span>').css("display","block");
        $("#BtnImage").attr("src","/images/html/SearchDomain_r2_c3.png");
       }
    });
  } else {
	alert('Escriba un Nombre de Dominio válido'); $("#frmDomainSearch_id").get(0).select(); return false;
  }
}

CleanDomain = function() {
 $('#maskContent').css("display","none");
}
// End Search Domain

// Paso de Envio al Servidor
SendDataServer = function() {

 // String para envio de datos
 frm = '';
 
  // Paso 1
  TypeProduct	= $("input[@name='Sp1_Service']:checked").val();
  _FrmDocNum	= $("input[@name='Sp1_DocNum']").val();
  _FrmName		= $("input[@name='Sp1_Name']").val();
  _FrmCompany	= $("input[@name='Sp1_Company']").val();
  _FrmPhone		= $("input[@name='Sp1_Phone']").val();
  _FrmAddress	= $("input[@name='Sp1_Address']").val();
  _FrmCity		= $("input[@name='Sp1_City']").val();
  _FrmEmail1	= $("input[@name='Sp1_Email1']").val();
  _FrmEmail2	= $("input[@name='Sp1_Email2']").val();
  _FrmEmail3	= $("input[@name='Sp1_Email3']").val();
  
  frm+= 'DocNum='+_FrmDocNum+'&Name='+_FrmName+'&Company='+_FrmCompany+'&Phone='+_FrmPhone+'&Address='+_FrmAddress+'&City='+_FrmCity+'&Email1='+_FrmEmail1+'&Email2='+_FrmEmail2+'&Email3='+_FrmEmail3+'&Service='+TypeProduct;
  
  // Paso 2 (Todos)
   // Registrar un Dominio
   TypeConfig	= $("input[@name='Step2_1_Config']:checked").val();
   
   if($("input[@name='Step2_1_URL_Cloacking']:checked").val() == '1') {
    IncludeCloac = 1;
   } else {
    IncludeCloac = 0;
   }
   
   _FrmStep2Domain	= $("input[@name='Step2_1_Domain']").val();
   _FrmDomainNS1	= $("input[@name='Step2_1_ns1']").val();
   _FrmDomainNS2	= $("input[@name='Step2_1_ns2']").val();
   _FrmDomainNS3	= $("input[@name='Step2_1_ns3']").val();
   _FrmDomainURL	= $("input[@name='Step2_1_URL']").val();
   
   frm+= '&Sp1_Domain='+_FrmStep2Domain+'&Sp1_ConfigDomain='+TypeConfig+'&Sp1_NS1='+_FrmDomainNS1+'&Sp1_NS2='+_FrmDomainNS2+'&Sp1_NS3='+_FrmDomainNS3+'&Sp1_URLRedirect='+_FrmDomainURL+'&Sp1_Cloack='+IncludeCloac;
  
   // Planes de Hosting
   _FrmHostingDomain = $("input[@name='Step2_2_Domain']").val();
   _FrmHostingPlan	 = $("select[@name='Step2_2_HostingPlan'] option:selected").val();
   _FrmHostingUser	 = $("input[@name='Step2_2_HUser']").val();
   _FrmHostingPass	 = $("input[@name='Step2_2_HPass']").val();
   
   frm+= '&Sp2_HDomain='+_FrmHostingDomain+'&Sp2_HostingPlan='+_FrmHostingPlan+'&Sp2_HostingUser='+_FrmHostingUser+'&Sp2_HostingPass='+_FrmHostingPass;
  
   // Hosting y Dominio
   _FrmHDom_Domain = $("input[@name='Step2_3_Domain']").val();
   _FrmHDom_Plan   = $("select[@name='Step2_3_HostingPlan'] option:selected").val();
   _FrmHDom_User   = $("input[@name='Step2_3_HUser']").val();
   _FrmHDom_Pass   = $("input[@name='Step2_3_HPass']").val();
   
   frm+= '&Sp3_HDomain='+_FrmHDom_Domain+'&Sp3_HostingPlan='+_FrmHDom_Plan+'&Sp3_HostingUser='+_FrmHDom_User+'&Sp3_HostingPass='+_FrmHDom_Pass;
 
  // Paso 3 (Envio datos)
  $.post("/script/SendMailDataPurchase.phpx", frm, function(rp) {
   if(rp == 'msg_completed') {
	$("#Loading_Form").fadeOut("fast", function() {
     $("#ProcMessage").fadeIn("fast", function() {
      if($.browser.msie) { this.style.removeAttribute('filter'); }
     });
    });
    
    ($("input[@name='Sp1_Email1']").get(0).value.length > 15) ? rsEmail = '<span style="cursor:help;" title="'+$("input[@name='Sp1_Email1']").val()+'">'+$("input[@name='Sp1_Email1']").get(0).value.substring(0,15)+'...</span>' : rsEmail = $("input[@name='Sp1_Email1']").val();
    
    $("#MessageProcessed").html('Hemos recibido su Orden de Compra y enviado a sus direcciones de correo las instrucciones necesarias para la realizaci&oacute;n del pago correspondiente; una vez confirmado activaremos sus productos y le enviaremos las instrucciones junto con la Factura de Venta dentro de los siguientes 60 minutos.<br><br>No olvide revisar la carpeta de Correo no deseado y agregarnos a su lista de direcciones seguras.<br /><br /><span rel="clean-form" style="cursor:pointer; text-decoration:underline;">Regresar</span>');
    
    $("span[@rel='clean-form']").click(function() {
     $("#ProcMessage").fadeOut("fast", function() {
      $("#Loading_Form").slideToggle("fast", function() {
       if($.browser.msie) { this.style.removeAttribute('filter'); }
      });
     });
     Cleaning = function() {
      $("#Loading_Form").fadeOut("fast", function() {
       $("#Step1").fadeIn("fast", function() {
        if($.browser.msie) { this.style.removeAttribute('filter'); }
       });
      });
      //
      $("#DefaultStep2_1").css("display","block");
      $("#Option1_Step2_1").css("display","none");
      $("#Option2_Step2_1").css("display","none");
      //
      $("form[@name='FormShop']").get(0).reset();
     }
     setTimeout('Cleaning()', 3000);
    });
	
	setTimeout(function() { 
	
     $("#ProcMessage").fadeOut("fast", function() {
      $("#Loading_Form").slideToggle("fast", function() {
       if($.browser.msie) { this.style.removeAttribute('filter'); }
	   
		Cleaning = function() {
		 $("#Loading_Form").fadeOut("fast", function() {
		   $("#Step1").fadeIn("fast", function() {
			if($.browser.msie) { this.style.removeAttribute('filter'); }
		   });
		  });
		  //
		  $("#DefaultStep2_1").css("display","block");
		  $("#Option1_Step2_1").css("display","none");
		  $("#Option2_Step2_1").css("display","none");
		  //
		  $("form[@name='FormShop']").get(0).reset();
		}
		setTimeout('Cleaning()', 5000);
	   
      });
     });
		
	}, 60000);
   }
  });
  
}

SetUser = function(theId, theId2Wri) {
 var prmdom = $("#"+theId).val();
 prmdom0 = prmdom.replace('.','');
 $("#"+theId2Wri).val(prmdom0.substring(0,8));
}

SetPassword = function() {
 var prdom0 = $('#Sp1_Name_frm').val();
 rsNameVal = prdom0.split(' ');
 rsStrNam = rsNameVal[0].substring(0,3); // Nombre
 rsStrNam2 = rsNameVal[1].substring(0,3); // Apellido
 rsNpass = rsStrNam+rsStrNam2;
 $('#Step2_2_HPass_frm').val(rsNpass.toLowerCase());
 $('#Step2_3_HPass_frm').val(rsNpass.toLowerCase());
}

$(document).ready(function() {

  // Get List Accounts in WHM
  $.get("/script/listAccounts.arkx","check=0", function(t) {
   rsRp = t.split("/");
   $("#numWHM_ly").text(rsRp[0]*5);
  });
  
  // cPanel Dialog
  $("a[@rel='cpanel']").click(function() {
   if($("#ContentBoxLogin").length == 0) {
    $("<div><p align=\"center\"><img src=\"images/mini_login_load.gif\" /></p></div>").attr("id","ContentBoxLogin").addClass("LoginContent").load("script/login.phpx").css("display","block").appendTo("body");
   }
   return false;
  });
  
  // Date Picker
  $.datePicker.setDateFormat('ymd', '-');
  $.datePicker.setLanguageStrings(
    ['Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado'],
    ['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'],
    {p:'Anterior', n:'Siguiente', c:'Cerrar', b:'Elegir Fecha'}
  );

  // Layers
  $("#Step1").fadeIn("slow", function() { if($.browser.msie) { this.style.removeAttribute('filter'); } });
  $("#Res1").slideDown("slow");
  $("#NextPlan").fadeIn("slow", function() { if($.browser.msie) { this.style.removeAttribute('filter'); } });
  $("#PayReport_ly").fadeIn("slow", function() { if($.browser.msie) { this.style.removeAttribute('filter'); } });
  
  // Search Domain
  $("#frmDomainSearch_id").focus(function() {
   if($(this).val() == 'sudominio.com') { $(this).val(''); }
  }).blur(function() {
   if($(this).val == '') { $(this).val('sudominio.com'); }
  }).keypress(function(e) { if(e.which == 13) { searchDomainData(); return false; } });
  $("#BtnImage").click(function() { searchDomainData(); });
  
  // Pay Report
  $("#OrderNum_frm_0").focus(function() { 
   if($(this).val() == 'No. Orden') { $(this).val(''); }
  }).blur(function() { 
   if($(this).val() == '') { 
    $(this).val('No. Orden');
   } else {
    $.post("/script/CheckOrder.arkx","OrderNum="+$(this).val(), function(rp) {
     if(rp == 'order_not_exists') {
      alert('La Orden No. '+$("#OrderNum_frm_0").val()+' no existe en el sistema');
      $("#OrderNum_frm_0").val('');
      return false;
     }
    });
   }
  }).keypress(function(e) { if (e.which > 31 && (e.which < 48 || e.which > 57)) { return false; } });
  $("#PayDate_frm_1").datePicker({
   startDate:''
  });
  $("#PayMethod_frm_2").change(function() {
   if($(this).val() == '1' || $(this).val() == '2') { // Activa input
    $("#PayNumRef_frm_3").removeAttr("disabled");
   } else {
    $("#PayNumRef_frm_3").attr("disabled","disabled");
   }
  });
  $("#PayNumRef_frm_3").focus(function() {
   if($(this).val() == 'Valor Pagado') {
    $(this).val('');
   }
  }).blur(function() {
   if($(this).val() == '') {
    $(this).val('Valor Pagado');
   }
  }).keypress(function(e) { if (e.which > 31 && (e.which < 48 || e.which > 57)) { return false; } });
  
  // Validation
  $("input[@name='SendReport']").click(function() {
    
    if($("#OrderNum_frm_0").val() == '' || $("#OrderNum_frm_0").val() == 'No. Orden') { 
     alert('Escriba el Número de Orden');
     $("#OrderNum_frm_0").get(0).focus();
     return false;
    }
    if($("#PayDate_frm_1").val() == '' || $("#PayDate_frm_1").val() == 'Fecha Pago') { 
     alert('Elija la Fecha de Pago');
     $("#PayDate_frm_1").get(0).select();
     return false;
    }
    if($("#PayMethod_frm_2").val() == '') {
     alert('Elija el Método de Pago');
     $("#PayMethod_frm_2").get(0).focus();
     return false;
    } else {
     if($("#PayNumRef_frm_3").val() == 'Valor Pagado' || $("#PayNumRef_frm_3").val() == '') {
      alert('Escriba el Valor Pagado');
      $("#PayNumRef_frm_3").get(0).focus();
      return false;
     }
    }
    
    // Sending info to validation
    $("#PayReport_ly").fadeOut("fast", function() { 
     $("#Process_Pay_ly").fadeIn("fast", function() {
      if($.browser.msie) { this.style.removeAttribute('filter'); }
      var rsStringQRI = "OrderNum="+$("#OrderNum_frm_0").val()+"&PayDateOrder="+$("#PayDate_frm_1").val()+"&PayMethod="+$("#PayMethod_frm_2").val()+"&PayNumRef="+$("#PayNumRef_frm_3").val()+"&ValidateOrder=1";
      $.post("/script/CheckOrder.arkx", rsStringQRI, function(rp) {
         if(rp == 'send_completed') {
          $("#ResProc_Pay_Report").html("Su informe ha sido enviado y en los siguientes minutos recibir&aacute; una notificaci&oacute;n al correo electr&oacute;nico especificado.");
          $("#Process_Pay_ly").fadeOut("fast", function() {
           $("#Pay_Result_ly").fadeIn("fast", function() {
            if($.browser.msie) { this.style.removeAttribute('filter'); }
           });
          });
          
          setTimeout(function() {
           $("#Pay_Result_ly").fadeOut("fast", function() { 
            // Cleaning form
            $("#OrderNum_frm_0").val('No. Orden');
            $("#PayDate_frm_1").val('Fecha Pago');
            $("#PayMethod_frm_2").val('');
            $("#PayNumRef_frm_3").val('Valor Pagado').attr("disabled","disabled");
            
            $("#PayReport_ly").fadeIn("fast", function() {
             if($.browser.msie) { this.style.removeAttribute('filter'); }
            });
           });
          }, 10000);
         } else if(rp == 'already_registered') {
          $("#ResProc_Pay_Report").html("Ya ha sido informado el pago de la Orden de Compra, por favor espere unos minutos o comuniquese con nosotros para m&aacute;s informaci&oacute;n");
          $("#Process_Pay_ly").fadeOut("fast", function() { 
           $("#Pay_Result_ly").fadeIn("fast", function() {
            if($.browser.msie) { this.style.removeAttribute('filter'); }
           });
          });
          
          setTimeout(function() {
           $("#Pay_Result_ly").fadeOut("fast", function() {
            // Cleaning form
            $("#OrderNum_frm_0").val('No. Orden');
            $("#PayDate_frm_1").val('Fecha Pago');
            $("#PayMethod_frm_2").val('');
            $("#PayNumRef_frm_3").val('Valor Pagado').attr("disabled","disabled");
            $("#PayReport_ly").fadeIn("fast", function() {
             if($.browser.msie) { this.style.removeAttribute('filter'); }
            });
           });
          }, 10000);
         }
      });
     });
    });
     
  });
  
  // Buy Order
  /* Step 1 */
  // Buy Order - Form Elements
  $("#Sp1_DocNum_frm")
   .focus(function() {
    if($(this).val() == 'NIT o CC') { $(this).val(''); }
   })
   .keypress(function(e) { if (e.which > 31 && (e.which < 48 || e.which > 57)) { return false; } })
   .blur(function() {
    if($(this).val() == '' || $(this).val() == 'NIT o CC') { 
     $(this).val('NIT o CC'); 
    } else {
     $("body").css("cursor","progress");
     $("input[@name='FirstStep']").attr("disabled","disabled");
     $.post("/script/UserData.arkx","NumDoc="+$(this).val(),function(rp) {
      if($(rp).find("total").text() == '0') {
       $("body").css("cursor","default");
       $('#Sp1_Company_frm').val('Empresa');
       $('#Sp1_Phone_frm').val('Teléfono');
       $('#Sp1_Address_frm').val('Dirección');
       $('#Sp1_City_frm').val('Ciudad');
       $('#Sp1_Email1_frm').val('E-mail 1');
       $('#Sp1_Email2_frm').val('E-mail 2');
       $('#Sp1_Email3_frm').val('E-mail 3');
       $('#Sp1_Name_frm').val('').get(0).focus();
       $("input[@name='FirstStep']").removeAttr("disabled");
      } else {
       $("body").css("cursor","default");
       var xName  = $(rp).find('name').text();
       var xComp  = $(rp).find('company').text();
       var xPhon  = $(rp).find('phone').text();
       var xAddr  = $(rp).find('address').text();
       var xCity  = $(rp).find('city').text();
       var xMail0 = $(rp).find('email1').text();
       var xMail1 = $(rp).find('email2').text();
       var xMail2 = $(rp).find('email3').text();
       $('#Sp1_Name_frm').val(xName);
       $('#Sp1_Company_frm').val(xComp);
       $('#Sp1_Phone_frm').val(xPhon);
       $('#Sp1_Address_frm').val(xAddr);
       $('#Sp1_City_frm').val(xCity);
       $('#Sp1_Email1_frm').val(xMail0);
       $('#Sp1_Email2_frm').val(xMail1);
       $('#Sp1_Email3_frm').val(xMail2);
       $("input[@name='FirstStep']").removeAttr("disabled");
      }
     },"xml");
    }
   });
  
  $("input[@rel='simple-val']").each(function(i) {
    $(this).focus(function() { if($(this).val() == $(this).attr("rev")) { $(this).val(""); } }).blur(function() { if($(this).val() == "") { $(this).val($(this).attr("rev")); } });
  });
  
  // Validation
  $("input[@name='FirstStep']").click(function() {
    
    if($("#Sp1_DocNum_frm").val() == '' || $("#Sp1_DocNum_frm").val() == 'NIT o CC') {
     alert('Escriba solo números en el Campo NIT o Cédula de Ciudadania');
     $("#Sp1_DocNum_frm").get(0).focus();
     return false;
    }
   
    if($("#Sp1_Name_frm").val() == '' || $("#Sp1_Name_frm").val() == 'Nombre') {
     alert('Escriba el Nombre');
     $("#Sp1_Name_frm").get(0).focus();
     return false;
    }
    
    if($("#Sp1_Company_frm").val() == '' || $("#Sp1_Company_frm").val() == 'Empresa') {
     alert('Escriba el Nombre de Empresa');
     $("#Sp1_Company_frm").get(0).focus();
     return false;
    }

    if($("#Sp1_Phone_frm").val() == '' || $("#Sp1_Phone_frm").val() == 'Teléfonos') {
     alert('Escriba sólo números para el Campo Teléfono');
     $("#Sp1_Phone_frm").get(0).focus();
     return false;
    }

    if($("#Sp1_Address_frm").val() == '' || $("#Sp1_Address_frm").val() == 'Dirección') {
     alert('Escriba la Dirección');
     $("#Sp1_Address_frm").get(0).focus();
     return false;
    }

    if($("#Sp1_City_frm").val() == '' || $("#Sp1_City_frm").val() == 'Ciudad') {
     alert('Escriba la Ciudad');
     $("#Sp1_City_frm").get(0).focus();
     return false;
    }

    if($("#Sp1_Email1_frm").val() == '' || $("#Sp1_Email1_frm").val() == 'E-mail 1') {
     alert('Escriba la dirección de correo electrónico');
     $("#Sp1_Email1_frm").get(0).focus();
     return false;
    } else if($("#Sp1_Email1_frm").get(0).value.indexOf('@',0) == -1 || $("#Sp1_Email1_frm").get(0).value.indexOf('.',0) == -1) {
     alert('Escriba correctamente la dirección de correo electrónico');
     $("#Sp1_Email1_frm").get(0).select();
     return false;
    }
    
    if($("#Sp1_Email2_frm").val() == '' || $("#Sp1_Email2_frm").val() == 'E-mail 2') {
     $("#Sp1_Email2_frm").val('E-mail 2');
    } else {
     if($("#Sp1_Email2_frm").get(0).value.indexOf('@',0) == -1 || $("#Sp1_Email2_frm").get(0).value.indexOf('.',0) == -1) {
      alert('Escriba correctamente la dirección de correo electrónico');
      $("#Sp1_Email2_frm").get(0).select();
      return false;
     }   
    }
    
    if($("#Sp1_Email3_frm").val() == '' || $("#Sp1_Email3_frm").val() == 'E-mail 3') {
     $("#Sp1_Email3_frm").val('E-mail 3');
    } else {
     if($("#Sp1_Email3_frm").get(0).value.indexOf('@',0) == -1 || $("#Sp1_Email3_frm").get(0).value.indexOf('.',0) == -1) {
      alert('Escriba correctamente la dirección de correo electrónico');
      $("#Sp1_Email3_frm").get(0).select();
      return false;
     }   
    }

    var Mck = $("input[@name='Sp1_Service']:checked").length;    
 	if(Mck == 0) {
     alert('Elija el Servicio a requerir');
     return false;
    }
    
    $("#Step1").fadeOut("fast", function() {
     $("#Loading_Form").fadeIn("fast", function() {
      if($.browser.msie){ this.style.removeAttribute('filter'); }
      if($("input[@name='Sp1_Service']:checked").val() == '1') {
       setTimeout(function() { 
        $("#Loading_Form").fadeOut("fast", function() {
         $("#Step2_1").fadeIn("fast", function() {
          if($.browser.msie) { this.style.removeAttribute('filter'); }
         });
        });
       }, 2000);
      } else if($("input[@name='Sp1_Service']:checked").val() == '2') {
       setTimeout(function() {
        $("#Loading_Form").fadeOut("fast", function() {
         $("#Step2_2").fadeIn("fast", function() { if($.browser.msie) { this.style.removeAttribute('filter'); } });
        });
       }, 2000);
      } else if($("input[@name='Sp1_Service']:checked").val() == '3') {
       setTimeout(function() {
        $("#Loading_Form").fadeOut("fast", function() {
         $("#Step2_3").fadeIn("fast", function() { if($.browser.msie) { this.style.removeAttribute('filter'); } });
        });
       }, 2000);
      }
     });
    });
  
  });
  /* End Step 1 */

  /* Step 2 */
  /* Only Domain */
   $("#Step2_1_Domain_frm").focus(function() {
    if($(this).val() == 'Dominio.com') { $(this).val(''); }
   }).blur(function() {
    if($(this).val() == '') { $(this).val('Dominio.com'); } else { $(this).val($(this).get(0).value.toLowerCase()); }
   });
   $("#Step2_1_Config_id_1").click(function() {
    $("#DefaultStep2_1").css("display","none");
    $("#Option1_Step2_1").css("display","block");
   });
   $("#Step2_1_Config_id_2").click(function() {
    $("#DefaultStep2_1").css("display","none");
    $("#Option2_Step2_1").css("display","block");
   });
   
   $("#Step2_1_ns1_frm").focus(function() {
    if($(this).val() == 'NS1') { $(this).val(''); }
   }).blur(function() {
    if($(this).val() == '') { $(this).val('NS1'); }
   });
   $("#Step2_1_ns2_frm").focus(function() {
    if($(this).val() == 'NS2') { $(this).val(''); }
   }).blur(function() {
    if($(this).val() == '') { $(this).val('NS2'); }
   });
   $("#Step2_1_ns3_frm").focus(function() {
    if($(this).val() == 'NS3') { $(this).val(''); }
   }).blur(function() {
    if($(this).val() == '') { $(this).val('NS3'); }
   });
   $("#Step2_1_URL_frm").focus(function() {
    if($(this).val() == 'http://') { $(this).val(''); }
   }).blur(function() {
    if($(this).val() == '') { $(this).val('http://'); }
   });
   
   // Validation
   $("input[@name='SecondStep_OnlyDomain']").click(function() {
    if($("#Step2_1_Domain_frm").val() == '' || $("#Step2_1_Domain_frm").val() == 'Dominio.com') {
     alert("Escriba el Nombre del Dominio a ordenar");
     $("#Step2_1_Domain_frm").get(0).focus();
     return false;
    } else {
     var DomMatch = $("#Step2_1_Domain_frm").get(0).value.indexOf('.',0);
     
     if(DomMatch == -1) {
      alert('Escriba el Nombre de Dominio válido, no utilice espacios.');
      $("#Step2_1_Domain_frm").get(0).focus();
      return false;
     } else {
      var rsDomainSP1 = $("#Step2_1_Domain_frm").get(0).value.split('.');
      var DomainList_Sp1 = ['com','org','net'];
      if($.inArray(rsDomainSP1[1],DomainList_Sp1) == -1) {
       alert('Solo puede adquirir dominios con las siguientes extensiones: .COM .NET y .ORG');
	   $("#Step2_1_Domain_frm").get(0).focus();
       return false;
      }
     }
    }
    var DomConfig = $("input[@name='Step2_1_Config']:checked").length;
    if(DomConfig == 0) {
     alert("Elija la configuración a aplicar al dominio");
     return false;
    } else {
     if($("input[@name='Step2_1_Config']:checked").val() == '1') { // Apuntar a DNS
      $("#DefaultStep2_1").css("display","none");
      $("#Option1_Step2_1").css("display","block");
      if($("#Step2_1_ns1_frm").val() == '' || $("#Step2_1_ns1_frm").val() == 'NS1') { alert("Escriba el Servidor DNS 1"); $("#Step2_1_ns1_frm").get(0).focus(); return false; }
      if($("#Step2_1_ns2_frm").val() == '' || $("#Step2_1_ns2_frm").val() == 'NS2') { alert("Escriba el Servidor DNS 2"); $("#Step2_1_ns2_frm").get(0).focus(); return false; }
     } else if($("input[@name='Step2_1_Config']:checked").val() == '2') { // Redigir a Sitio Web
      $("#DefaultStep2_1").css("display","none");
      $("#Option2_Step2_1").css("display","block");
      if($("#Step2_1_URL_frm").val() == 'http://') { 
       alert("Escriba la URL a donde será redirigido cuando ingresen al Dominio");
       $("#Step2_1_URL_frm").get(0).focus(); return false; 
      }
     }
    }
    
    $("#Step2_1").fadeOut("fast", function() {
     $("#Loading_Form").fadeIn("fast", function() {
      if($.browser.msie) { this.style.removeAttribute('filter'); }
      SendDataServer();
     });
    });
   });
  /* End Only Domain */
   
  /* Only Hosting  */
   $("#Step2_2_Domain_frm").focus(function() {
    if($(this).val() == 'Dominio.com') { $(this).val(''); }
   }).blur(function() {
    if($(this).val() == '') { 
     $(this).val('Dominio.com');
    } else {
     $(this).val($(this).get(0).value.toLowerCase()); 
     SetUser('Step2_2_Domain_frm','Step2_2_HUser_frm');
     SetPassword();
    }
   });
   $("#Step2_2_HUser_frm").focus(function() {
    if($(this).val() == 'Usuario') { $(this).val(''); }
   }).blur(function() {
    if($(this).val() == '') { $(this).val('Usuario'); }
   });
   $("#Step2_2_HPass_frm").focus(function() {
    if($(this).val() == 'Contraseña') { $(this).val(''); }
   }).blur(function() {
    if($(this).val() == '') { $(this).val('Contraseña'); }
   });
   
   // Validation
   $("input[@name='SecondStep_Hosting']").click(function() {
    if($("#Step2_2_Domain_frm").val() == '' || $("#Step2_2_Domain_frm").val() == 'Dominio.com') {
     alert("Escriba el Nombre del Dominio a ordenar");
     $("#Step2_2_Domain_frm").get(0).focus();
     return false;
    } else {
     var DomMatch = $("#Step2_2_Domain_frm").get(0).value.indexOf('.',0);
     
     if(DomMatch == -1) {
      alert('Escriba el Nombre de Dominio válido, no utilice espacios.');
      $("#Step2_2_Domain_frm").get(0).focus();
      return false;
     } else {
      var rsDomainSP2 = $("#Step2_2_Domain_frm").get(0).value.split('.');
      var DomainList_Sp2 = ['com','org','net'];
      if($.inArray(rsDomainSP2[1],DomainList_Sp2) == -1) {
       alert('Solo puede adquirir dominios con las siguientes extensiones: .COM .NET y .ORG');
	   $("#Step2_2_Domain_frm").get(0).focus();
       return false;
      }
     }
    }
    if($("#Step2_2_HostingPlan_frm").val() == '') {
     alert("Elija el Plan de Hosting a ordenar");
     $("#Step2_2_HostingPlan_frm").get(0).focus();
     return false;
    }
    if($("#Step2_2_HUser_frm").val() == '') { alert("Escriba el Usuario para acceder al Panel de Control de Hosting"); $("#Step2_2_HUser_frm").get(0).focus(); return false; }
    if($("#Step2_2_HPass_frm").val() == '') { alert("Escriba una contraseña"); $("#Step2_2_HPass_frm").get(0).focus(); return false; }
    
    $("#Step2_2").fadeOut("fast", function() {
     $("#Loading_Form").fadeIn("fast", function() {
      if($.browser.msie) { this.style.removeAttribute('filter'); }
      SendDataServer();
     });
    });
   });
  /* End Only Hosting */
   
  /* Domain & Hosting */
   $("#Step2_3_Domain_frm").focus(function() {
    if($(this).val() == 'Dominio.com') { $(this).val(''); }
   }).blur(function() {
    if($(this).val() == '') { 
     $(this).val('Dominio.com');
    } else {
     $(this).val($(this).get(0).value.toLowerCase());
     SetUser('Step2_3_Domain_frm','Step2_3_HUser_frm');
     SetPassword();
    }
   });
   $("#Step2_3_HUser_frm").focus(function() {
    if($(this).val() == 'Usuario') { $(this).val(''); }
   }).blur(function() {
    if($(this).val() == '') { $(this).val('Usuario'); }
   });
   $("#Step2_3_HPass_frm").focus(function() {
    if($(this).val() == 'Contraseña') { $(this).val(''); }
   }).blur(function() {
    if($(this).val() == '') { $(this).val('Contraseña'); }
   });
   
   // Validation
   $("input[@name='SecondStep_DomHost']").click(function() {
    if($("#Step2_3_Domain_frm").val() == '' || $("#Step2_3_Domain_frm").val() == 'Dominio.com') {
     alert("Escriba el Nombre del Dominio a ordenar");
     $("#Step2_3_Domain_frm").get(0).focus();
     return false;
    } else {
     var DomMatch = $("#Step2_3_Domain_frm").get(0).value.indexOf('.',0);
     
     if(DomMatch == -1) {
      alert('Escriba el Nombre de Dominio válido, no utilice espacios.');
      $("#Step2_3_Domain_frm").get(0).focus();
      return false;
     } else {
      var rsDomainSP3 = $("#Step2_3_Domain_frm").get(0).value.split('.');
      var DomainList_Sp3 = ['com','org','net'];
      if($.inArray(rsDomainSP3[1],DomainList_Sp3) == -1) {
       alert('Solo puede adquirir dominios con las siguientes extensiones: .COM .NET y .ORG');
	   $("#Step2_3_Domain_frm").get(0).focus();
       return false;
      }
     }
    }
    if($("#Step2_3_HostingPlan_frm").val() == '') {
     alert("Elija el Plan de Hosting a ordenar");
     $("#Step2_3_HostingPlan_frm").get(0).focus();
     return false;
    }
    if($("#Step2_3_HUser_frm").val() == '') { alert("Escriba el Usuario para acceder al Panel de Control de Hosting"); $("#Step2_3_HUser_frm").get(0).focus(); return false; }
    if($("#Step2_2_HPass_frm").val() == '') { alert("Escriba una contraseña"); $("#Step2_3_HPass_frm").get(0).focus(); return false; }
    
    $("#Step2_3").fadeOut("fast", function() {
     $("#Loading_Form").fadeIn("fast", function() {
      if($.browser.msie) { this.style.removeAttribute('filter'); }
      SendDataServer(); 
     });
    });
   });
  /* End Domain & Hosting */
  /* End Step 2 */
  
  // Hosting Plans
  $("a[@rel='high-hosting']").click(function() {
   $("#Res1").slideToggle("slow", function() {
    $("#Res2").slideToggle("slow");
   });
   return false;
  });
  
  $("a[@rel='low-hosting']").click(function() {
   $("#Res2").slideToggle("slow", function() {
    $("#Res1").slideToggle("slow");
   });
   return false;
  });
  
});