$(document).ready(function () { $('.ui-datepicker-trigger').find('img').css('max-width', 'none'); $('#statements-due').addClass($('#statements-due > thead > tr > th').length + '-col'); $('#my-documents').addClass($('#my-documents > thead > tr > th').length + '-col'); $('#previous-statements').addClass($('#previous-statements > thead > tr > th').length + '-col'); if ($('#statements-due > thead > tr > th').length == 6) { $('#statements-due').removeClass('6-col').addClass('6-col-statements'); } if ($('#my-documents > thead > tr > th').length == 6) { $('#my-documents').removeClass('6-col').addClass('6-col-statements'); } if ($('#previous-statements > thead > tr > th').length == 6) { $('#previous-statements').removeClass('6-col').addClass('6-col-statements'); } $('#statements-due-pay').addClass($('#statements-due-pay > thead > tr > th').length + '-col-check'); //MB-8998 - dynamic T&C box height var text = document.getElementById('TermsAndCondition'); if (text != null) { text.style.height = 'auto'; text.style.height = text.scrollHeight + 'px'; } //Allows tables to be sorted. headers syntax conveys which column is not sortable //Unsortable columns are based on the 0 index $('.4-col').tablesorter({ headers: { 3: { sorter: false}} }); $('.5-col').tablesorter({ headers: { 4: { sorter: false}} }); $('.6-col').tablesorter({ headers: { 0: { sorter: false }, 5: { sorter: false } } }); $('.6-col-statements').tablesorter({ headers: { 5: { sorter: false } } }); $('.7-col').tablesorter({ headers: { 6: { sorter: false } } }); $('.8-col').tablesorter({ headers: { 7: { sorter: false } } }); $('.4-col-check').tablesorter({ headers: { 0: { sorter: false }, 3: { sorter: false } } }); $('.5-col-check').tablesorter({ headers: { 0: { sorter: false }, 4: { sorter: false } } }); $('.6-col-check').tablesorter({ headers: { 0: { sorter: false }, 5: { sorter: false } } }); $('.7-col-check').tablesorter({ headers: { 0: { sorter: false }, 6: { sorter: false } } }); $('.8-col-check').tablesorter({ headers: { 0: { sorter: false }, 7: { sorter: false } } }); //Declaration for jQuery UI datepicker $(".date").datepicker({ showOn: "both", buttonImage: appRoot + "images/calendar-icon.png", dateFormat: 'mm/dd/yy' }); // Declares Tooltips //First tool tip is triggered on hover $('.primary-tool').tooltip({ trigger: 'hover' }); //Second tool tip is showing by default and turns off when the element is hovered over $('.secondary-tool').tooltip('show'); $('.account-snapshot a.secondary-tool').hover(function () { $('.secondary-tool').tooltip('show'); }) $('.tooltip.left').click(function () { $('.secondary-tool').tooltip('hide'); }); //Tooltip Close Link $('a.tooltip-close').click(function (e) { e.preventDefault(); $(this).parent().fadeOut(); }); //$().anchorAnimate(); animates anchor links. It slides to a local anchor that is in the href of the element. $("table a.edit-link").anchorAnimate(); $('span.cancel-card-link').click(function (e) { $('.edit-card-form').hide(); }); // Check and Unchecks all checkboxes on Statements Due table $('thead th input[type="checkbox"]').click(function () { var checked_status = this.checked; $("input.row-check").each(function () { this.checked = checked_status; }); }); //Removes rows that were pulled in with AJAX if a table is being sorted $('table.table thead th').click(function () { $('table.table tr.expandable').remove(); $('table.table tr.table-row span.expand-link').text('View More'); }); //Click funtion for expandable rows $('.expand-table tr td span.expand-link').click(function () { //If the next row hasClass of table row, then insert the 'expandable' table row immediately after if ($(this).parent().parent().next().hasClass('table-row')) { $(this).text('Close'); $(this).parent().parent().addClass('bold-row'); $(this).parent().parent().after('
STATEMENTS INCLUDED IN THIS PAYMENT
Mar 17, 2009$200.00Mark JonesEmdeon General HospitalPDF
Mar 17, 2009$300.00Teresa PhillipsBarnes Jewish HospitalPDF
'); } else if ($(this).closest('tr.table-row').is(':last-child')) { $(this).text('Close'); $(this).parent().parent().addClass('bold-row'); $(this).parent().parent().after('
STATEMENTS INCLUDED IN THIS PAYMENT
Mar 17, 2009$200.00Mark JonesEmdeon General HospitalPDF
Mar 17, 2009$300.00Teresa PhillipsBarnes Jewish HospitalPDF
'); } else { //If the next row doesn't have the class of 'table-row', then it is removed and text of Expand link is changed to view more $(this).text('View More'); $(this).parent().parent().removeClass('bold-row'); $(this).parent().parent().next().remove(); } }); $('.payment-step tr td span.expand-link').click(function () { var expandId = $(this).attr('id'); //If the next row hasClass of table row, then insert the 'expandable' table row immediately after if ($(this).parent().parent().next().hasClass('table-row')) { $(this).text('Close'); $(this).parent().parent().addClass('bold-row'); getStatementDetails($(this), expandId); //$(this).parent().parent().after('
STATEMENTS INCLUDED IN THIS PAYMENT
Mar 17, 2009$200.00Mark JonesEmdeon General HospitalPDF icon PDF
Mar 17, 2009$300.00Teresa PhillipsBarnes Jewish HospitalPDF icon PDF
'); } else if ($(this).closest('tr.table-row').is(':last-child')) { $(this).text('Close'); $(this).parent().parent().addClass('bold-row'); getStatementDetails($(this), expandId); //$(this).parent().parent().after('
STATEMENTS INCLUDED IN THIS PAYMENT
Mar 17, 2009$200.00Mark JonesEmdeon General HospitalPDF icon PDF
Mar 17, 2009$300.00Teresa PhillipsBarnes Jewish HospitalPDF icon PDF
'); } else { //If the next row doesn't have the class of 'table-row', then it is removed and text of Expand link is changed to view more $(this).text('View More'); $(this).parent().parent().removeClass('bold-row'); $(this).parent().parent().next().remove(); } }); $('.recent-payments tr td span.expand-link').click(function () { //If the next row hasClass of table row, then insert the 'expandable' table row immediately after var expandId = $(this).attr('id'); if ($(this).parent().parent().next().hasClass('table-row')) { $(this).text('Close'); $(this).parent().parent().addClass('bold-row'); //$(this).parent().parent().after('
STATEMENTS INCLUDED IN THIS PAYMENT
Mar 17, 2009$200.00Mark JonesEmdeon General HospitalPDF icon PDF
Mar 17, 2009$300.00Teresa PhillipsBarnes Jewish HospitalPDF icon PDF
'); getRecentStatementDetails($(this), expandId); } else if ($(this).closest('tr.table-row').is(':last-child')) { $(this).text('Close'); $(this).parent().parent().addClass('bold-row'); //$(this).parent().parent().after('
STATEMENTS INCLUDED IN THIS PAYMENT
Mar 17, 2009$200.00Mark JonesEmdeon General HospitalPDF icon PDF
Mar 17, 2009$300.00Teresa PhillipsBarnes Jewish HospitalPDF icon PDF
'); getRecentStatementDetails($(this), expandId); } else { //If the next row doesn't have the class of 'table-row', then it is removed and text of Expand link is changed to view more $(this).text('View More'); $(this).parent().parent().removeClass('bold-row'); $(this).parent().parent().next().remove(); } }); $('.statements-due tr td span.expand-link').click(function () { //If the next row hasClass of table row, then insert the 'expandable' table row immediately after var expandId = $(this).attr('id'); if ($(this).parent().parent().next().hasClass('table-row')) { $(this).text('Close'); $(this).parent().parent().addClass('bold-row'); //$(this).parent().parent().after('
» STATEMENT DETAILS FOR STATEMENT ISSUED BY “LOREM IPSUM DOLOR PLACE” ON MAR 17, 2009 FOR $175.00
Phone(314) 727-3600
Date of ServiceMar 01, 2009
Account Number233383
Statement Dates (3)
Dec 23, 2008 - Jan 23, 2009PDF iconView PDF
Oct 18, 2008PDF iconView PDF
Aug 01, 2008PDF iconView PDF

Notes

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

'); getStatementDetails($(this), expandId); } else if ($(this).closest('tr.table-row').is(':last-child')) { $(this).text('Close'); $(this).parent().parent().addClass('bold-row'); //$(this).parent().parent().after('
» STATEMENT DETAILS FOR STATEMENT ISSUED BY “LOREM IPSUM DOLOR PLACE” ON MAR 17, 2009 FOR $175.00
Phone(314) 727-3600
Date of ServiceMar 01, 2009
Account Number233383
Statement Dates (3)
Dec 23, 2008 - Jan 23, 2009PDF iconView PDF
Oct 18, 2008PDF iconView PDF
Aug 01, 2008PDF iconView PDF

Notes

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

'); getStatementDetails($(this), expandId); } else { //If the next row doesn't have the class of 'table-row', then it is removed and text of Expand link is changed to view more $(this).text('View More'); $(this).parent().parent().removeClass('bold-row'); $(this).parent().parent().next().remove(); } }); $('.paymentPlanDetail tr td span.expand-link').click(function () { //If the next row hasClass of table row, then insert the 'expandable' table row immediately after var expandId = $(this).attr('id'); if ($(this).parent().parent().next().hasClass('table-row')) { $(this).text('Close'); $(this).parent().parent().addClass('bold-row'); getPaymentPlanDetails($(this), expandId); } else if ($(this).closest('tr.table-row').is(':last-child')) { $(this).text('Close'); $(this).parent().parent().addClass('bold-row'); getPaymentPlanDetails($(this), expandId); } else { //If the next row doesn't have the class of 'table-row', then it is removed and text of Expand link is changed to view more $(this).text('View More'); $(this).parent().parent().removeClass('bold-row'); $(this).parent().parent().next().remove(); } }); $('.previous-statements tr td span.expand-link').click(function () { //If the next row hasClass of table row, then insert the 'expandable' table row immediately after var expandId = $(this).attr('id'); if ($(this).parent().parent().next().hasClass('table-row')) { $(this).text('Close'); $(this).parent().parent().addClass('bold-row'); getPreviousStatement($(this), expandId); //$(this).parent().parent().after('
» STATEMENT DETAILS FOR STATEMENT ISSUED BY “LOREM IPSUM DOLOR PLACE” ON MAR 17, 2009 FOR $175.00
Phone(314) 727-3600
Date of ServiceMar 01, 2009
Account Number233383
Statement Dates (3)
Dec 23, 2008 - Jan 23, 2009PDF iconView PDF
Oct 18, 2008PDF iconView PDF
Aug 01, 2008PDF iconView PDF

Notes

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

'); } else if ($(this).closest('tr.table-row').is(':last-child')) { $(this).text('Close'); $(this).parent().parent().addClass('bold-row'); getPreviousStatement($(this), expandId); //$(this).parent().parent().after('
» STATEMENT DETAILS FOR STATEMENT ISSUED BY “LOREM IPSUM DOLOR PLACE” ON MAR 17, 2009 FOR $175.00
Phone(314) 727-3600
Date of ServiceMar 01, 2009
Account Number233383
Statement Dates (3)
Dec 23, 2008 - Jan 23, 2009PDF iconView PDF
Oct 18, 2008PDF iconView PDF
Aug 01, 2008PDF iconView PDF

Notes

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

'); } else { //If the next row doesn't have the class of 'table-row', then it is removed and text of Expand link is changed to view more $(this).text('View More'); $(this).parent().parent().removeClass('bold-row'); $(this).parent().parent().next().remove(); } }); // Shows search results // $('.results-filter .patient-filter .btn-inverse').click(function (e) { // e.preventDefault(); // $('.results-filter .patient-filter p.clear-link a').show(); // $('#search-results').show(); // $('#pre-search-results').hide(); // // Hides Elements on Documents page // $('.tab-menu, #eob, #correspondences').hide(); // }); // Hides Search results // $('.results-filter .patient-filter p.clear-link a').click(function (e) { // e.preventDefault(); // $('#search-results').hide(); // $('#pre-search-results').show(); // // Hides Elements on Documents page // $('.tab-menu, #eob, #statements-due').show(); // $(this).hide(); // }); // Modal Popup from Bootstrap on click function for Red Delete links //$('.linked-accounts-table tr td a.delete-link').click(function (e) { // e.preventDefault(); // var myBookId = $(this).data('id'); // $(".modal-body #bookId").val(myBookId); // $('#linked-accounts-modal').modal(); //}); $('.large-profile-data a.delete-link').click(function (e) { e.preventDefault(); alert(1); $('#table-modal').modal(); }); // Modal Popup from Bootstrap for Remove links $('table.credit-debit-cards tr td a.remove-link, table.echeck-bank-accounts tr td a.remove-link').click(function (e) { e.preventDefault(); $('#linked-accounts-modal').modal(); }); // Tab Toggling for My Documents Page $('#eob-tab').click(function (e) { e.preventDefault(); if ($(this).parent().not('active')) { $('#correspondences-tab').parent().removeClass('active'); $('#correspondences').hide(); $('#eob').show(); $(this).parent().addClass('active'); } }); $('#correspondences-tab').click(function (e) { e.preventDefault(); if ($(this).parent().not('active')) { $('#eob-tab').parent().removeClass('active'); $('#eob').hide(); $('#correspondences').show(); $(this).parent().addClass('active'); } }); // To Emulate a fake process. Real text can be changed once handed over. $('.modal button.btn-inverse').click(function (e) { e.preventDefault(); $('#linked-accounts-modal').modal('toggle'); //$('.modal h2').text('Are you sure you want to delete Michael Bluth\'s Account?'); $('.modal button.btn-inverse').text('NO'); $('.modal button.btn-primary').show(); }); $('.modal button.btn-primary').click(function (e) { e.preventDefault(); $('.modal h2').text('Account Deleted!'); $(this).hide(); $('.modal button.btn-inverse').text('OK'); }); // Adds active class to tabs based on page url. var currentPageURL = $('#page-url').text(); var paymentStep1 = 'payment-step-1.php'; var paymentStep2 = 'payment-step-2.php'; var paymentStep3 = 'payment-step-3.php'; var paymentStep4 = 'payment-step-4.php'; $('.nav-menu ul.nav-tabs li a').each(function () { if ($(this).attr('href') == currentPageURL) { $(this).parent().addClass('active'); } else if ((currentPageURL == paymentStep1) || (currentPageURL == paymentStep2) || (currentPageURL == paymentStep3) || (currentPageURL == paymentStep4)) { $('.nav-menu ul.nav-tabs li.my-payments-tab').addClass('active'); } }); // Shows Credit Card or eCheck option based on selection // If you were already entering a new card and switch to eCheck and then switch back, the info in New Card will still be present // Same with if you were creating a new eCheck account. $('input[name=creditdebitradio]').change(function () { var isWallet = $("#hidIsWallet").val(); var isQuickPay = $("#hidQuickPayAccount").val(); $(':input').each(function () { var type = this.type; var tag = this.tagName.toLowerCase(); if (type == 'text') this.value = ''; else if (tag == 'select') this.selectedIndex = 0; if (this.id == "ddlBillCountry") { $('select#ddlBillCountry').val() == 'United States'; } }); if ($('input#creditdebitradio').attr('checked')) { $('.echeck, .new-account, .new-card, .billing-address, .choose-country, .billing-address-international, .preferences, .submit-section, .preferencesCheck').hide(); //, $('.credit-cards').show(); $('select#ddlBillCountry').val() == 'United States'; if ($('input#use-new-card-radio').is(':checked')) { $('.new-card, .billing-address, .choose-country, .preferences, .submit-section').show(); //added choose country to show... } if ($('input#use-wallet').attr('checked')) { $('.submit-section').show(); $('.new-card, .choose-country, .preferences, .billing-address, .billing-address-international').hide(); } if (isWallet == "false" || isQuickPay == "yes") { $('.credit-cards').hide(); $('input#use-new-card-radio').attr('checked', true); $('.echeck').hide(); $('.preferences').hide(); $('.new-card, .billing-address, .choose-country,.submit-section').show(); } } if ($('input#eCheckradio').attr('checked')) { $('.credit-cards, .new-account, .new-card, .choose-country, .billing-address, .billing-address-international, .preferences, .submit-section').hide(); $('.echeck').show(); $('select#ddlBillCountry').val() == 'United States'; if ($('input#use-new-account-radio').is(':checked')) { $('.new-account, .billing-address, .choose-country, .submit-section, .preferencesCheck').show(); //added choose country to show... } if ($('input#use-account-wallet').attr('checked')) { $('.submit-section').show(); $('.new-account, .choose-country, .preferences, .billing-address, .billing-address-international, .preferencesCheck').hide(); } if (isWallet == "false" || isQuickPay == "yes") { $('.echeck').hide(); $('input#use-new-account-radio').attr('checked', true); $('.credit-cards').hide(); $('.preferencesCheck').hide(); $('.new-account, .billing-address, .choose-country,.submit-section').show(); } } }); //If use a saved card is selected, only the submit section is shown //If a new card is being added the associated fields are displayed. $('input[name=use-card]').change(function () { //Use saved Card if ($('input#use-wallet').attr('checked')) { $('.submit-section').show(); $('.new-card, .choose-country, .preferences, .billing-address, .billing-address-international').hide(); } //Use New Card if ($('input#use-new-card-radio').attr('checked')) { $('.new-card, .choose-country, .billing-address, .preferences, .submit-section').show(); $(':input').each(function () { var type = this.type; var tag = this.tagName.toLowerCase(); if (type == 'text') this.value = ''; else if (tag == 'select') this.selectedIndex = 0; if (this.id == "ddlBillCountry") { $('select#ddlBillCountry').val() == 'United States'; } }); $('input#chkPrefSaveCard').attr("checked", false); $('input#chkPrefDefaultCard').attr("checked", false); } }); //If use a saved card is selected, only the submit section is shown //If a new card is being added the associated fields are displayed. $('input[name=use-account]').change(function () { //Use saved card if ($('input#use-account-wallet').attr('checked')) { $('.submit-section').show(); $('.new-account, .choose-country, .preferences, .billing-address, .billing-address-international, .preferencesCheck').hide(); } //use new card if ($('input#use-new-account-radio').attr('checked')) { $('.new-account').show(); $('.choose-country').show(); $('.billing-address').show(); $('.submit-section').show(); $('.preferencesCheck').show(); $(':input').each(function () { var type = this.type; var tag = this.tagName.toLowerCase(); if (type == 'text') this.value = ''; else if (tag == 'select') this.selectedIndex = 0; if (this.id == "ddlBillCountry") { $('select#ddlBillCountry').val() == 'United States'; } }); $('input#chkPrefCheckSaveCard').attr("checked", false); $('input#chkPrefDefaultCheck').attr("checked", false); } }); // If the value of the Country selected is United states, then US fields are displayed, any other country will display International fields. $('select#ddlBillCountry').change(function () { if ($(this).val() == 'United States') { $('.billing-address-international').hide(); $('.billing-address').show(); } else { $('.billing-address').hide(); $('.billing-address-international').show(); } }); // it will mask the 10 digit phone number into (xxx) xxx-xxxx format $('.masked-phone-number-preregistration').bind('keypress', function (event) { var regex = new RegExp("[0-9]+$"); var key = String.fromCharCode(!event.charCode ? event.which : event.charCode); var keycode = event.keyCode || event.charCode; if( keycode == 8 || keycode == 46 || keycode == 37 || keycode == 39 || keycode == 9 ) { // backspace || delete || left arrow || tab out key return true; } if (!regex.test(key)) { event.preventDefault(); return false; } var phonenumber = $(this).val(); var len = $(this).val().length; if (len == 0) { $(this).val(phonenumber + '('); } if (len == 4) { $(this).val(phonenumber + ') '); } if (len == 5) { $(this).val(phonenumber + '-'); } if (len == 9) { $(this).val(phonenumber + '-'); } if (len == 14) { event.preventDefault(); return false; } return true; }); // it will mask the 10 digit phone number into (xxx) xxx-xxxx format $('.masked-phone-number-preregistration').change(function () { var reg = new RegExp("[0-9]{10}$"); var phoneNumber = $(this).val(); if (reg.test(phoneNumber)) { var substring1 = phoneNumber.substring(1, 4); var substring2 = phoneNumber.substring(4, 7); var substring3 = phoneNumber.substring(7); $(this).val('(' +substring1 + ') ' + substring2 + '-' + substring3); } }); // it will mask the 10 digit phone number into xxx-xxx-xxxx format $('.masked-phone-number').bind('keypress', function (event) { if (event.keyCode == 8 || event.keyCode == 9 || event.keyCode == 46 || event.keyCode == 37 || event.keyCode == 39) { return true; } var regex = new RegExp("[0-9]+$"); var key = String.fromCharCode(!event.charCode ? event.which : event.charCode); if (!regex.test(key)) { event.preventDefault(); return false; } var phonenumber = $(this).val(); var len = $(this).val().length; if (len == 3) { $(this).val(phonenumber + '-'); } if (len == 7) { $(this).val(phonenumber + '-'); } if (len == 12) { event.preventDefault(); return false; } return true; }); // it will mask the Date into xx/xx/xxxx format $('.masked-date').bind('keypress', function (event) { var regex = new RegExp("[0-9]+$"); var key = String.fromCharCode(!event.charCode ? event.which : event.charCode); var keycode = event.keyCode || event.charCode; if( keycode == 8 || keycode == 46 || keycode == 37 || keycode == 39 || keycode == 9 ){ // backspace || delete || left arrow || tab out return true; } if (!regex.test(key)) { event.preventDefault(); return false; } var phonenumber = $(this).val(); var len = $(this).val().length; if (len == 2) { $(this).val(phonenumber + '/'); } if (len == 5) { $(this).val(phonenumber + '/'); } if (len == 11) { event.preventDefault(); return false; } return true; }); // it will mask the 10 digit phone number into xxx-xxx-xxxx format $('.masked-phone-number').change(function () { var reg = new RegExp("[0-9]{10}$"); var phoneNumber = $(this).val(); if (reg.test(phoneNumber)) { var substring1 = phoneNumber.substring(0, 3); var substring2 = phoneNumber.substring(3, 6); var substring3 = phoneNumber.substring(6); $(this).val(substring1 + '-' + substring2 + '-' + substring3); } }); }); // Anchor Animate Function. Shows Edit Card form on click. jQuery.fn.anchorAnimate = function(settings) { settings = jQuery.extend({ speed : 1100 }, settings); //$('#edit-card-form').show(); return this.each(function(){ var caller = this $(caller).click(function (event) { $('#edit-card-form').show(); event.preventDefault() var locationHref = window.location.href var elementClick = $(caller).attr("href") var destination = $(elementClick).offset().top; $("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination}, settings.speed, function() { window.location.hash = elementClick }); return false; }) }) } // Determine browser and version. function Browser() { var ua, s, i; this.isIE = false; this.isNS = false; this.version = null; ua = navigator.userAgent; s = "MSIE"; if ((i = ua.indexOf(s)) >= 0) { this.isIE = true; this.version = parseFloat(ua.substr(i + s.length)); return; } s = "Netscape6/"; if ((i = ua.indexOf(s)) >= 0) { this.isNS = true; this.version = parseFloat(ua.substr(i + s.length)); return; } // Treat any other "Gecko" browser as NS 6.1. s = "Gecko"; if ((i = ua.indexOf(s)) >= 0) { this.isNS = true; this.version = 6.1; return; } } var browser = new Browser(); // Global object to hold drag information. var dragObj = new Object(); dragObj.zIndex = 0; function dragStart(event, id) { $(".sample-statementimg-close").hide(); var el; var x, y; // If an element id was given, find it. Otherwise use the element being // clicked on. if (id) dragObj.elNode = document.getElementById(id); else { if (browser.isIE) dragObj.elNode = window.event.srcElement; if (browser.isNS) dragObj.elNode = event.target; // If this is a text node, use its parent element. if (dragObj.elNode.nodeType == 3) dragObj.elNode = dragObj.elNode.parentNode; } // Get cursor position with respect to the page. if (browser.isIE) { x = window.event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft; y = window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop; } if (browser.isNS) { x = event.clientX + window.scrollX; y = event.clientY + window.scrollY; } // Save starting positions of cursor and element. dragObj.cursorStartX = x; dragObj.cursorStartY = y; dragObj.elStartLeft = parseInt(dragObj.elNode.style.left, 10); dragObj.elStartTop = parseInt(dragObj.elNode.style.top, 10); if (isNaN(dragObj.elStartLeft)) dragObj.elStartLeft = 0; if (isNaN(dragObj.elStartTop)) dragObj.elStartTop = 0; // Update element's z-index. dragObj.elNode.style.zIndex = ++dragObj.zIndex; // Capture mousemove and mouseup events on the page. if (browser.isIE) { document.attachEvent("onmousemove", dragGo); document.attachEvent("onmouseup", dragStop); window.event.cancelBubble = true; window.event.returnValue = false; } if (browser.isNS) { document.addEventListener("mousemove", dragGo, true); document.addEventListener("mouseup", dragStop, true); event.preventDefault(); } } function dragGo(event) { var xWidth, yHeight; // Get cursor position with respect to the page. if (browser.isIE) { xWidth = window.event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft; yHeight = window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop; } if (browser.isNS) { xWidth = event.clientX + window.scrollX; yHeight = event.clientY + window.scrollY; } // Move drag element by the same amount the cursor has moved. dragObj.elNode.style.left = (dragObj.elStartLeft + xWidth - dragObj.cursorStartX) + "px"; dragObj.elNode.style.top = (dragObj.elStartTop + yHeight - dragObj.cursorStartY) + "px"; if (browser.isIE) { window.event.cancelBubble = true; window.event.returnValue = false; } if (browser.isNS) event.preventDefault(); } function dragStop(event) { $(".sample-statementimg-close").css("left", dragObj.elNode.style.left); $(".sample-statementimg-close").css("top", dragObj.elNode.style.top); $(".sample-statementimg-close").fadeIn(1000); // Stop capturing mousemove and mouseup events. if (browser.isIE) { document.detachEvent("onmousemove", dragGo); document.detachEvent("onmouseup", dragStop); } if (browser.isNS) { document.removeEventListener("mousemove", dragGo, true); document.removeEventListener("mouseup", dragStop, true); } } function sampleStatement() { $(".sample-statementimg-close").css("top", "0"); $(".sample-statementimg-close").css("left", "0"); $("#sample-statement-id").slideDown("slow") $(".sample-statementimg").fadeIn(2000); $(".sample-statementimg").css("left", "0"); $(".sample-statementimg").css("top", "0"); $(".sample-statementimg-close").fadeIn(1000); $('html, body').animate({ scrollTop: $("#sample-statement-id").offset().top }, 500); } function sampleStatementClose() { $(".sample-statementimg").fadeOut("1000") $(".sample-statementimg-close").css("left", "0"); $(".sample-statementimg-close").css("top", "0"); $(".sample-statementimg-close").hide(); $("#sample-statement-id").slideUp("2000"); } function ClearFullSiteCookieForMobile() { if (isMobile.any()) { var expires = ""; var value = "False"; var cookieName = "FullSite"; document.cookie = cookieName + "=" + value + expires + "; path=/"; } }; var isMobile = { Android: function () { return navigator.userAgent.match(/Android/i); }, BlackBerry: function () { return navigator.userAgent.match(/BlackBerry/i); }, iOS: function () { return navigator.userAgent.match(/iPhone|iPad|iPod/i); }, Opera: function () { return navigator.userAgent.match(/Opera Mini/i); }, Windows: function () { return navigator.userAgent.match(/IEMobile/i); }, any: function () { return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows()); } };