﻿function GotoExSite(ex) {
    window.open(ex);
}
function myObj(tagID) { return document.getElementById(tagID); }

function testNumeric(whichObj) {
    // first trim the field
    whichObj.value = whichObj.value.replace(/(^\s*)|(\s*$)/g, "");

    // check if the input is at all numeric
    if (isNaN(whichObj.value) == true) { return false }

    // check if the numeric is non-negative
    if ((whichObj.value) <= 0) { return false }

    // if only integers are expected, round the value
    whichObj.value = Math.round(whichObj.value)

    // all OK return true
    return true
}

function chkField(whichObj) {
    if (testNumeric(whichObj) == false) {
        whichObj.focus();
        whichObj.style.background = "red";
        whichObj.value = "";
        alert("Lütfen İlgili alana Sayı (Rakkam) giriniz!")
        //myObj("messageDiv").innerHTML = "Please enter a valid quantity!";
    }
    else {
        whichObj.style.background = "";
    }
}
