﻿
function validateCounty() {
    var county;
    county = document.getElementById("ctl00_ContentPlaceHolder1_cboCounty").value;
    if (county == 'Dublin') {
        document.getElementById("ctl00_ContentPlaceHolder1_txtPostCode").style.visibility = 'visible';
    }
    else {
        document.getElementById("ctl00_ContentPlaceHolder1_txtPostCode").style.visibility = 'hidden';
    }
}

function DoAgree() {
	var oElem = document.getElementById("IAgree");
	if (oElem.checked!=true)
	{
		alert("To activate your account you must agree to abide by the terms and conditions");
		return false;
	}
	document.aspnetForm.submit(); 
}

function DoAgreeGoPay() {
	var oElem = document.getElementById("IAgreeGoPay");
	if (oElem.checked!=true)
	{
		alert("To activate your account you must agree to abide by the terms and conditions");
		return false;
	}
	document.aspnetForm.submit(); 
}

//var OldId = null;

function ShowTerms() {
	window.open('RegistrationTerms.aspx', 'terms', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,left=20,top=20,width=585,height=580');
}

function ConfirmMsg(Msg){
	var agree=confirm(Msg);
	if (agree){
		return true ;
	}
	else{
		return false ;
	}
}

function forceClick(e, elemId) {
    var elem = document.getElementById(elemId);
    var evt = (e) ? e : window.event;
    var intKey = (evt.which) ? evt.which : evt.keyCode;

    if(intKey == 13) {
        elem.click();
        return false;
    }
    return true;
}


function ValidateSurvey() {
    var elem1 = document.getElementsByName("ctl00$ContentPlaceHolder1$radAnswers");
    var i = elem1.length
    var found_it = 0

    for (var x = 0; x <= (i - 1); x++) {
        if (elem1[x].checked) {
            found_it = 1
        }
    }

    if (found_it == 0) {
        var modalPopupBehavior = $find('programmaticModalPopupBehavior4');
        modalPopupBehavior.show();
        found_it = 0
        return false;
    }
}