function quickSubscribe() {
    window.open("http://service.govdelivery.com/service/multi_subscribe.html?code=USGOVBENEFITS_1&login=" + document.govdelivery.email.value + "&origin=" + window.location.href, "_self", 'resizable, width=1000,height=480,scrollbars=yes,left=10,top=10')
}


function subscribeLink(id) {
    window.open("http://service.govdelivery.com/service/subscribe.html?code=USGOVBENEFITS_" + id, "_blank", 'resizable, width=1000,height=480,scrollbars=yes,left=10,top=10')
}


function collapseExpand(strExpand, strCollapse, rowId, buttonId){
	var button = document.getElementById(buttonId);
	var loanDetails = document.getElementById(rowId);
	
	if (loanDetails.className == 'result-list-row'){
		loanDetails.className = 'program-detail-collapsed';
		button.className = "program-detail-expand-btn";
		button.firstChild.innerHTML = strExpand;
	}else{
		loanDetails.className = 'result-list-row';
		button.className = "program-detail-collapse-btn";
		button.firstChild.innerHTML = strCollapse;
	}	
}
function validateEmail(lang){
	
	if(lang = 'en'){	
		var basicError = "<span class='error-text'>The following form has error(s). Please correct the items in red and re-submit:</span><br /> <br />";
		var noName = "<span class='error-text'>Please enter Your Name</span><br />";
		var noRecipient = "<span class='error-text'>Please enter Recipient's Email</span><br />";
	}else{
		var basicError = "<span class='error-text'>El siguiente formulario tiene error(es). Por favor, corrija los ítem en rojo y envíelo nuevamente:</span><br /> <br />";
		var noName = "<span class='error-text'>Por favor, ingrese Su Nombre:</span><br />";
		var noRecipient = "<span class='error-text'>Por favor, ingrese Correo Electrónico del Destinatario:</span><br />";
	
	}
	
	
	var boolNoName = false;
	var boolNoRecipient = false;
	
	if(document.getElementById('sender').value == '')
		boolNoName = true;
	if(document.getElementById('recipient').value == '')
		boolNoRecipient = true;
	if(boolNoName == true || boolNoRecipient == true){
	
		if(boolNoName == true)
			basicError = basicError + noName;
		if(boolNoRecipient == true)
			basicError = basicError + noRecipient;
		basicError = basicError + "</br>";
		document.getElementById('validate').innerHTML = basicError;
	}
	else
		document.getElementById('emailFormImpl').submit();
}

function validateEmailPOC(){
	
	var basicError = "<span class='error-text'>The following form has error(s). Please correct the items in red and re-submit:</span><br /> <br />";
	var noName = "<span class='error-text'>Please enter Your Name</span><br />";
	var noRecipient = "<span class='error-text'>Please enter Recipient's Email</span><br />";
	
	var boolNoName = false;
	var boolNoRecipient = false;
	
	if(document.getElementById('sender').value == '')
		boolNoName = true;
	if(boolNoName == true || boolNoRecipient == true){
	
		if(boolNoName == true)
			basicError = basicError + noName;
		if(boolNoRecipient == true)
			basicError = basicError + noRecipient;
		basicError = basicError + "</br>";
		//document.getElementById('validate').innerHTML = basicError;
	}
	else
		document.getElementById('emailFormImpl').submit();
}

function printPage() {
	window.print() ; 
}
