﻿
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 PasswordReminder() {
	window.open("http://www.ScreenClick.com/Passwordreminder.aspx","title","width=400,height=170,left=20,top=100,buttons=no,location=no,menubar=no,resizable=no,scrollbars=no,status=no,directories=no,toolbar=no");
}

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(); 
}

//var OldId = null;

function ShowTerms() {
	window.open('http://AnPost.Screenclick.com/1/AnPost/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 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;
    }
}