
$j = jQuery.noConflict();
$j(document).ready(function() {

    //Are cookies enabled?
    if ($j.cookies.test()) {
        //check for the cookie
        // if cookie exists, show modal, if not don't show modal
        var optionhide = $j.cookies.get('Offer');
        if (optionhide != 'True') {
            ShowModal();
        }
    }
    //Cookies not enabled, show the modal always
    else {
        ShowModal();
    }  

});

function ShowModal() {
	$j('#basic-modal-content').modal();

	$j('div.simplemodal-wrap').click(
    function () {
        window.location = $j('#basic-modal-content').attr("url");
        return false;
    });

    var newOptions = {
        hoursToLive: 168
    }
    $j.cookies.setOptions(newOptions);
    $j.cookies.set('Offer', 'True');
}
