



function opennewsletter(){

	emailwindow=dhtmlmodal.open('EmailBox', 'iframe', 'http://www.hylandmadrid.com/libros/libros-en-ingles-gratis.php', 'e-books - Hyland Language Centre', 'width=650px,height=500px,center=1,resize=0,scrolling=1')



emailwindow.onclose=function(){ //Define custom code to run when window is closed

	var theform=this.contentDoc.forms[0] //Access first form inside iframe just for your reference

	var theemail=this.contentDoc.getElementById("emailfield") //Access form field with id="emailfield" inside iframe

	if (theemail.value.indexOf("@")==-1){ //crude check for invalid email

		alert("Please enter a valid email address")

		return false //cancel closing of modal window

	}

	else{ //else if this is a valid email

		document.getElementById("youremail").innerHTML=theemail.value //Assign the email to a span on the page

		return true //allow closing of window

	}

}

} //End "opennewsletter" function



function opennewsletter2(){

	emailwindow=dhtmlmodal.open('EmailBox', 'iframe', 'http://www.hylandmadrid.com/enlaces/00-recursos.php', 'Recursos y enlaces - Links and Resources', 'width=650px,height=500px,center=1,resize=0,scrolling=1')



emailwindow.onclose=function(){ //Define custom code to run when window is closed

	var theform=this.contentDoc.forms[0] //Access first form inside iframe just for your reference

	var theemail=this.contentDoc.getElementById("emailfield") //Access form field with id="emailfield" inside iframe

	if (theemail.value.indexOf("@")==-1){ //crude check for invalid email

		alert("Please enter a valid email address")

		return false //cancel closing of modal window

	}

	else{ //else if this is a valid email

		document.getElementById("youremail").innerHTML=theemail.value //Assign the email to a span on the page

		return true //allow closing of window

	}

}

} //End "opennewsletter" function



function opennewsletter3(){

	emailwindow=dhtmlmodal.open('EmailBox', 'iframe', 'http://www.hylandmadrid.com/enlaces/00-recursos-yls.php', 'Recursos y enlaces - Links and Resources', 'width=650px,height=500px,center=1,resize=0,scrolling=1')



emailwindow.onclose=function(){ //Define custom code to run when window is closed

	var theform=this.contentDoc.forms[0] //Access first form inside iframe just for your reference

	var theemail=this.contentDoc.getElementById("emailfield") //Access form field with id="emailfield" inside iframe

	if (theemail.value.indexOf("@")==-1){ //crude check for invalid email

		alert("Please enter a valid email address")

		return false //cancel closing of modal window

	}

	else{ //else if this is a valid email

		document.getElementById("youremail").innerHTML=theemail.value //Assign the email to a span on the page

		return true //allow closing of window

	}

}

} //End "opennewsletter" function



function opennewsletter4(){

	emailwindow=dhtmlmodal.open('EmailBox', 'iframe', 'http://www.hylandmadrid.com/area-usuarios/index.php', 'Secure Area - Hyland Language Centre', 'width=650px,height=500px,center=1,resize=0,scrolling=1')



emailwindow.onclose=function(){ //Define custom code to run when window is closed

	var theform=this.contentDoc.forms[0] //Access first form inside iframe just for your reference

	var theemail=this.contentDoc.getElementById("emailfield") //Access form field with id="emailfield" inside iframe

	if (theemail.value.indexOf("@")==-1){ //crude check for invalid email

		alert("Please enter a valid email address")

		return false //cancel closing of modal window

	}

	else{ //else if this is a valid email

		document.getElementById("youremail").innerHTML=theemail.value //Assign the email to a span on the page

		return true //allow closing of window

	}

}

} //End "opennewsletter" function



function opennewsletter5(){

	emailwindow=dhtmlmodal.open('EmailBox', 'iframe', 'http://www.hylandmadrid.com/e-lesson/index.php', 'E-Lessons - Hyland Language Centre', 'width=650px,height=500px,center=1,resize=0,scrolling=1')



emailwindow.onclose=function(){ //Define custom code to run when window is closed

	var theform=this.contentDoc.forms[0] //Access first form inside iframe just for your reference

	var theemail=this.contentDoc.getElementById("emailfield") //Access form field with id="emailfield" inside iframe

	if (theemail.value.indexOf("@")==-1){ //crude check for invalid email

		alert("Please enter a valid email address")

		return false //cancel closing of modal window

	}

	else{ //else if this is a valid email

		document.getElementById("youremail").innerHTML=theemail.value //Assign the email to a span on the page

		return true //allow closing of window

	}

}

} //End "opennewsletter" function


function opennewsletter6(){

	emailwindow=dhtmlmodal.open('EmailBox', 'iframe', 'http://www.hylandmadrid.com/christmas/index.php', 'Concurso de Christmas 2011 - Hyland Language Centre', 'width=650px,height=650px,center=1,resize=0,scrolling=1')



emailwindow.onclose=function(){ //Define custom code to run when window is closed

	var theform=this.contentDoc.forms[0] //Access first form inside iframe just for your reference

	var theemail=this.contentDoc.getElementById("emailfield") //Access form field with id="emailfield" inside iframe

	if (theemail.value.indexOf("@")==-1){ //crude check for invalid email

		alert("Please enter a valid email address")

		return false //cancel closing of modal window

	}

	else{ //else if this is a valid email

		document.getElementById("youremail").innerHTML=theemail.value //Assign the email to a span on the page

		return true //allow closing of window

	}

}

} //End "opennewsletter" function

function opennewsletter7(){

	emailwindow=dhtmlmodal.open('EmailBox', 'iframe', 'http://www.hylandmadrid.com/cursos-extranjero/catalogo2012.html', 'Catalogos Cursos Extranjero 2012', 'width=650px,height=650px,center=1,resize=0,scrolling=1')



emailwindow.onclose=function(){ //Define custom code to run when window is closed

	var theform=this.contentDoc.forms[0] //Access first form inside iframe just for your reference

	var theemail=this.contentDoc.getElementById("emailfield") //Access form field with id="emailfield" inside iframe

	if (theemail.value.indexOf("@")==-1){ //crude check for invalid email

		alert("Please enter a valid email address")

		return false //cancel closing of modal window

	}

	else{ //else if this is a valid email

		document.getElementById("youremail").innerHTML=theemail.value //Assign the email to a span on the page

		return true //allow closing of window

	}

}

} //End "opennewsletter" function

