function textCounter(field, countfield, maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else
countfield.value = maxlimit - field.value.length;
}
function KeepCount4() {

var NewCount4 = 0

if (document.majorskills.is_msblade.checked)
{NewCount4 = NewCount4 + 1}

if (document.majorskills.is_msblunt.checked)
{NewCount4 = NewCount4 + 1}

if (document.majorskills.is_mshand_to_hand.checked)
{NewCount4 = NewCount4 + 1}

if (document.majorskills.is_msarmorer.checked)
{NewCount4 = NewCount4 + 1}

if (document.majorskills.is_msblock.checked)
{NewCount4 = NewCount4 + 1}

if (document.majorskills.is_msheavy_armor.checked)
{NewCount4 = NewCount4 + 1}

if (document.majorskills.is_msathletics.checked)
{NewCount4 = NewCount4 + 1}

if (document.majorskills.is_msacrobatics.checked)
{NewCount4 = NewCount4 + 1}

if (document.majorskills.is_mslight_armor.checked)
{NewCount4 = NewCount4 + 1}

if (document.majorskills.is_mssecurity.checked)
{NewCount4 = NewCount4 + 1}

if (document.majorskills.is_mssneak.checked)
{NewCount4 = NewCount4 + 1}

if (document.majorskills.is_msmarksman.checked)
{NewCount4 = NewCount4 + 1}

if (document.majorskills.is_msmercantile.checked)
{NewCount4 = NewCount4 + 1}

if (document.majorskills.is_msspeechcraft.checked)
{NewCount4 = NewCount4 + 1}

if (document.majorskills.is_msillusion.checked)
{NewCount4 = NewCount4 + 1}

if (document.majorskills.is_msalchemy.checked)
{NewCount4 = NewCount4 + 1}

if (document.majorskills.is_msconjuration.checked)
{NewCount4 = NewCount4 + 1}

if (document.majorskills.is_msmysticism.checked)
{NewCount4 = NewCount4 + 1}

if (document.majorskills.is_msalteration.checked)
{NewCount4 = NewCount4 + 1}

if (document.majorskills.is_msdestruction.checked)
{NewCount4 = NewCount4 + 1}

if (document.majorskills.is_msrestoration.checked)
{NewCount4 = NewCount4 + 1}

if (NewCount4 != 7)
{
alert('Please choose SEVEN (7) Major Skills!')
document.majorskills; return false;
}
}

function KeepCount3() {

var NewCount3 = 0

if (document.majorskills.is_msblade.checked)
{NewCount3 = NewCount3 + 1}

if (document.majorskills.is_msblunt.checked)
{NewCount3 = NewCount3 + 1}

if (document.majorskills.is_mshand_to_hand.checked)
{NewCount3 = NewCount3 + 1}

if (document.majorskills.is_msarmorer.checked)
{NewCount3 = NewCount3 + 1}

if (document.majorskills.is_msblock.checked)
{NewCount3 = NewCount3 + 1}

if (document.majorskills.is_msheavy_armor.checked)
{NewCount3 = NewCount3 + 1}

if (document.majorskills.is_msathletics.checked)
{NewCount3 = NewCount3 + 1}

if (document.majorskills.is_msacrobatics.checked)
{NewCount3 = NewCount3 + 1}

if (document.majorskills.is_mslight_armor.checked)
{NewCount3 = NewCount3 + 1}

if (document.majorskills.is_mssecurity.checked)
{NewCount3 = NewCount3 + 1}

if (document.majorskills.is_mssneak.checked)
{NewCount3 = NewCount3 + 1}

if (document.majorskills.is_msmarksman.checked)
{NewCount3 = NewCount3 + 1}

if (document.majorskills.is_msmercantile.checked)
{NewCount3 = NewCount3 + 1}

if (document.majorskills.is_msspeechcraft.checked)
{NewCount3 = NewCount3 + 1}

if (document.majorskills.is_msillusion.checked)
{NewCount3 = NewCount3 + 1}

if (document.majorskills.is_msalchemy.checked)
{NewCount3 = NewCount3 + 1}

if (document.majorskills.is_msconjuration.checked)
{NewCount3 = NewCount3 + 1}

if (document.majorskills.is_msmysticism.checked)
{NewCount3 = NewCount3 + 1}

if (document.majorskills.is_msalteration.checked)
{NewCount3 = NewCount3 + 1}

if (document.majorskills.is_msdestruction.checked)
{NewCount3 = NewCount3 + 1}

if (document.majorskills.is_msrestoration.checked)
{NewCount3 = NewCount3 + 1}

if (NewCount3 == 8)
{
alert('Please only choose SEVEN (7) Major Skills!')
document.majorskills; return false;
}
}

function KeepCount2() {

var NewCount2 = 0

if (document.attributes.is_att_agility.checked)
{NewCount2 = NewCount2 + 1}

if (document.attributes.is_att_endurance.checked)
{NewCount2 = NewCount2 + 1}

if (document.attributes.is_att_intelligence.checked)
{NewCount2 = NewCount2 + 1}

if (document.attributes.is_att_luck.checked)
{NewCount2 = NewCount2 + 1}

if (document.attributes.is_att_personality.checked)
{NewCount2 = NewCount2 + 1}

if (document.attributes.is_att_speed.checked)
{NewCount2 = NewCount2 + 1}

if (document.attributes.is_att_strength.checked)
{NewCount2 = NewCount2 + 1}

if (document.attributes.is_att_willpower.checked)
{NewCount2 = NewCount2 + 1}

if (NewCount2 != 2)
{
alert('Please choose TWO (2) Favored Attributes!')
document.attributes; return false;
}
}

function KeepCount() {

var NewCount = 0

if (document.attributes.is_att_agility.checked)
{NewCount = NewCount + 1}

if (document.attributes.is_att_endurance.checked)
{NewCount = NewCount + 1}

if (document.attributes.is_att_intelligence.checked)
{NewCount = NewCount + 1}

if (document.attributes.is_att_luck.checked)
{NewCount = NewCount + 1}

if (document.attributes.is_att_personality.checked)
{NewCount = NewCount + 1}

if (document.attributes.is_att_speed.checked)
{NewCount = NewCount + 1}

if (document.attributes.is_att_strength.checked)
{NewCount = NewCount + 1}

if (document.attributes.is_att_willpower.checked)
{NewCount = NewCount + 1}

if (NewCount == 3)
{
alert('Please only choose TWO (2) Favored Attributes!')
document.attributes; return false;
}
}
function activateNotice(n_id)
{
   if (confirm("Are you sure you want to activate this notice?"))
   {
      window.location.href = 'notices.php?activate=' + n_id;
   }
}
function deactivateNotice(n_id)
{
   if (confirm("Are you sure you want to deactivate this notice?"))
   {
      window.location.href = 'notices.php?deactivate=' + n_id;
   }
}
function deleteNotice(n_id)
{
   if (confirm("Are you sure you want to delete this notice?"))
   {
      window.location.href = 'notices.php?delete=' + n_id;
   }
}
function deleteCC(cc_id)
{
   if (confirm("Are you sure you want to delete this custom class?"))
   {
      window.location.href = 'managecc.php?delete=' + cc_id;
   }
}
function deleteC(c_id)
{
   if (confirm("Are you sure you want to delete this character?"))
   {
      window.location.href = '/ucp/managec.php?delete=' + c_id;
   }
}
function deleteKBCat(kbcat_id)
{
   if (confirm("Are you sure you want to delete this category?"))
   {
      window.location.href = './admin.php?deletecat=' + kbcat_id;
   }
}
function deleteKBArticle(kb_id)
{
   if (confirm("Are you sure you want to delete this article?"))
   {
      window.location.href = '/kb/article/manage?deletearticle=' + kb_id;
   }
}
function deleteCPhoto(p_id, c_id)
{
   if (confirm("Are you sure you want to delete this photo?"))
   {
      window.location.href = '/ucp/photos.php?mode=delete&p=' + p_id + '&c=' + c_id;
   }
}