

var _g_eceDefCookieName = "_eceCartv2_" + "6888";
var _g_eceDefCookieMax = 5; 
var _g_eceDefCookieSizeMax = 4000; 
var _g_eceDefExpDate = new Date();
_g_eceDefExpDate.setTime(new Date().getTime() + (2 * 24 * 60 * 60 * 1000));

function _eceGetSubDomain()
{
    if (document.getElementById && location && location.hostname)
    {
        var _eceUseDomain = location.hostname.toLowerCase();
        var _eceUseDomainArray = _eceUseDomain.split(".");

        if (_eceUseDomainArray.length >= 2)
        {
            if (_eceUseDomainArray[_eceUseDomainArray.length - 1].length >= 2)
            {
                if (isNaN(_eceUseDomainArray[_eceUseDomainArray.length - 1]))
                {
			var _eceTmpDomainStr = _eceUseDomainArray[_eceUseDomainArray.length - 2] + "." + _eceUseDomainArray[_eceUseDomainArray.length - 1];
					
			if ((_eceUseDomainArray[_eceUseDomainArray.length - 2].length <= 2 || _eceUseDomainArray[_eceUseDomainArray.length - 2] == "com") && _eceUseDomainArray.length > 2)
				_eceTmpDomainStr = _eceUseDomainArray[_eceUseDomainArray.length - 3] + "." + _eceTmpDomainStr;
						
			return ("; domain=." + _eceTmpDomainStr);

                    	//return ("; domain=." + _eceUseDomainArray[_eceUseDomainArray.length - 2] + "." + _eceUseDomainArray[_eceUseDomainArray.length - 1]);
                }
            }
        }
    }
    
    return "";
}

function _eceGetCookie (cookieName)
{
    var retStr = "";
    if (document.cookie)
    {
        if (!cookieName)
            cookieName = _g_eceDefCookieName;
            
        var cookieArray = document.cookie.split(";")
        var nCount = 0;

        for (var n = 0; n < cookieArray.length; n++)
        {
            while(cookieArray[n].charAt(0) == ' '){cookieArray[n] = cookieArray[n].substring(1)}
            if (cookieArray[n].indexOf(cookieName) == 0)
            {
                retStr += cookieArray[n].substring(cookieName.length+1 + (nCount > 0 ? 1 : 0));
                nCount++;
            }
        }
    }

    return retStr;
}


function _eceWriteCookie (cookieValue, cookieName)
{

    if (cookieValue.length > (_g_eceDefCookieMax * _g_eceDefCookieSizeMax))
    {
        alert("Maximum cart size exceeded.");
        return "";
    }

    if (!cookieName)
            cookieName = _g_eceDefCookieName;
            
    _eceResetCart(cookieName);
            
    for (var n = 0; n < _g_eceDefCookieMax; n++)
    {
         if ( cookieValue.length > _g_eceDefCookieSizeMax)
         {
            var setCookie = cookieName + (n > 0 ? n : "") + "=" + cookieValue.substring(0, _g_eceDefCookieSizeMax);
            document.cookie = setCookie + "; expires=" + _g_eceDefExpDate.toGMTString() + "; path=/" + _eceGetSubDomain();
            cookieValue = cookieValue.substring(_g_eceDefCookieSizeMax);
         }
         else
         {
            var setCookie = cookieName + (n > 0 ? n : "") + "=" + cookieValue;
            document.cookie = setCookie + "; expires=" + _g_eceDefExpDate.toGMTString() + "; path=/" + _eceGetSubDomain();
            break;
         }
    }

    return "";
}

function _eceResetCart(cookieName)
{
    if (!cookieName)
            cookieName = _g_eceDefCookieName;
            
    var cookieArray = document.cookie.split(";")
    
    for (var n = 0; n < cookieArray.length; n++)
    {
        while(cookieArray[n].charAt(0) == ' '){cookieArray[n] = cookieArray[n].substring(1)}
        
        for (var x = 0; x < _g_eceDefCookieMax; x++)
        {
            var useCookiename = cookieName + (x > 0 ? x : "") + "=";
            if (cookieArray[n].indexOf(useCookiename) == 0)
                document.cookie = useCookiename + "" + "; expires=-1; path=/" + _eceGetSubDomain();
        }
    }
}


var _g_eceDefCartButton = "http://allbackgroundchecks.safestorefront.com/images/sample_add.jpg";
var _g_eceMerchantID = "6888";
var _g_eceCartButton = "";
var _g_ecePostAddLink = "ViewCart.aspx?m=6888";
var _g_eceDefQtyText = "Quantity:";
var _g_eceImgAltText = 'alt="' + "Add To Cart" + '"';
var _g_eceQtyText = "Quantity:";

if (!_g_eceQtyText)
    _g_eceQtyText = _g_eceDefQtyText;
    
if (_g_eceCartButton)
    _g_eceImgAltText = "";
else
    _g_eceCartButton = _g_eceDefCartButton;
    
function _eceAttributeOptionsStructure(ID, name, priceUnit, price, displayOrder, selected)
{
    this.ID = ID;
    this.name = name;
    this.priceUnit = priceUnit;
    this.price = price;
    this.displayOrder = displayOrder;
    this.selected = selected;
}

function _eceAttributeStructure(name, type, displayOrder, options)
{
    this.name = name;
    this.type = type;
    this.displayOrder = displayOrder;
    this.options = options
}

function _eceProductStructure(ID, name, description, price, shipping, attributesString, attributes)
{
    this.ID = ID;
    this.name = name;
    this.description = description;
    this.price = price;
    this.shipping = shipping;
    this.attributesString = attributesString;
    this.attributes = attributes;
}

function _eceAttributeInputStructure(ID, input)
{
    this.ID = ID;
    this.input = input;
}

var _g_eceProductArray = new Array();

_g_eceProductArray[0] = new _eceProductStructure("140367", "Patriot Act Database Search:  $5.25", "Patriot Act Database Search:<br>  <br>This is the best solution for users who require a more extensive compliance with the USA Patriot Act.  This database includes information from multiple data sources, which include:<br><br>OFAC (Specially Designated Nation's and Blocked Persons List) <br>Interpol <br>Bank of England <br>Most Wanted (this is our own proprietary compilation of various Most Wanted databases) <br>US Australia Consolidated Wanted List <br>Terrorism Knowledge Base <br>HM Treasury Consolidated List <br>FBI <br>ELPS <br>DEA <br>Denied Persons List <br>Defense Debarred Parties List <br>Air Force Fugitives List <br>ATF Most Wanted <br>EU Credit Consolidated List <br>SS Most Wanted List<br> <br>Accordingly, the OIG maintains the List of Excluded Individuals/Entities (LEIE), a database which provides information to the public, healthcare providers, patients and others relating to the parties excluded from participation in the Medicare, Medicaid and all other Federal health care programs. <br><br>The Office of Inspector General, under this Congressional mandate, established a program to exclude individuals and entities affected by these various legal authorities, contained in Sections 1128 and 1156 of the Social Security Act, maintains a list of all currently excluded parties called the List of Excluded Individuals/Entities. <br><br>Basis for exclusion include convictions for program-related fraud, patient abuse, licensing board actions and default on Health Education Assistance Loans. <br><br>The effect of an exclusion (not being able to participate) is: <br>No payment will be made by any Federal health care program for any items or services furnished, ordered, or prescribed by an excluded individual or entity. Federal health care programs include Medicare, Medicaid, and all other plans and programs that provide health benefits funded directly or indirectly by the United States (other than the Federal Employees Health Benefits Plan. <br><br>No program payment will be made for anything that an excluded person furnishes, orders, or prescribes. This payment prohibition applies to the excluded person, anyone who employs or contracts with the excluded person, any hospital or other provider where the excluded person provides services, and anyone else. <br><br>The exclusion applies regardless of who submits the claims and applies to all administrative management services furnished by the excluded person. <br><br>There is a limited exception to exclusions for the provision of certain emergency items or services not provided in a hospital emergency room. See regulations at 42 CFR 1001.1901(c). <br><br>What we need to Process your Report: <br><br>Applicant Release Form:  Required by the Fair Credit Reporting Act(FCRA) and enforced by the Federal Trade Commission(FTC) to Protect Consumers Privacy Rights.  To conduct a Pre-employment or Tenant Screening Reports this Form is mandatory to be in compliance with the FCRA and Federal and State Law.<br><br>You can download the form by copying and pasting the following link into your browser to download and print on 1 Page.<br><br>http://people-checks.com/ApplicantReleaseForm.aspx <br><br>The Form takes an average of 5 - 7 minutes for an Applicant to complete. After completion Fax the Form toll free to 1-877-777-5121 or e-mail to info@people-checks.com. After receipt of the form we will Process and send the Results to your preference of Fax or E-mail in 45 minutes.<br><br>We do not Search Social Security Numbers. Social Security Number are voluntarily given on a signed Applicant Release Form by the Applicant/Subject of the Search.", "$5.25", "$0.00", '', new Array ());



function _eceAddToCart(itemID, itemQty, linkThrough, _ecePostAddLink, formObj, attCounter)
{
    _ecePostAddLink = unescape(_ecePostAddLink);
 
    if (itemQty.length == 0)
    {
        alert("Quantity cannot be empty.");
        return false;
    }
    else if (isNaN(itemQty))
    {
        alert("Quantity must be numeric.");
        return false;
    }
    else if (parseInt(itemQty) < 1)
    {
        alert("Quantity must be greater than 0.");
        return false;
    }
        
    var currentName = _eceGetCookie();
    var newProdArray = new Array()
    var bFound = false;
    var attribArray = new Array();
    
    if (formObj && attCounter)
    {
        for (n = 0; n < formObj.elements.length; n++)
        {
            var baseName = "a" + attCounter + "-";
            if (formObj.elements[n].name.indexOf(baseName) == 0)
            {

                switch(formObj.elements[n].type)
                {
                case "select-one":
                case "select-multiple":
                    for (var x = 0; x < formObj.elements[n].options.length; x++)
                    {
                        if (formObj.elements[n].options[x].selected)
                            attribArray[attribArray.length] = formObj.elements[n].options[x].value;
                    }
                    
                    break;
                case "radio":
                case "checkbox":
                    if (formObj.elements[n].checked)
                        attribArray[attribArray.length] = formObj.elements[n].value;
                    break;
                    
                case "text":
                case "textarea":
                    if (formObj.elements[n].value.replace(/\s/g, "").length > 0)
                    {
                        var name = formObj.elements[n].name.split("-");
                        if (name.length == 3)
                            attribArray[attribArray.length] = name[2] + "=" + escape(formObj.elements[n].value);
                    }
                    break;
                }
            }
        }
        
    }
    
    if(currentName.length > 0)
    {
        var prodArray = currentName.split(",")
        for (var n = 0; n < prodArray.length; n++)
        {
            var inputsMatch = true;
            var localFound = false;
            var item = prodArray[n].split(":")
            if (item.length == 2)
                item[2] = "";
            if (item.length == 3)
            {
                if (item[0] == itemID && item[2] == attribArray.join("&"))
                {
                    var newQty = parseInt(item[1]) + parseInt(itemQty)
                    newProdArray[newProdArray.length] = item[0] + ":" + newQty + ":" + item[2];
                    bFound = true;
                }
                else if (item[0] != 'm')
                    newProdArray[newProdArray.length] = item[0] + ":" + item[1] + ":" + item[2];
            }
        }
    }
    
    if (!bFound)
    {
        newProdArray[newProdArray.length] = itemID + ":" + itemQty + ":" + attribArray.join("&");
    }
    
    var cookie = newProdArray.join(",");
    _eceWriteCookie (cookie);
    
    //    if (document.getElementById && !_ecePostAddLink)
    //        linkThrough = false;
            
    var postAddLink = (_ecePostAddLink ? _ecePostAddLink : location.href);
        
    if (linkThrough)
        location.href = postAddLink;
    else
    {
        if (typeof(this._eceDisplayMiniCart) != 'undefined')
        {
            if (typeof(this._eceDisplayMiniCart) == 'function')
                _eceDisplayMiniCart(true);
        }
    }
}


function _eceWriteProduct(useQty, useProductInfo)
{
    var _ecePostAddLink = escape(_g_ecePostAddLink);
    
    for (var n = 0; n < _g_eceProductArray.length; n++)
    {
        document.writeln('<form method="post" name="_eceAddToCartForm' + _g_eceProductArray[n].ID + '" action="'+location.href+'" onsubmit="_eceAddToCart('+_g_eceProductArray[n].ID+', this.quantity.value, true, \''+_ecePostAddLink+'\', this, ' + (n+1) + ');return(false)">');
        document.writeln('<table cellpadding="3" cellspacing="3">');
        
        if (useProductInfo)
        {
 
            document.writeln('<tr><td align="right">' + 
                            _g_eceProductArray[n].name +
                            '</td></tr><tr><td align="right">' +
                            _g_eceProductArray[n].price +
                            '</td></tr>');
                         
 


        }
        
        document.writeln('<tr><td align="right">' +
                            _g_eceProductArray[n].attributesString +
                            '</td></tr>');
        
        if (useQty)
        {
            document.write('<tr><td align="right">');

            document.write('<b>'+_g_eceQtyText+' </b><input type="text" name="quantity" value="1" maxlength="4" size="4" />' +
                                '</td></tr><tr><td align="right"><input type="image" src="'+_g_eceCartButton+'" border="0"  '+_g_eceImgAltText+'/>');
 
   
            document.write('</td></tr>');         
        }
        else              
        {
            document.write('<tr><td align="right"><input type="image" src="'+_g_eceCartButton+'" border="0"  '+_g_eceImgAltText+'/>' + 
                            '<input type="hidden" name="quantity" value="1" /></td></tr>');
                          
        }
    
        document.writeln('</table>');
        
        document.writeln('</form>');
    }
}


