//open jquery $(function() { /*gets drop down nav to work in ie, sent only to ie*/ if($.browser.msie){ $(".section").hover(function() { $(this).children("ul").addClass("iepopup"); },function(){ $(this).children("ul").removeClass("iepopup"); }); } /*increases and decereases the size of the text when button is pressed*/ $("#increase-size").click(function(){ $("#content").addClass("big"); $("#nav").addClass("big"); //set a cookie for future pages createCookie("textSize","big",7); return false; }); $("#decrease-size").click(function(){ $("#content").removeClass("big"); $("#nav").removeClass("big"); //set a cookie for future pages createCookie("textSize","small",7); return false; }); /*functioning link for print button*/ $("#print").children("a").click(function(){ window.print(); return false; }); /*hides/shows the share panel*/ $("#share").children("span").click(function(){ sharePage(); return false; }); $("#close-container").click(function(){ $("#share-container").slideUp("fast"); return false; }); $("#close-container").click(function(){ $("#share-container").slideUp("fast"); return false; }); /*when the messagelength in the share pannel gets too long, it makes it bigger*/ $("#message").keypress(function(){ var messageLength = $("#message").val().length; if(messageLength > 180){ $("#message").addClass("message-long") } }); /*read in the cookie set by the size buttons, onload*/ var textCookie = readCookie("textSize"); if(textCookie == "big"){ $("#content").addClass("big"); $("#nav").addClass("big"); }else{ $("#content").removeClass("big"); $("#nav").removeClass("big"); } /*top-nav roll-over*/ $("#header-nav").children("li").children("a").children("img").hover(function(){ if(($(this).attr("src").indexOf("-over") == -1) && ($(this).attr("src").indexOf("off") != -1)){ var newSrc = $(this).attr("src").replace(".gif","-over.gif"); $(this).attr("src",newSrc); } },function(){ if(($(this).attr("src").indexOf("-over") != -1) && ($(this).attr("src").indexOf("off") != -1)){ var newSrc = $(this).attr("src").replace("-over.gif",".gif"); $(this).attr("src",newSrc); } }); /*video popup*/ $(".video-popup").click(function(){ videoUrl = $(this).attr("href"); var newWin = window.open(videoUrl,'whatever','menubar=1,resizable=1,width=740px,height=500'); newWin.focus(); return false; }); /*close button*/ $("#close").click(function(){ window.close(); }); /*view larger image*/ $(".content-popup").click(function(){ var myWin = $(this).children('img'); var winName = $(this).attr("href"); var winSize = $(this).children('img').height(); winSize = winSize * 2; winSize = winSize + 30; popupWin = window.open(""+winName, "popup","toolbar=0,resizable=1,width=825px,height="+winSize+"px") if (window.focus){ popupWin.focus(); popupWin.resizeTo(830,winSize); } return false; }); /*popup for cfliving email*/ $(".cfliving-popup").click(function(){ var winName = $(this).attr("href"); popupWin = window.open(""+winName, "popup","toolbar=0,resizable=1,scrollbars=1,width=585px,height=600px"); if (window.focus){ popupWin.focus(); } return false; }); /*popup link for external links*/ $("a").click(function(){ hrefString = $(this).attr("href"); //this line checks to see if the url in the link is offsite (http), //and not on the whitelist (currently: gene.com, pulmozyme.com and accesssolutions.com [including pulmozymeaccesssolutions.com, and all variants]) //note, whitelist does not contain all gene sites, including other drug sites. if( hrefString.indexOf("http") == 0 && hrefString.indexOf("gene.com") == -1 && hrefString.indexOf("pulmozyme.com") == -1 && hrefString.indexOf("accesssolutions.com") == -1 && hrefString.indexOf("cfliving.com") == -1 && hrefString.indexOf("kadium") == -1 ){ var response = confirm("You are leaving the Pulmozyme Web site:\n\nThe link you have selected will take you away from this site to one that is not owned or controlled by Genentech, Inc. Genentech, Inc makes no representation as to the accuracy of the information contained on sites we do not own or control. Genentech does not recommend and does not endorse the content on any third-party websites. Your use of third-party websites is at your own risk and subject to the terms and conditions of use for such sites."); if(response){ offsiteWin = window.open(hrefString,"offsiteLink"); offsiteWin.focus() return false; }else{ return false; } }else if ((hrefString.indexOf("http") == 0) && (hrefString.indexOf("pulmozyme.com") == -1) && (hrefString.indexOf("kadium.net") == -1)){ offsiteWin = window.open(hrefString,"offsiteLink"); offsiteWin.focus() return false; } }); /*popup question when you leave to go to the hcp side*/ $("a.to-hcp").click(function(){ hrefString = $(this).attr("href"); var response = confirm("The information contained in this section of the site is intended for U.S. healthcare professionals only. Select OK if you are a U.S. healthcare professional."); if(!response){ return false; } }); /* form controls */ /*show the rest of the form if you have or know someone who has CF is clicked yes*/ //when you click on the yes cf diagnosis radio button $("#CF_diagnosis_yes").click(function(){ //remove the class hidden on the second part of the form //to make it visible $("#if-diagnosed").removeClass("hidden"); }); //if the yes cf diagnosis radio button is already selected, show it as well if ( $("#CF_diagnosis_yes").length > 0 ) { if($("#CF_diagnosis_yes")[0].checked){ $("#if-diagnosed").removeClass("hidden"); } } //if the no cf diagnosis radio button is clicked $("#CF_diagnosis_no").click(function(){ //hide the second part of the form $("#if-diagnosed").addClass("hidden"); }); //note -- the second part is hidden by default if ( $("#Treatment_pulmozyme").length > 0 ) { /*if you are taking pz, show the third part of the form*/ //if you come to the page with treatment checked, show the section if($("#Treatment_pulmozyme")[0].checked){ $("#if-taking-pz").removeClass("hidden"); //if you come to the page with treatment not checked, hide the section }else{ $("#if-taking-pz").addClass("hidden"); } //after the default state, if someone clicks the checkbox, toggle the hidden class $("#Treatment_pulmozyme").click(function(){ $("#if-taking-pz").toggleClass("hidden"); }); } /* if "i have cf" is selected conditionals */ //if "i have cf" is selected, on websites initial state if ( $("#Relationship").length > 0 ) { if($("#Relationship")[0].selectedIndex != 1){ $(".has-cf").addClass("hidden"); if($("#no_Year").attr("class") == "over-eightteen"){ $("#no_Year").after(''); $("#no_Year").attr("selected","selected"); $("#no_Year").removeClass("over-eightteen"); } }else{ $(".has-cf").removeClass("hidden"); $("#no_Year").addClass("over-eightteen"); $(".under-eightteen").remove(); } } //if you change the relationship dropdown, check again $("#Relationship").change(function(){ //same logic used as above if($("#Relationship")[0].selectedIndex != 1){ $(".has-cf").addClass("hidden"); if($("#no_Year").attr("class") == "over-eightteen"){ $("#no_Year").after(''); $("#no_Year").attr("selected","selected"); $("#no_Year").removeClass("over-eightteen"); } }else{ $(".under-eightteen").remove(); $(".has-cf").removeClass("hidden"); $("#no_Year").addClass("over-eightteen"); } }); //send to a friend $('#share-page').submit(function() { var inputs = []; $(':input', this).each(function() { inputs.push(this.name + '=' + escape(this.value)); }); jQuery.ajax({ data: inputs.join('&'), url: this.action, timeout: 2000, error: function(r) { $('#share-page .notes').css("padding-bottom",10) $('#share-page .notes').css("color","red"); $('#share-page .notes .errors').css("border","0"); $('#share-page .notes .errors').css("margin","0"); $('#share-page .notes').html("there was an error processing your request"); }, success: function(r) { if(r == "success"){ $('#share-page .notes').css("padding-bottom",10) $('#share-page .notes').html("Congratulations!
Your message was sent

Would you like to send another?"); }else{ $('#share-page .notes').css("padding-bottom",10) $('#share-page .notes').css("color","red"); $('#share-page .notes .errors').css("border","0"); $('#share-page .notes .errors').css("margin","0"); $('#share-page .notes').html(r) } } }); return false; }); //close jquery }); function sharePage() { $("#share-container").slideDown("fast"); } //my attempt at resize /* function newSize(dataY, theId){ $('#flashcontent').height(dataY); } */ /*ppk create and read cookie functions www.quirksmode.com*/ function createCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; } function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; } function trackflash(str) { var s_account="genedev" if (window.location.hostname.indexOf('pulmozyme-qa.gene.com') > -1) { s_account= "geneqa"; } else { if (window.location.hostname.indexOf('pulmozyme-ua.gene.com') > -1) { s_account="geneua"; } else { if (window.location.hostname.indexOf('www.pulmozyme.com') > -1) { s_account="genepulmozyme,geneexternal"; } } } var s=s_gi(s_account);s.prop1=str;s.linkTrackVars='prop1';void(s.tl(true,'o',str)); }