	$(document).ready(function(){
    // Required for IE PNG transparency fix.
    $(document).pngFix();
    // When the search box is clicked, clear it
    $('#q').focus(function(){
        $(this).val("");
    });
    // jQuery hover for the quicklinks section
    $('div.quicklinks ul li').hover(
        function () {
            $(this).addClass('hover');
        },
        function () {
            $(this).removeClass('hover');
        }
        ).click(function(){
			location.href = $(this).find("a:first").attr("href");
			});
    //Make certain div's clickable
    $(".clickable").css({
        "cursor" : "pointer"
    }).click(function () {
        document.location.href = $(this).attr("title");
    });
	
    // Terms conditions click handler function
    $('.tc').bind("click", function(){
        $(this).next("div").slideToggle("fast");
    }).next("div").hide();
	
    // Expandable questions
    var cssOff = {
        "font-weight":"normal"
    };
    var cssOn = {
        "font-weight":"bold"
    };
    $('.expandable-question').next("div").hide();
    $('.expandable-question').bind("click", function(){
        if($(this).next("div").is(":visible")){
            $(this).next("div").slideUp("fast");
            $(this).css(cssOff);
        } else {
            $('.expandable-question').css(cssOff).next("div").hide();
            $(this).css(cssOn).next("div").slideDown("fast");
        }
    });
	$('input[type="radio"],input[type="checkbox"]').css({"border":"0","padding":"0"})
})
function activate(id){
    $('#'+id).addClass("active");
}
function getQuerystring(key, default_)
{
  if (default_==null) default_="";
  key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regex = new RegExp("[\\?&]"+key+"=([^&#]*)");
  var qs = regex.exec(window.location.href);
  if(qs == null)
    return default_;
  else
    return qs[1];
}
function changeBg(){
	return;
}
function openCoverageWin(){
	var w = 820;
	var h = 500;
    var l = parseInt((screen.availWidth/2) - (w/2));
    var t = parseInt((screen.availHeight/2) - (h/2));
	var fe = "width=" + w + ",height=" + h + ",status,scrollbars=auto,resizable,left=" + l + ",top=" + t + "screenX=" + l + ",screenY=" + t;
	var g = window.open('http://bing.bizmaps.ie/threeireland/Pages/Public/CoveragePublicPage.aspx','coverageWin',fe);
	g.focus();
}
function openNBSCoverageWin(){
	var w = 754;
	var h = 433;
    var l = parseInt((screen.availWidth/2) - (w/2));
    var t = parseInt((screen.availHeight/2) - (h/2));
	var fe = "width=" + w + ",height=" + h + ",status,scrollbars=auto,resizable,left=" + l + ",top=" + t + "screenX=" + l + ",screenY=" + t;
	var g = window.open('http://bing.bizmaps.ie/threeireland/Pages/Public/NBSPublicPage.aspx','coverageNBSWin',fe);
	g.focus();
}