// Initialize the Scripts for this site.

$(document).ready(function() {

	// Opens up Smart Solutions in new window.
	$('.lnkBlank').click(function() {
		window.open($(this).attr('href'), 'newWindow', '');
		return false;
	});

    $('input[type=text].clearText').each(function() {
        $(this).css({'color':'#929292'});
        var txtSearchText = $(this).val();
        $(this).focus(function() {
            if ($(this).val() == txtSearchText) {
                $(this).val('');
                $(this).css({'color':'#153678'});
            }
        });
        $(this).blur(function() {
            if ($(this).val() == '') {
                $(this).val(txtSearchText);
                $(this).css({'color':'#929292'});
            }
        });
        
        if ($(this).hasClass('validate')) {
            $(this).parent().parent().submit(function() {
                //alert($(this).find('input[type=text]').val()+'|'+txtSearchText);
                if ($(this).find('input[type=text]').val() == txtSearchText) {
                    alert('Please enter a valid search term')
                    return false;
                }
            });
        }
    
    });

	// Hides list item images if no src is defined:
	$('img.listItemImage').each(function() {
		if ($(this).attr('src') == '') {
			$(this).hide();
		}
	});

	$('#rightBox').append('<img src="/right-col-footer.png" width="202" height="14" alt="" id="bottom" />');

});
