/**
 * AffiliateID.js
 */
var userAfflID = "USRAFF";

/**
 * Returns AffiliateID if present in Url
 *
 * @use <script type="text/javascript">document.write(getAffiliateID());</script>
 * @use <script type=\"text/javascript\">document.write(getAffiliateID());</script>
 * @not typeof(affID) !== 'undefined'
 */
function getAffiliateID()
{
    var affID   = '';
    var uriText = String(document.location);

    affID = getCookie(userAfflID);
    if (affID != null && affID.length != 0) {
        return '(' + affID + ')';
    }

    affID = uriText.match(/a_aid=([^&;]+)/i);
    if (affID != null && affID.length != 0) {
        setCookie(userAfflID, affID[1],  afflExpire, userPathID, userDomain, userSecure);
        return '(' + affID[1] + ')';
    }

	// affID IS EMPTY
    return '';
}

getAffiliateID();

/* -- END -- */
