|
|
@@ -1,15 +1,9 @@
|
|
|
-var suscribe=document.getElementById('suscripcion');
|
|
|
-var overlay=document.getElementById('overlay-contact');
|
|
|
-function showSuscribe() {
|
|
|
- suscribe.style.display="block";
|
|
|
- overlay.style.display="block";
|
|
|
-}
|
|
|
-
|
|
|
window.onload = function() {
|
|
|
+var req = new XMLHttpRequest();
|
|
|
+
|
|
|
var availableWidth = [ 500, 1024, 1400, 1920];
|
|
|
- var banner=document.getElementById("banner");
|
|
|
- var req = new XMLHttpRequest();
|
|
|
var size=0;
|
|
|
+ var banner=document.getElementById("banner");
|
|
|
while (window.innerWidth > availableWidth[size] && size < availableWidth.length-1 )
|
|
|
size++;
|
|
|
banner.src="Images/slider/slide1-"+availableWidth[size]+".jpg";
|
|
|
@@ -18,6 +12,7 @@ window.onload = function() {
|
|
|
var tit_curso = document.getElementsByClassName("titulo_curso");
|
|
|
var desc_curso = document.getElementsByClassName("descripcion_curso");
|
|
|
var list = document.getElementsByTagName("li");
|
|
|
+ var overlay=document.getElementById('overlay-contact');
|
|
|
var exit=document.getElementById('exit');
|
|
|
var basicgrey=document.getElementById('basic-grey');
|
|
|
var logo=document.getElementById('logo');
|
|
|
@@ -41,13 +36,11 @@ window.onload = function() {
|
|
|
overlay.onclick = function(){
|
|
|
overlay.style.display="none";
|
|
|
basicgrey.style.display="none";
|
|
|
- suscribe.style.display="none";
|
|
|
- }
|
|
|
+ };
|
|
|
exit.onclick=function(){
|
|
|
overlay.style.display="none";
|
|
|
basicgrey.style.display="none";
|
|
|
- suscribe.style.display="none";
|
|
|
- }
|
|
|
+ };
|
|
|
btnok.onclick=function(){
|
|
|
var params="mail="+document.getElementById("suscribe").value;
|
|
|
req.open("POST", "newsletter.php", true);
|
|
|
@@ -57,12 +50,12 @@ window.onload = function() {
|
|
|
req.onreadystatechange=function(){
|
|
|
if(req.readyState == 4 && req.status == 200)
|
|
|
document.getElementById("respuestanewsletter").innerHTML=req.responseText;
|
|
|
- }
|
|
|
+ };
|
|
|
req.send(params);
|
|
|
};
|
|
|
btnconsulta.onclick=function(){
|
|
|
if (btnconsulta.disabled) return;
|
|
|
- if (document.getElementById("name").value.length == 0 || document.getElementById("message").value.length<10) {
|
|
|
+ if (document.getElementById("name").value.length === 0 || document.getElementById("message").value.length<10) {
|
|
|
document.getElementById("respuestacontacto").innerHTML="Por favor completa todos los campos";
|
|
|
return;
|
|
|
}
|
|
|
@@ -80,21 +73,22 @@ window.onload = function() {
|
|
|
document.getElementById("respuestacontacto").innerHTML=req.responseText;
|
|
|
btnconsulta.value="Enviar";
|
|
|
btnconsulta.disabled=false;
|
|
|
- }
|
|
|
+ };
|
|
|
btnconsulta.value="Enviando....";
|
|
|
btnconsulta.disabled=true;
|
|
|
req.send(params);
|
|
|
};
|
|
|
- for(var i =0; i < tit_curso.length; i++)
|
|
|
+ var i=0;
|
|
|
+ for(i =0; i < tit_curso.length; i++)
|
|
|
tit_curso[i].onclick=curso_click;
|
|
|
|
|
|
- for(var i =0; i < contact.length; i++)
|
|
|
+ for(i =0; i < contact.length; i++)
|
|
|
contact[i].onclick=showContact;
|
|
|
|
|
|
- for(var i =0; i < list.length; i++)
|
|
|
+ for(i =0; i < list.length; i++)
|
|
|
if(list[i].firstChild.tagName=="A")
|
|
|
list[i].firstChild.addEventListener("click", function(e) {
|
|
|
- var target=document.getElementById(this.hash.replace("#",""))
|
|
|
+ var target=document.getElementById(this.hash.replace("#",""));
|
|
|
scrollToY(target.offsetTop, 1500, 'easeInOutQuint');
|
|
|
if (this.hash=='#footer-outer')
|
|
|
showContact();
|
|
|
@@ -130,7 +124,7 @@ window.onload = function() {
|
|
|
selZona.id="zona";
|
|
|
result.id="result";
|
|
|
|
|
|
- for (country in distrib) {
|
|
|
+ for (var country in distrib) {
|
|
|
var opt = document.createElement("option");
|
|
|
var node = document.createTextNode(country);
|
|
|
opt.appendChild(node);
|
|
|
@@ -160,9 +154,9 @@ window.onload = function() {
|
|
|
var zona = document.getElementById("zona");
|
|
|
zona.innerHTML="";
|
|
|
prov.innerHTML="";
|
|
|
- if(distrib[pais] == undefined) return;
|
|
|
+ if(distrib[pais] === undefined) return;
|
|
|
|
|
|
- for (provincia in distrib[pais]) {
|
|
|
+ for (var provincia in distrib[pais]) {
|
|
|
var opt = document.createElement("option");
|
|
|
var node = document.createTextNode(provincia);
|
|
|
opt.appendChild(node);
|
|
|
@@ -177,9 +171,9 @@ window.onload = function() {
|
|
|
var zona = document.getElementById("zona");
|
|
|
prov.innerHTML="";
|
|
|
zona.innerHTML="";
|
|
|
- if(distrib[pais] == undefined || distrib[pais][prov] == undefined) return;
|
|
|
+ if(distrib[pais] === undefined || distrib[pais][prov] === undefined) return;
|
|
|
|
|
|
- for (zone in distrib[pais][prov]) {
|
|
|
+ for (var zone in distrib[pais][prov]) {
|
|
|
var opt = document.createElement("option");
|
|
|
var node = document.createTextNode(zone);
|
|
|
opt.appendChild(node);
|
|
|
@@ -194,13 +188,12 @@ window.onload = function() {
|
|
|
var result = document.getElementById("result");
|
|
|
result.innerHTML="";
|
|
|
var z = distrib[pais][prov][zona];
|
|
|
- var text="";
|
|
|
- for (distr in z ) {
|
|
|
- for (p in z[distr]) {
|
|
|
- result.appendChild(document.createTextNode(p+":"+z[distr][p]))
|
|
|
- result.appendChild(document.createElement("br"))
|
|
|
+ for (var distr in z ) {
|
|
|
+ for (var p in z[distr]) {
|
|
|
+ result.appendChild(document.createTextNode(p+":"+z[distr][p]));
|
|
|
+ result.appendChild(document.createElement("br"));
|
|
|
}
|
|
|
- result.appendChild(document.createElement("br"))
|
|
|
+ result.appendChild(document.createElement("br"));
|
|
|
}
|
|
|
}
|
|
|
function slide() {
|
|
|
@@ -213,4 +206,4 @@ window.onload = function() {
|
|
|
banner.src="Images/slider/slide"+curImg+"-"+availableWidth[size]+".jpg";
|
|
|
banner.removeAttribute('class');
|
|
|
}
|
|
|
-}
|
|
|
+};
|