function PopWin(url, title, h, w) {
    popupWin = window.open(url, title, 'scrollbars=yes,resizable=yes,height=' + h + ',width=' + w + '');
    popupWin.focus();
}

function writeLogin() {
    var myDomain = document.domain.substring(4);
    switch (true) {
        case myDomain == 'agricultureandfood.co.uk':
            if (document.getElementById('lblUsername')){document.getElementById('lblUsername').innerHTML = 'Username:';};
            if (document.getElementById('lblPassword')){document.getElementById('lblPassword').innerHTML = 'Password:';};
            if (document.getElementById('lblRememberM')){document.getElementById('lblRememberMe').innerHTML = 'Remember me:';};
            if (document.getElementById('phmain_0_phmaincontent_1_btnGo')){document.getElementById('phmain_0_phmaincontent_1_btnGo').value = 'Log in';};
			if (document.getElementById('phmain_0_ctl10_LogoutLinkButton')){document.getElementById('phmain_0_ctl10_LogoutLinkButton').innerHTML = 'Log out';};
            break;
    }
}

<!-- "Hide Email" replacement-script -->
$(function(){
	var at = / at /;
	var dot = / dot /g;
	$('span.mailme').each(function () {
		var addr = $(this).text().replace(at,"@").replace(dot,".");
		$(this).after('<a href="mailto:'+ addr +'">'+ addr +'</a>');
		$(this).remove();
	});
});

function SelectAll(val) {
  var objects = document.getElementsByTagName("input"); //all input objects
  for (i=0; i<objects.length;i++) { //start for loop
    if (objects[i].getAttribute("type")=="checkbox") { objects[i].checked = val; } //checkbox found set its checked attribute
  }
}

$(document).ready(function(){
	$('.FoldOutHeader').click(function() {
		$(this).toggleClass("active").next().toggle();
	});
});
