(function($) {
jQuery(document).ready(function() {
	$('#forgotP a').tipsy({gravity: 'e'});
// login button
	//$('#memberLogin').hide();
	$('#headLogin a').toggle(function() {
	$(this).addClass('active');
	$('#memberLogin').slideDown('fast');
	}, function() {
	$(this).removeClass()
	$('#memberLogin').slideUp('fast');
	
	
	});

	

// Add class links
$(document).ready(function() {
	
	 $("a[href*='http://']:not([href*='"+location.hostname+"'])")
    .attr("target","_blank")
    .addClass("external");
	$("a[href$='.pdf']").addClass("pdf").attr("target","_blank");
	$("a[href$='.doc'], a[href$='.DOC']").addClass("ms-word").attr("target","_blank");

 });

// position label inside input box, onfocus and unfocus treatment

jQuery.fn.overlabel = function() {
    this.each(function(index) {
        var label = $(this); var field;
        var id = this.htmlFor || label.attr('for');
        if (id && (field = document.getElementById(id))) {
            var control = $(field);
            label.addClass("overlabel-apply");
            if (field.value !== '') {
                label.css("text-indent", "-1000px");
            }
            control.focus(function () {label.css("text-indent", "-1000px");}).blur(function () {
                if (this.value === '') {
                    label.css("text-indent", "0px");
                }
            });
            label.click(function() {
                var label = $(this); var field;
                var id = this.htmlFor || label.attr('for');
                if (id && (field = document.getElementById(id))) {
                    field.focus();
                }
            });
        }
    });
};
$("label.overlabel").overlabel();

// TECH SUPPORT TABS
var tabContainers = $('div#tech-group > div');
    tabContainers.hide().filter(':first').show();
                        
    $('div#tech-group ul#pager a').click(function () {
        tabContainers.hide();
        tabContainers.filter(this.hash).show();
            $('div#tech-group ul#pager a').removeClass('active');
            $(this).addClass('active');
                return false;
    }).filter(':first').click();        
});


$(document).ready(function() { 
				
var options = { 
	target:    '#alert'
	}; 
	$('#compuform').ajaxForm(options); 
	}); 
										
	$.fn.clearForm = function() {
	return this.each(function() {
		var type = this.type, tag = this.tagName.toLowerCase();
		if (tag == 'form')
			return $(':input',this).clearForm();
		if (type == 'text' || type == 'password' || tag == 'textarea')
			this.value = '';
		else if (type == 'checkbox' || type == 'radio')
			this.checked = false;
		else if (tag == 'select')
			this.selectedIndex = -1;
		});
	};
   
})(jQuery);

