﻿// <script src="../include/jquery.js" type="text/javascript"></script>
// <link href="../include/fancybox/source/jquery.fancybox.css?v=2.0.4" media="screen" rel="stylesheet" type="text/css">
// <script src="../include/fancybox/source/jquery.fancybox.js?v=2.0.4" type="text/javascript"></script>
// <script src="../newPopup/newPopup.js" type="text/javascript"></script>

// <body onload="callBoxFancy()">
//   <div id="hidden_newPopup">
// 		 <div id="newPopup">
// 		 </div>
// 	 </div>

$(document).ready(function() {
    $('#newPopup').fancybox({

        helpers : {
            overlay : {
                opacity : 0.4,
                css : {
                    'background-color' : '#000'
                }
            }
        }

    });
});
function callBoxFancy() {
    if (getCookie("newPopup") == "") {
        setCookie("newPopup", "newPopup", 1);
        document.getElementById('hidden_newPopup').innerHTML = '<a id="newPopup" href="#Popup" rel="group0" title=""></a><div id="Popup"><p class="Centreer"><img alt="" src="../include/newPopup/a001.png"><br><span class="larger Vet">New<br><a href="../software/OfflineOnOffRoad.htm" target="_blank">Offline On/Off-Road Navigation</a><br>Android Phone and Tablet<br>No Maps to buy<br>Free to use, no ads<br></span></p></div>';
        $('#newPopup').trigger('click');
    }
}

function getCookie(c_name) {
    var i,x,y,ARRcookies = document.cookie.split(";");
    for (i = 0; i < ARRcookies.length; i++) {
        x = ARRcookies[i].substr(0, ARRcookies[i].indexOf("="));
        y = ARRcookies[i].substr(ARRcookies[i].indexOf("=") + 1);
        x = x.replace(/^\s+|\s+$/g, "");
        if (x == c_name) {
            return decodeURI(y);
        }
    }
    return "";
}

function setCookie(c_name, value, exdays) {
    var exdate = new Date();
    exdate.setDate(exdate.getDate() + exdays);
    var c_value = decodeURI(value) + ((exdays == null) ? "" : "; expires=" + exdate.toUTCString());
    document.cookie = c_name + "=" + c_value;
}


