/*
 * Copyright (c) 2008-2009 HD Greetings (http://www.hdgreetings.com)
 */

function IgnoreEnterKey() {
    return !(window.event && window.event.keyCode == 13);
}

// Track character count for user message areas
function countChar(input, maxlength) {
    var counter = $('#' + input.id + 'LengthCounter');
    counter.val(input.value.length);

    var validator = $('#' + input.id + 'LengthValidator');
    if (input.value.length > maxlength)
        validator.css('visibility', 'visible');
    else
        validator.css('visibility', 'hidden');
}

function ImageAreaNormalized(
        fullImageWidth,
        fullImageHeight, 
        pixelsX,
        pixelsY,
        pixelsWidth,
        pixelsHeight) 
{
    this.fullImageWidth = fullImageWidth;
    this.fullImageHeight = fullImageHeight;
    this.pixelsX = pixelsX;
    this.pixelsY = pixelsY;
    this.pixelsWidth = pixelsWidth;
    this.pixelsHeight = pixelsHeight;

    this.normalizedX = pixelsX / fullImageWidth;
    this.normalizedY = pixelsY / fullImageHeight;
    this.normalizedWidth = pixelsWidth / fullImageWidth;
    this.normalizedHeight = pixelsHeight / fullImageHeight;
}

