﻿function popLargeCard(argURL)
{
	openWin = window.open(argURL,"myWindow","top=100,left=100,width=700,height=700,buttons=no,scrollbars=yes,location=no,menubar=no,resizable=yes,status=no,directories=no,toolbar=no");
	openWin.focus();
}

function ValidateCount(iMax, otE, otV)
{
	if (otE != null && otV != null)
	{
		var x;
		x = Number(iMax) - otE.value.length;
		if (x < Number(0))
		{
			alert('The maximum number of characters for this field has been reached');
			otE.value = otE.value.substring(0, iMax);
		}
				
		otV.value = Number(iMax) - otE.value.length;
	}
}

function ConfirmSampleRequest()
{
    return confirm("NOTICE:  All sample cards will have a large ink “SAMPLE” stamped on them and do not include envelopes.\n\n"
      + "Samples are provided to demonstrate the quality of the product and are NOT USABLE.\n\n"
      + "If more than 3 items are requested, only the first three will be sent.  Please call our customer support team to make special arrangements for larger orders.");
}

function SetCookie(name, value, expires)
{
    // set time, it's in milliseconds
    var today = new Date();
    today.setTime(today.getTime());

    /*
    if the expires variable is set, make the correct 
    expires time, the current script below will set 
    it for x number of days, to make it for hours, 
    delete * 24, for minutes, delete * 60 * 24
    */
    if (expires)
    {
        expires = expires * 1000 * 60 * 60 * 24;
    }
    var expires_date = new Date(today.getTime() + (expires));

    document.cookie = name + "=" + escape(value)
                           + ((expires) ? ";expires=" + expires_date.toGMTString() : "");
}

function SetCharityCookie(value, expires)
{
    if (document.cookie.indexOf("EmployeeMode=") != -1) return;
    SetCookie('CharityOrder', value, expires);
}

function popNewWindow(argURL, strW, strH) 
{
	openWin = window.open(argURL,"myWindow","top=100,left=100,width=" + strW + ",height=" + strH + ",buttons=no,scrollbars=no,location=no,menubar=no,resizable=no,status=no,directories=no,toolbar=no");
	openWin.focus();
}

function popNewWindow_(argURL, strW, strH, strButtons, strScrollbars, strLocation, strMenuBar, strResizable, strStatus, strDirectories, strToolbar) 
{
	openWin = window.open(argURL,"myWindow","top=100,left=100,width=" + strW + ",height=" + strH + ",buttons=" + strButtons + ",scrollbars=" + strScrollbars + ",location=" + strLocation + ",menubar=" + strMenuBar + ",resizable=" + strResizable + ",status=" + strStatus + ",directories=" + strDirectories + ",toolbar=" + strToolbar);
	openWin.focus();
}