$(document).ready( function(){ $('.fundDetailPrint').click( function(){ $('body').append('
') var printOptions = $('#printOption').html(); $('#printOption').empty(); $('.fundPrintWindow div').html(printOptions) $('.cancel').click( function(){ $('.on').remove(); $('.fundPrintWindow').remove(); $('#printOption').html(printOptions); }) var overview; var portfolio; var performance; var distribution; var identifier; $('.fundPrintBtn').click( function(){ if( $('#overviewPrint').attr("checked") == 'checked' ){ overview = 1; }else{ overview = 0; } if( $('#portfolioPrint').attr("checked") == 'checked' ){ portfolio = 1; }else{ portfolio = 0; } if( $('#performancePrint').attr("checked") == 'checked' ){ performance = 1; }else{ performance = 0; } if( $('#distributionPrint').attr("checked") == 'checked' ){ distribution = 1; }else{ distribution = 0; } if( $('#identifierPrint').attr("checked") == 'checked' ){ identifier = 1; }else{ identifier = 0; } var myUrlGet = $('input#printPageLink').val(); var myurl = myUrlGet + 'overview='+ overview +'&' + 'portfolio=' + portfolio +'&' + 'performance=' + performance +'&' + 'distribution=' + distribution+'&' + 'identifier=' + identifier; //window.location.href = myurl; window.open(myurl, "_blank"); $('.on').remove(); $('.fundPrintWindow').remove(); $('#printOption').html(printOptions); }) }) var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); for (var i = 0; i < hashes.length; i++) { var hash = hashes[i].split('='); var filterName = hash[0]; var filterValue = hash[1]; switch(hash[0]){ case "overview" : if(hash[1]=="0"){ $('#fundAnnualized1').addClass('hidden'); } else { $('#fundAnnualized1').removeClass('hidden'); } case "portfolio" : if(hash[1]=="0"){ $('#fundAnnualized').addClass('hidden'); } else { $('#fundAnnualized').removeClass('hidden'); } case "performance" : if(hash[1]=="0"){ $('#pgContent3').addClass('hidden'); } else { $('#pgContent3').removeClass('hidden'); } case "distribution" : if(hash[1]=="0"){ $('#pgContent4').addClass('hidden'); } else { $('#pgContent4').removeClass('hidden'); } case "identifier" : if(hash[1]=="0"){ $('#pgContent5').addClass('hidden'); } else { $('#pgContent5').removeClass('hidden'); } } } //var decodedUrl = decodeURIComponent(filterValue); })