ROC_strTopStart = -222;
// ie? use faster settings...
var ROC_isIe = !!window.ActiveXObject;
if (ROC_isIe) {
ROC_strMoveBy = 20;
ROC_strMoveInt = 3;
} else {
ROC_strMoveBy = 4;
ROC_strMoveInt = 2;
}
// Drop cart cart from top...
function ROC_fnDropCart() {
if (document.getElementById("ROC_dropcart")==null) {
alert('Please wait until the page has loaded then try again.');
return false();
}
ROC_fnDropCartOpen();
return true;
}
function ROC_fnDropCartOpen() {
ROC_dCMoveThis = document.getElementById("ROC_dropCart");
var ROC_dCTopPos = ROC_strTopStart;
if (ROC_dCMoveThis.offsetTop < ROC_strTopStart) {;
var ROC_dCArrows = document.getElementById("ROC_dCArrows");
ROC_dCArrows.innerHTML = "
▲
";
function ROC_dCDropDown() {
ROC_dCTopPos = (ROC_dCTopPos + ROC_strMoveBy);
ROC_dCMoveThis.style.top = ROC_dCTopPos + 'px';
if (ROC_dCTopPos == -2)
clearInterval(ROC_dCID);
}
var ROC_dCID = setInterval(ROC_dCDropDown, ROC_strMoveInt);
}
}
// Return cart to top...
function ROC_fnDropCartClose() {
ROC_dCMoveThis = document.getElementById("ROC_dropCart");
var ROC_dCTopPos = -2;
var ROC_dCArrows = document.getElementById("ROC_dCArrows");
ROC_dCArrows.innerHTML = "▼
";
function ROC_dCRiseUp() {
ROC_dCTopPos = (ROC_dCTopPos - ROC_strMoveBy);
ROC_dCMoveThis.style.top = ROC_dCTopPos + 'px';
if (ROC_dCTopPos == -222)
clearInterval(ROC_dCID);
}
var ROC_dCID = setInterval(ROC_dCRiseUp, ROC_strMoveInt);
}
var ROC_dropcart = document.getElementById("ROC_dropcart");
if (window.location.protocol != "https:")
{
ROC_dropcart.innerHTML = "";
} else {
ROC_dropcart.innerHTML = "";
}
// Receive the iframe's encrypted session token (fwx) and stamp it onto the
// Checkout link so the top-level cart.asp navigation reuses the same basket.
// This avoids the third-party-cookie / fingerprint mismatch that otherwise
// produced an empty cart on checkout.
(function(){
function ROC_fnDCApplyFwx(fwx){
var a = document.querySelector("#ROC_dropCart .ROC_dCChk");
if (!a || !fwx) return;
var href = a.href.replace(/([?&])fwx=[^&]*/, "$1").replace(/[?&]$/, "").replace(/&&+/g, "&").replace(/\?&/, "?");
href += (href.indexOf("?") >= 0 ? "&" : "?") + "fwx=" + encodeURIComponent(fwx);
a.href = href;
}
window.addEventListener("message", function(e){
if (!e || !e.data || !e.data.rocDropCartFwx) return;
if (!/^https?:\/\/(www|secure)\.romancart\.com$/i.test(e.origin)) return;
ROC_fnDCApplyFwx(e.data.rocDropCartFwx);
}, false);
})();