//Site JS file

//JS file for site routines

function RefreshImage(valImageId) {
    var objImage = document.images[valImageId];
    if (objImage == undefined) {
        return;
    }
    var now = new Date();
    objImage.src = objImage.src.split('?')[0] + '?x=' + now.toUTCString();
}

function textCounter(field, countfield, maxlimit, varfield) {
    //alert(varfield);
    if (field.value.length > maxlimit) // if too long...trim it!
        field.value = field.value.substring(0, maxlimit);
    // otherwise, update 'characters left' counter
    else
        countfield = maxlimit - field.value.length;
    document.getElementById('' + varfield + '').innerHTML = countfield
}

//Function for IE and Mac isue with height
var csstype = "inline" //Specify type of CSS to use. "Inline" or "external"
var mac_css = 'body{font-size: 1.055em; }' //if "inline", specify mac css here
var pc_css = 'body{font-size: 12pt; }' //if "inline", specify PC/default css here

///////No need to edit beyond here////////////
var mactest = navigator.userAgent.indexOf("Mac") != -1

if (csstype == "inline") {
    document.write('<style type="text/css">')
    if (mactest)
        document.write(mac_css)
    else
        document.write(pc_css)
    document.write('</style>')
}
