﻿function setCookie(c_name, value, expiredays) {
    var exdate = new Date();
    exdate.setDate(exdate.getDate() + expiredays);
    document.cookie = c_name + "=" + escape(value) +
            ((expiredays == null) ? "" : ";expires=" + exdate.toUTCString());
}
function getCookie(c_name) {
    if (document.cookie.length > 0) {
        c_start = document.cookie.indexOf(c_name + "=");
        if (c_start != -1) {
            c_start = c_start + c_name.length + 1;
            c_end = document.cookie.indexOf(";", c_start);
            if (c_end == -1) c_end = document.cookie.length;
            return unescape(document.cookie.substring(c_start, c_end));
        }
    }
    return "";
}


function checkCookie() {
    Session = getCookie('aSession');
    if (Session != null && Session != "") {
    }
    else {
     
        Session = "aSession";
        if (Session != null && Session != "") {
            setCookie('aSession', "aSession", 1000);
			// don't show the popup if they are on the mobile site
			if (window.location.toString().toLowerCase().indexOf('/mobile') == -1)
			{
				jQuery(document).ready(function() {
					$.fancybox(
				'<a href="/Tell-A-Friend.aspx"><img src="/SusieChristmasModal.png" alt="SusieChristmasModal" border="0" width="617px" height="454px" /></a>',
					{
						'autoDimensions': true,
						'transitionIn': 'none',
						'transitionOut': 'none'
					}
				);
				});
			} // not on mobile
        }
    }
}
