var httpsArray = new Array();
httpsArray[0] = "/events/guestinfo.aspx";
httpsArray[1] = "/events/payment.aspx";
httpsArray[2] = "/events/confirmation.aspx";
httpsArray[3] = "/gift_cards/guestinfo.aspx";
httpsArray[4] = "/gift_cards/payment.aspx";
httpsArray[5] = "/gift_cards/confirmation.aspx";
var loc = window.location.href;
var desiredProtocol = "http:";
for (var i in httpsArray) {
    if (loc.indexOf(httpsArray[i]) > 0)
        desiredProtocol = "https:";
}
//alert(window.location.port);
if (window.location.protocol != desiredProtocol && window.location.port == '')
    window.location.href = desiredProtocol + loc.substring(loc.indexOf(":") + 1, loc.length);

function ImgError(source) {
    source.src = "/images/spacer.gif";
    source.onerror = "";
    return true;
}
