﻿
var refund = 'There are no goods transferred and therefore there is no return policy.  However, if the insurance policy is cancelled prior to the expiration date, any unearned premium will be refunded in accordance with the terms and conditions of the policy.';
var delivery = 'Payment of premium due on an insurance policy does not result in the exchange of any goods and therefore there is nothing to be delivered.  Documents relating to the issuance or continuance of the policy will normally be sent through the US Postal Service.';
var layerName = 'lblMessage';
var prevImg = null;
var time = null;
var wait = false;

function showLayer(type) {
    var val = null;
    
    switch(type) {
        case 'refund':
            val = refund;
            break;
        case 'delivery':
            val = delivery;
    }
    
    if(val != null) {
        if(document.getElementById(layerName) != null) {
            if(document.all) {
                document.all[layerName].innerHTML = val;
                document.all[layerName].style.visibility = 'visible';
            }
            else {
                document.layers[layerName].innerHTML = val;
                document.layers[layerName].visibility = 'show';
            }
        }
    }
}

function hideLayer() {
    if(document.getElementById(layerName) != null) {
        if(document.all) {
            document.all[layerName].innerHTML = '';
            document.all[layerName].style.visibility = 'hidden';
        }
        else {
            document.layers[layerName].innerHTML = '';
            document.layers[layerName].visibility = 'hidden';
        }
    }
}

function policyInfoOver(typeVal) {
    var small = document.getElementById('img' + typeVal + 'Small');
    var full = document.getElementById('div' + typeVal + 'Full');

    if(small == null || full == null)
        return false;

    if(time != null) {
        window.clearTimeout(time);
        time = null;
    }
    
    if(prevImg != typeVal) {        
        if(!wait) {
            wait = true;
            
            if(prevImg != null) {
                var prevFull = document.getElementById('div' + prevImg + 'Full');
                new Effect.BlindUp(prevFull, {duration:0.5});
            }

            new Effect.BlindDown(full, {duration:0.5});
            prevImg = typeVal;
            
            window.setTimeout('wait = false;', 400);
        }
    }
}

function policyInfoOut(typeVal) {
    time = window.setTimeout('document.getElementById("div' + typeVal + 'Full").style.display = "none"; ', 2500);
}

/*function removeViewstateDiv() {
    var viewState = document.getElementById('__VIEWSTATE');
    
    if(viewState != null) {
        var parentDiv = viewState.parentNode;
        
        if(parentDiv != null && parentDiv.nodeName == 'DIV') {
            if(parentDiv.id.length == 0 && parentDiv.childNodes.length < 3) {
                parentDiv.style.display = 'none';
                parentDiv.style.margin = '0';
                parentDiv.style.padding = '0';alert('wtf');
                }
        }
    }
}

window.onload = removeViewstateDiv;*/
