﻿function displayAlert(errorMsgs) {
    alert(errorMsgs);
}
function limitText(limitField, limitCount, limitNum) {
    if (limitField.value.length > limitNum) {
        limitField.value = limitField.value.substring(0, limitNum);
    } else {
        limitCount.value = limitNum - limitField.value.length;
    }
}
function hideAlert(controlId) {
    var alertControl = document.getElementById(controlId);

    if (alertControl)
        alertControl.style.display = "none";
}
function setupSocialBookmarkLink(type) {
    if (type == 'google') {
        window.open('http://www.google.com/bookmarks/mark?op=add&bkmk=' + document.URL + '&title=' + document.title, '', '');
    }
    else if (type == 'stumbleupon') {
        window.open('http://www.stumbleupon.com/submit?url=' + document.URL + '&title=' + document.title, '', '');
    }
    else if (type == 'digg') {
        window.open('http://digg.com/submit?url=' + document.URL + '&title=' + document.title, '', '');
    }
    else if (type == 'delicious') {
        window.open('http://delicious.com/save?url=' + document.URL + '&title=' + document.title, '', '');
    }
}

var Browser = {
  Version: function() {
    var version = 999; // we assume a sane browser
    if (navigator.appVersion.indexOf("MSIE") != -1)
      // bah, IE again, lets downgrade version number
      version = parseFloat(navigator.appVersion.split("MSIE")[1]);
    return version;
  }
}
if(Browser.Version() < 7){
	displayAlert('This site is best viewed in Internet Explorer 7 or newer.\n Please consider upgrading your browser.');
}

