﻿jQuery(document).ready(function() {
    /*
    jQuery(".sbComment").click(function(e) {
        e.preventDefault();
        var num = jQuery(this).attr('id');
        jQuery('#ctl00_cntMiddleCol_lblSharkBiteId').val(num);
        showModal();
    });
    */
    jQuery("#registerLearnMore").click(function(e) {
        e.preventDefault();
        showModalRegisterLearnMore();
    });

    jQuery("#mask").click(function() {
        hideModal();
        hideModalRegisterLearnMore();
    });
    
    jQuery("#closeBox").click(function() {
        hideModal();
        hideModalRegisterLearnMore();
    });
});


function procedureClick(id) {
    jQuery('#ifrSharkBite').attr('src', '/SharkBiteComment.aspx?id=' + id);
    showModal();
    return false;
}


function getSharkBiteId() {
    return jQuery('#ctl00_cntMiddleCol_lblSharkBiteId').val();
}
        

function iFrameLoad() {
    _ifrSharkBite = document.getElementById('ifrSharkBite');
    var sbID = _ifrSharkBite.contentWindow.document.getElementById('lblSharkBiteId');
    sbID.value = jQuery('#ctl00_cntMiddleCol_lblSharkBiteId').val();
}


function showModal() {
    var maskHeight = jQuery(document).height();
    var maskWidth = jQuery(document).width();

    jQuery('#mask').css({ 'width': maskWidth, 'height': maskHeight });
    jQuery('#mask').css('filter', 'alpha(opacity=50)');
    jQuery('#mask').fadeIn(500);

    var winH = jQuery(window).height();
    var winW = jQuery(window).width();

    jQuery('#popup_Container').css('top', winH / 2 - jQuery('#popup_Container').height() / 2 + jQuery(window).scrollTop());
    jQuery('#popup_Container').css('left', winW / 2 - jQuery('#popup_Container').width() / 2);

    jQuery('#popup_Container').fadeIn(500);
}


function showModalRegisterLearnMore() {
    var maskHeight = jQuery(document).height();
    var maskWidth = jQuery(document).width();

    jQuery('#mask').css({ 'width': maskWidth, 'height': maskHeight });
    jQuery('#mask').css('filter', 'alpha(opacity=50)');
    jQuery('#mask').fadeIn(500);

    var winH = jQuery(window).height();
    var winW = jQuery(window).width();

    jQuery('#popup_Container').css('top', winH / 2 - jQuery('#popup_Container').height() / 2 + jQuery(window).scrollTop());
    jQuery('#popup_Container').css('left', winW / 2 - jQuery('#popup_Container').width() / 2);

    jQuery('#popup_Container').fadeIn(500);
}



function hideModal() {
    jQuery('#ifrSharkBite').attr('src', '');
    jQuery('#mask').hide();
    jQuery('#popup_Container').hide();
}


function hideModalRegisterLearnMore() {
    jQuery('#mask').hide();
    jQuery('#popup_Container').hide();
}
