﻿function selectAll(className) {
    $("." + className + " input").each(function() {
        $(this).attr('checked', true);
        
    });
}
function selectNone(className) {
    $("." + className + " input").each(function() {
        $(this).attr('checked', false);
    });
}

function isNumberKey(evt)
      {
         var charCode = (evt.which) ? evt.which : event.keyCode
         if (charCode > 31 && (charCode < 48 || charCode > 57))
            return false;

         return true;
      }

function WishToProceed(url)
{
    var con = confirm("To proceed please press OK.");
    if (con)
    {
        window.location.href = url;
    }
    else
    {
        return false;
    }
}

function isCharacterKey(evt)
{
    var charCode = (evt.which) ? evt.which : event.keyCode
    if ((charCode >= 65) && (charCode <= 90))
    {
        return true;
    }
    if ((charCode >= 97) && (charCode <= 122))
    {
        return true;
    }
    return false;

   }

   $(document).ready(function() {



   	$("a").each(function() {
   		var ihref = $(this).attr("href");

   		if (!$(this).hasClass("linkJSOverride")) {
   			if ($(this).attr("href")) {
   				if ($(this).attr("href").substring(0, 1) == "/") {
   					//this is an internal link
   					$(this).removeAttr("target");
   				}

   				if ($(this).attr("href").substring(0, 4).toLowerCase() == "http") {
   					if ($(this).attr("href").toLowerCase().indexOf(window.location.host.toLowerCase()) == -1) {
   						$(this).attr("target", "_new");
   					}

   				}
   			}
   		}
   	});

   });