/* ----------------------- BEGIN THIRD PARTY PLUGINS ----------------------- */ /*! * HTML5 Placeholder jQuery Plugin v1.8.7 * @link http://github.com/mathiasbynens/Placeholder-jQuery-Plugin * @author Mathias Bynens */ (function(f,h,c){var a='placeholder' in h.createElement('input'),d='placeholder' in h.createElement('textarea'),i=c.fn,j;if(a&&d){j=i.placeholder=function(){return this};j.input=j.textarea=true}else{j=i.placeholder=function(){return this.filter((a?'textarea':':input')+'[placeholder]').not('.placeholder').bind('focus.placeholder',b).bind('blur.placeholder',e).trigger('blur.placeholder').end()};j.input=a;j.textarea=d;c(function(){c(h).delegate('form','submit.placeholder',function(){var k=c('.placeholder',this).each(b);setTimeout(function(){k.each(e)},10)})});c(f).bind('unload.placeholder',function(){c('.placeholder').val('')})}function g(l){var k={},m=/^jQuery\d+$/;c.each(l.attributes,function(o,n){if(n.specified&&!m.test(n.name)){k[n.name]=n.value}});return k}function b(){var k=c(this);if(k.val()===k.attr('placeholder')&&k.hasClass('placeholder')){if(k.data('placeholder-password')){k.hide().next().show().focus().attr('id',k.removeAttr('id').data('placeholder-id'))}else{k.val('').removeClass('placeholder')}}}function e(){var o,n=c(this),k=n,m=this.id;if(n.val()===''){if(n.is(':password')){if(!n.data('placeholder-textinput')){try{o=n.clone().attr({type:'text'})}catch(l){o=c('').attr(c.extend(g(this),{type:'text'}))}o.removeAttr('name').data('placeholder-password',true).data('placeholder-id',m).bind('focus.placeholder',b);n.data('placeholder-textinput',o).data('placeholder-id',m).before(o)}n=n.removeAttr('id').hide().prev().attr('id',m).show()}n.addClass('placeholder').val(n.attr('placeholder'))}else{n.removeClass('placeholder')}}}(this,document,jQuery)); /** * hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+ * * * @param f onMouseOver function || An object with configuration options * @param g onMouseOut function || Nothing (use configuration options object) * @author Brian Cherne */ (function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY)) »'].join('')), over = function(){ var $$ = $(this), menu = getMenu($$); clearTimeout(menu.sfTimer); $$.showSuperfishUl().siblings().hideSuperfishUl(); /* *** BEGIN DP EDIT *** */ $nav_main.addClass('is-open'); /* *** END DP EDIT *** */ }, out = function(){ var $$ = $(this), menu = getMenu($$), o = sf.op; clearTimeout(menu.sfTimer); menu.sfTimer=setTimeout(function(){ o.retainPath=($.inArray($$[0],o.$path)>-1); $$.hideSuperfishUl(); if (o.$path.length && $$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);} /* *** BEGIN DP EDIT *** */ $nav_main.removeClass('is-open'); /* *** END DP EDIT *** */ },o.delay); }, getMenu = function($menu){ var menu = $menu.parents(['ul.',c.menuClass,':first'].join(''))[0]; sf.op = sf.o[menu.serial]; return menu; }, addArrow = function($a){ $a.addClass(c.anchorClass).append($arrow.clone()); }; return this.each(function() { var s = this.serial = sf.o.length; var o = $.extend({},sf.defaults,op); o.$path = $('li.'+o.pathClass,this).slice(0,o.pathLevels).each(function(){ /* *** BEGIN DP EDIT *** */ // $(this).addClass([o.hoverClass,c.bcClass].join(' ')) // .filter('li:has(ul)').removeClass(o.pathClass); $(this).addClass([o.hoverClass,c.bcClass].join(' ')) .filter('li:has(div.menu)').removeClass(o.pathClass); /* *** END DP EDIT *** */ }); sf.o[s] = sf.op = o; /* *** BEGIN DP EDIT *** */ // $('li:has(ul)',this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out).each(function() { // if (o.autoArrows) addArrow( $('>a:first-child',this) ); // }) // .not('.'+c.bcClass) // .hideSuperfishUl(); $('li:has(div.menu)',this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out).each(function() { if (o.autoArrows) addArrow( $('>a:first-child',this) ); }) .not('.'+c.bcClass) .hideSuperfishUl(); /* *** END DP EDIT *** */ var $a = $('a',this); $a.each(function(i){ var $li = $a.eq(i).parents('li'); $a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);}); }); o.onInit.call(this); }).each(function() { var menuClasses = [c.menuClass]; if (sf.op.dropShadows && !($.browser.msie && $.browser.version < 7)) menuClasses.push(c.shadowClass); $(this).addClass(menuClasses.join(' ')); }); }; var sf = $.fn.superfish; sf.o = []; sf.op = {}; sf.IE7fix = function(){ var o = sf.op; if ($.browser.msie && $.browser.version > 6 && o.dropShadows && o.animation.opacity!=undefined) this.toggleClass(sf.c.shadowClass+'-off'); }; sf.c = { bcClass : 'sf-breadcrumb', menuClass : 'sf-js-enabled', anchorClass : 'sf-with-ul', arrowClass : 'sf-sub-indicator', shadowClass : 'sf-shadow' }; sf.defaults = { hoverClass : 'sfHover', pathClass : 'overideThisToUse', pathLevels : 1, delay : 800, animation : {opacity:'show'}, speed : 'normal', autoArrows : false, dropShadows : false, disableHI : false, // true disables hoverIntent detection onInit : function(){}, // callback functions onBeforeShow: function(){}, onShow : function(){}, onHide : function(){} }; $.fn.extend({ hideSuperfishUl : function(){ var o = sf.op, not = (o.retainPath===true) ? o.$path : ''; o.retainPath = false; /* *** BEGIN DP EDIT *** */ // var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass) // .find('>ul').hide().css('visibility','hidden'); var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass) .find('>div').hide().css('visibility','hidden'); /* *** END DP EDIT *** */ o.onHide.call($ul); return this; }, showSuperfishUl : function(){ var o = sf.op, sh = sf.c.shadowClass+'-off', /* *** BEGIN DP EDIT *** */ // $ul = this.addClass(o.hoverClass) // .find('>ul:hidden').css('visibility','visible'); $ul = this.addClass(o.hoverClass) .find('>div:hidden').css('visibility','visible'); /* *** END DP EDIT *** */ sf.IE7fix.call($ul); o.onBeforeShow.call($ul); $ul.animate(o.animation,o.speed,function(){ sf.IE7fix.call($ul); o.onShow.call($ul); }); return this; } }); })(jQuery); /* ----------------------- END THIRD PARTY PLUGINS ----------------------- */ /* ----------------------- BEGIN DP OPEN/CLOSE PLUGIN ----------------------- */ (function($){ $.fn.openClose = function(child, force) { return this.each(function() { if (force === 'open') { $(this).closest('li').addClass('open').find(child).slideDown(); } else if (force === 'close') { $(this).closest('li').removeClass('open').find(child).slideUp(); } else { $(this).closest('li').toggleClass('open').find(child).slideToggle(); } }); }; })(jQuery); /* ----------------------- END DP OPEN/CLOSE PLUGIN ----------------------- */ /* ----------------------- BEGIN DP CUSTOM EVENTS ----------------------- */ $(document).ready(function(){ /* superfish on main menu */ $("#nav-main-list").superfish({ animation: {height:'show'} }); }); // placeholder polyfill ( a').click(function(e) { e.preventDefault(); //if (a == 1) {a = 2} else {a = 1} $(this).openClose('ul'); }); /* slide open/close the action menu parent items */ $('.actions .parent > a').click(function(e) { e.preventDefault(); $(this).openClose('ul'); }); // script for expandable take action items: function changePlusMinus(x) { if (x.className == 'plus') { setTimeout(function(){x.className=(x.className=="actions_plus")?"actions_minus":(x.className=="actions_minus")?"actions_plus":"actions_minus";}); } else { setTimeout(function(){x.className=(x.className=="actions_plus")?"actions_minus":(x.className=="actions_minus")?"actions_plus":"actions_minus";},400); } } /* ----------------------- END DP CUSTOM EVENTS ----------------------- */ /* ----------------------- START SEARCH CODE ----------------------- */ function redirectToSearch(val){ var hostName = document.getElementById('header-varHostName').value; window.location= hostName+"/home/search.html?keyWord="+encodeURIComponent(val); } /* ----------------------- END SEARCH CODE ----------------------- */ /* -------------- START EXTERNAL LINK CODE -----------*/ function extConfirmation(url){ var answer = confirm("You are now leaving the Quest Diagnostics web site. Quest Diagnostics does not control the site you are about to enter and accepts no responsibility for its content."); if (answer){ var WinTest = window.open(url); if (! WinTest){window.location.href=url;} } } $('a').click(function(e){ if($(this).attr('href')){ var link=$(this).attr('href').toLowerCase(); var hostname=window.location.hostname; var hostName1 = document.getElementById('header-varHostName').value; if(!(link.indexOf(hostName1)>=0) && !(link.indexOf(hostname)>0) && lookInQuestFamily(link)){ var status=link.indexOf("http"); if(status==0){ e.preventDefault(); extConfirmation($(this).attr('href')); } } } }); var questFamily = ['cloudfront.net','aptimaforher.com','questcognisense.com','quanumanalyticsportal.com','questdiagnostics.com','questdiagnostics1.webex.com','questdiagnostics2.webex.com','care360ehr.webex.com','questdiagnosticsfeedback.com','care360.com','zynite.com','examone.com','employersolutions.com','mygazelleapp.com','quest.airhealthgroup.com','questdiagnostics.co.uk','questdiagnostics.ie','questdiagnostics.mediaroom.com','survey1.burke.com','ameripath.com','associatedclinicallabs.com','athenadiagnostics.com','bhlinc.com','blueprintforwellness.com','care360tour.com','colovantage.com','compunetlab.com','corporate-ir.net','dermpath.com','dermpathdiagnostics.com','dlolab.com','doyouhavetheguts.com','drcsurveys.com','enterix.com.au','focusdx.com','hemocue.com','hemocue.se','insuretest.com','labcard.com','labcardselect.com','labone.com','labreference.com','macl1.com','medplus.com','MedPlusCentergy.com','mycare360health.com','mylabisquest.com','nicholsinstitute.com','omega-labs.com','oraldna.com','pathwaydx.com','quest4health.com','questcentralab.com','questdiagnostics.ie','questdiagnostics.in','sonoraquest.com','specialtylabs.com','vitamindtestfacts.com','careers-ext.questcareersite.com','celera.com','gazelleapp.com','myoraldna.com','questdiagnostics-ccf.com','questdiagnostics-qis.com','questdiagnostics-randoms.com','questdiagnostics-supplies.com','hwoshg.healthwise.net/questdiag','4myheart.com','questdiagnosticssurveys.com','www.q2labsolutions.com','www.questforhealthsystems.com','www.idexpertconnect.com','qdx.com']; function lookInQuestFamily(link){ for(var i=0;i0)return false; } return true; } /* -------------- END EXTERNAL LINK CODE -----------*/ // -------------- Start Google Analytics Code -----------// var _gaq = _gaq || []; var gaDomain; gaDomain =((document.domain.indexOf("qdx.com")) != -1)?"qdx.com":"questdiagnostics.com"; _gaq.push(['_setAccount', 'UA-921392-12']); _gaq.push(['_setDomainName', gaDomain]); _gaq.push(['_setAllowLinker', true]); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); // -------------- End Google Analytics Code -----------// // Updated xdomain.js script -- deals with matching mixed lower/upper case links for Quest Family sites - Lunametrics (function($) { function listenToClicks() { var fileTypes=[".doc", ".xls", ".exe", ".zip", ".pdf", ".mov", ".mp3"]; $('a[href]').each(function(index) { var link = $(this); var href = link.attr('href'); $.each(fileTypes, function(i) { if($(link).attr('href').indexOf(this)!=-1){ valid = false; $(link).bind('click', function(c) { c.preventDefault(); _gat._getTrackerByName()._trackEvent('Download', 'Click - ' + $(link).attr('href')); setTimeout('document.location = "' + $(link).attr('href') + '"', 100); }); } }); var valid = false; $.each(questFamily, function(j) { var lowerLink = $(link).attr('href').toLowerCase(); if((lowerLink.indexOf(this)!=-1)&&(window.location.href.indexOf(this)==-1)){ valid = true; if (valid) { $(link).bind('click', function(l) { l.preventDefault(); _gat._getTrackerByName()._trackEvent('Quest Family Link', href); setTimeout('document.location = "' + href + '"', 100); }); } } }); var rootDomain = document.domain.split(".")[document.domain.split(".").length - 2] + "." + document.domain.split(".")[document.domain.split(".").length - 1]; if ( (href.match(/^http/)) && (href.indexOf(rootDomain) == -1) && !valid) { $(link).bind('click', function(d) { d.preventDefault(); _gat._getTrackerByName()._trackEvent('Outbound Link', href); }); } }); } $(document).ready(function() { listenToClicks(); }); } ) (jQuery);