if(typeof jQuery!='undefined'){function anychked()
{var greenAdd="";var greenRemove="";var greyAdd="";var greyRemove="";var disabled="";if($(".templateRowChkbx:checked").length>0)
{greenAdd='medBtnGreen';greenRemove='medBtnInactive';greyAdd='medBtnGrey';greyRemove='medBtnInactive';disabled=false;}
else
{greenAdd='medBtnInactive';greenRemove='medBtnGreen';greyAdd='medBtnInactive';greyRemove='medBtnGrey';disabled=true;}
$(".ctrlWhenItemCheckedGreen").removeClass(greyRemove).addClass(greenAdd).attr("disabled",disabled);$(".ctrlWhenItemCheckedGrey").removeClass(greyRemove).addClass(greyAdd).attr("disabled",disabled);return false;}
$(document).ready(function(){if($('#listView')){$('#listView .resultGalleryViewRow').each(function(){var prodTitle=$(this).children('.product').children('.productDetails').children('.productDescription').children('.medGridProdTitle').children('a');if(prodTitle.text()=="SilvaSorb Site Dressings"){var infoListElem=prodTitle.parent('.medGridProdTitle').parent('.productDescription').children('.medProdInfo').children('.medProdInfoList');infoListElem.css({"position":"relative"}).after('<div id="wrapTextLimiter">');infoListElem.children('ul').append('<div class="blurForExtraText blurEffect"></div>');var medProdInfo=infoListElem.parent('.medProdInfo').html();infoListElem.parent('.medProdInfo').html(medProdInfo.substr(0,medProdInfo.indexOf('<div id="wrapTextLimiter">')));return false;}});}
$(".prodovergrid").each(function(){$("td:first-child",this).addClass("first");$("td:last-child",this).addClass("last");});if(jQuery().carousel){$('.home-grid-carousel').carousel({'auto':10});$('.grid-carousel').carousel({'auto':10});};if(jQuery().fancybox){$(".fancybox").fancybox();$(".header-container-outer").css({"z-index":"999"});}
if(jQuery().jcarousel){function mycarousel_initCallback(carousel){jQuery('.jcarousel-control a').bind('click',function(){carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text()));return false;});jQuery('.jcarousel-scroll select').bind('change',function(){carousel.options.scroll=jQuery.jcarousel.intval(this.options[this.selectedIndex].value);return false;});jQuery('#mycarousel-next').bind('click',function(){carousel.next();return false;});jQuery('#mycarousel-prev').bind('click',function(){carousel.prev();return false;});carousel.buttonNext.bind('click',function(){carousel.startAuto(0);});carousel.buttonPrev.bind('click',function(){carousel.startAuto(0);});carousel.clip.hover(function(){carousel.stopAuto();},function(){carousel.startAuto();});};function highlight(carousel,obejctli,liindex,listate){jQuery('.jcarousel-control a:nth-child('+liindex+')').addClass("selected");try{trackCarouselBannerNo(liindex);}
catch(err){}};function removehighlight(carousel,obejctli,liindex,listate){jQuery('.jcarousel-control a:nth-child('+liindex+')').removeClass("selected");};jQuery("#mycarousel-products").jcarousel({wrap:'circular',auto:10});}
$('a[name=modal]').click(function(e){e.preventDefault();var id=$(this).attr('href');var maskHeight=$(document).height();var maskWidth=$(window).width();$('#jqmask').css({'width':maskWidth,'height':maskHeight});$('#jqmask').css({'filter':'alpha(opacity=50)'});$('#jqmask').fadeIn(500);var winH=$(window).height();var winW=$(window).width();$(id).css('top',winH/2-$(id).height()/2);$(id).css('left',winW/2-$(id).width()/2);$(id).fadeIn(500);});$('.window .close').click(function(e){e.preventDefault();$('#jqmask, .window').fadeOut('fast');$('#jqmask').css({'min-width':'0','width':'0','min-height':'0','height':'0'});$('#boxes').css({'min-width':'0','width':'0','min-height':'0','height':'0'});});$('#jqmask').click(function(){$(this).hide();$('.window').fadeOut('fast');$('#jqmask').css({'min-width':'0','width':'0','min-height':'0','height':'0'});$('#boxes').css({'min-width':'0','width':'0','min-height':'0','height':'0'});});$('.grid-item, .leftNav ul li').hover(function(){$(this).addClass('hover')},function(){$(this).removeClass('hover')});$('#menu > li:gt(2)').find('.dropdown_column').addClass('align_right');$('.dropdown_column','#menu').each(function(i,e){var self=$(e),navColLength=$('.navCol ul li',self).length,navContent=$('.navCol',self).hasClass('navContent');});$('.grid-carousel').hover(function(){if($.browser.msie&&parseInt($.browser.version)<7){$('.jcarousel-scroll').show();return;}
$('.jcarousel-scroll').fadeIn(500);},function(){if($.browser.msie&&parseInt($.browser.version)<7){$('.jcarousel-scroll').hide();return;}
$('.jcarousel-scroll').fadeOut(500);});$('.jcarousel-skin-tango .jcarousel-item').css({'display':'block'});$('.page-jcarousel').show();var textContainer=$('.carousel-cms-content-text .content p');var maxLines=7;var h=parseInt(textContainer.css('line-height'));textContainer.css('max-height',h*maxLines+'px');initjQueryBindings();});function chkTargetContains(e,container)
{if(container.has(e.target).length===0){container.hide();}}
function makeTall(){$(this).addClass('hover').css("background-color","f7f7f7");}
function makeShort(){$(this).removeClass('hover').css("background-color","");}
function initjQueryBindings()
{try{$("#menu").hoverIntent({over:makeTall,out:makeShort,selector:'li',timeout:300});}catch(e){}
var ignoreControls=new Array();if(jQuery().jqPopup){ignoreControls.push($("#searchQuestion").jqPopup({calleventType:"focus",popupid:"search-popup",top:28,subtractPopupWidth:false,shimLeft:0,resType:'show'}));}
$('body').on('click','.availlink',function(e){e.preventDefault();$(".availability_popup").hide();var thisid=$(this).attr('id');var pos=$(this).position();var popuplink=thisid.replace("_availability_link_","_availability_popup_");var width=$("#"+popuplink).width();$("#"+popuplink).css({top:pos.top+"px",right:pos.left-200+"px"});if($("#"+popuplink).parents().is("#orderTemplateCategoryForm_"))
{$("#"+popuplink).css("right","-210px");}
else if($("#"+popuplink).parents().is(".medCrossRefAvailability"))
{$("#"+popuplink).css("right","250px");}
$("#"+popuplink).show();});$(document).mouseup(function(e)
{$(".availability_popup").hide();if($.inArray(e.target.id,ignoreControls)==-1)
{chkTargetContains(e,$("#search-popup"));}});$(".accountNameFullText").hover(function(){var pos=$(".accountNameFullText").position();var width=$("#accountNameFullText").width();$("#search-popup").hide();if($.browser.msie&&parseInt($.browser.version,10)==7){var width=$("#accountNameFullText").width();$("#accountNameFullText").css({top:"23px",left:pos.left+"px"}).show();}
else
{$("#accountNameFullText").css({top:"23px",right:pos.left+"px"}).show();}},function(){$('#accountNameFullText').hide();});}
function open_market_selector(){var id=$('a[name=modal]').attr('href');var maskHeight=$(document).height();var maskWidth=$(document).width();$('#jqmask').css({'min-width':maskWidth,'width':'100%','min-height':maskHeight,'height':'100%'});$('#boxes').css({'min-width':maskWidth,'width':'100%','min-height':maskHeight,'height':'100%'});$('#jqmask').css({'filter':'alpha(opacity=50)'});$('#jqmask').fadeIn(500);var winH=$(window).height();var winW=$(window).width();$(id).css('top',winH/2-$(id).height()/2);$(id).css('left',winW/2-$(id).width()/2);var zoom=document.documentElement.clientWidth/window.innerWidth;$(window).on("orientationchange",function(){winH=$(window).height();winW=$(window).width();$(id).css('top',winH/2-$(id).height()/2);$(id).css('left',winW/2-$(id).width()/2);}).bind('resize',function(){winH=$(window).height();winW=$(window).width();$(id).css('top',winH/2-$(id).height()/2);$(id).css('left',winW/2-$(id).width()/2);})
$(id).fadeIn(500);}}
if(typeof jQuery!='undefined'){function isVideo(filename){var ext=getExtension(filename);switch(ext.toLowerCase()){case'm4v':case'avi':case'mpg':case'mp4':case'wmv':case'mov':case'jpg':case'jpeg':case'png':case'gif':case'tiff':return false;}
return true;}
function getExtension(filename){var parts=filename.split('.');return parts[parts.length-1];}
function fixfancyboxlinks()
{}
$(document).ready(function(){if(typeof tooltip!='undefined'){$(".tooltip").tooltip();}
if(!$(".grid-carousel").hasClass("mycarousel-products"))
{$(".jcarousel-scroll").remove();$(".jcarousel-control-container").remove();$('.jcarousel-skin-tango').replaceWith($('.jcarousel-skin-tango').html());$('.jcarousel-container').replaceWith($('.jcarousel-container').html());$('.jcarousel-clip').replaceWith($('.jcarousel-clip').html());$("#mycarousel").attr('style','').removeClass().addClass("list-container");$('.jcarousel-item').each(function(i,obj){$(this).attr('style','').removeClass().addClass("item");$(this).find('.carousel-cms-content-container').replaceWith($('.carousel-cms-content-container').html());$(this).find('.carousel-cms-content-text').replaceWith($('.carousel-cms-content-text').html());});$(".carousel-cms-content-container").addClass("content").removeClass("carousel-cms-content-container");$(".carousel-cms-market").addClass("market").removeClass("carousel-cms-market");$(".carousel-cms-title").addClass("title").removeClass("carousel-cms-title");$(".carousel-cms-blurb").addClass("blurb").removeClass("carousel-cms-blurb");$(".carousel-cms-link").addClass("link").removeClass("carousel-cms-link");$(".carousel-cms-image").addClass("image").removeClass("carousel-cms-image");}
else
{$("#mycarousel-products").removeClass().addClass("jcarousel-skin-tango");$(".jcarousel-skin-tango h2").addClass("carttl");}
if(jQuery().jcarousel){function mycarousel_initCallback(carousel){jQuery('.jcarousel-control a').bind('click',function(){carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text()));return false;});jQuery('.jcarousel-scroll select').bind('change',function(){carousel.options.scroll=jQuery.jcarousel.intval(this.options[this.selectedIndex].value);return false;});jQuery('#mycarousel-next').bind('click',function(){carousel.next();return false;});jQuery('#mycarousel-prev').bind('click',function(){carousel.prev();return false;});carousel.buttonNext.bind('click',function(){carousel.startAuto(0);});carousel.buttonPrev.bind('click',function(){carousel.startAuto(0);});carousel.clip.hover(function(){carousel.stopAuto();},function(){carousel.startAuto();});};function highlight(carousel,obejctli,liindex,listate){jQuery('.jcarousel-control a:nth-child('+liindex+')').addClass("selected");try{trackCarouselBannerNo(liindex);}
catch(err){}};function removehighlight(carousel,obejctli,liindex,listate){jQuery('.jcarousel-control a:nth-child('+liindex+')').removeClass("selected");};jQuery("#mycarousel-products").jcarousel({wrap:'circular',auto:10});}
if($(".confirmationorderactive").length>0){$.tablesorter.addParser({id:'uom',is:function(s){return false;},format:function(s){return parseInt(s);},type:'numeric'});$.tablesorter.addParser({id:'contract',is:function(s){return false;},format:function(s,table,cell,cellIndex){if($(cell).find("img").length>0){return"Y";}
else
{return"N";}},type:'text'});$(".tinysortable").tablesorter({headers:{4:{sorter:'uom'},7:{sorter:'contract'}}});$("#medOrderEntry").addClass("orderconf");}
$(".creditAppTable select:eq(1)").change(function(e){e.preventDefault;if($(this).val()=="net30")
{$(this).closest("tbody").find(".physicianOffice").removeClass("mdcInvisible").show();}
else
{$(this).closest("tbody").find(".physicianOffice").addClass("mdcInvisible").hide();}});$(document).on('blur','.datepicker,#dateFrom,#dateTo',function(e){try
{var dateElement=$(this).val();dateElement=dateElement.split("/");if(dateElement.length<3)
{return false;}
else
{var month=parseInt(dateElement[0],10);var day=parseInt(dateElement[1],10);var year=dateElement[2];if(year.toString().length<=2){year='20'+year;}
var month=$(this).val(month+"/"+day+"/"+year);}}
catch(err)
{}});$(document).on('click','.setdatetotoday',function(e){e.preventDefault;var today=new Date();var dd=today.getDate();var mm=today.getMonth()+1;var yyyy=today.getFullYear();if(dd<10){dd='0'+dd}
if(mm<10){mm='0'+mm}
today=mm+'/'+dd+'/'+yyyy;$(this).parent().find(".datepicker").val(today);PHDORDER.hiddenFieldUpdate();return false;});$(document).on('click','#orderSearchPatient .tablerow tbody tr',function(e){e.preventDefault;$(this).closest("tr").find(".patientPopupRadio")[0].click();});$(document).on('click','#searchClinicianResult .tablerow tbody tr',function(e){e.preventDefault;$(this).closest("tr").find(".clinicianPopupRadio")[0].click();});$(document).on('click',"#addAdditionalApprover",function(e){e.preventDefault();$("#singleemailtemplate").clone().attr("id","").css("display","block").appendTo($(this).closest(".medPopupWindowInner").find(".newRow"));});$(document).on('click',".email-remove",function(e){e.preventDefault();$(this).parent().remove();});});}