﻿// v1.0 created by Activepixels 30 Aug 09

$(document).ready(function() {
	setTimeout(initOverLabels, 50);
	//apply link classes to body area
	$('.pagecopyarea a').addClass('link');
});

// v1.0 created by Activepixels 30 May 08
// CompactAccessibleForms adapted from AListApart to use jQuery library

function initOverLabels() {
    $('.overlabel').each(
        function() {
            var t = $(this);
            var l = $('#' + $(this).attr('for'));
            $(t).addClass('overlabel-apply');
            if ($(l).val() !== '') {
                $(t).css("textIndent", "-2000px");
            }
            $(l).bind("focus", function(e) {
                $(t).css("textIndent", "-2000px");
            });
            $(l).bind("blur", function(e) {
                if ($(l).val() == '') {
                    $(t).css("textIndent", "0px");
                }
            });
            // Handle clicks to label elements (for Safari).
            $(t).bind("click", function(e) {
                $(l).focus();
            });
        }
    )
}