
var globalLib={analytics:{init:function()
{$.xLazyLoader({js:'http://2.scripts.sesamehost.com/scripts/jGoogleAnalytics.min.js',name:'jGoogleAnalytics',success:function(){$.jGoogleAnalytics('',{anchorClick:true,domainName:'atlantacosmeticdentist.com',pageViewsEnabled:true});}});}},cssImage_preload:{init:function()
{$.xLazyLoader({js:'http://15.scripts.sesamehost.com/scripts/jquery.preloadCssImages.min.js',name:'preloadCssImages',success:function(){$.preloadCssImages();}});}},form_validation:{init:function()
{$('.hidden-content').css('display','none');$(".sequential-list li").each(function(i){i=i+1;$(this).prepend('<span class="comment-number">'+i+'. </span>');});$("input[name^='Current_Patient']").click(function(){if($("input[name^='Current_Patient']:checked").val()=='No')
$('.hidden-content').fadeIn('slow');else
$('.hidden-content').fadeOut();if($('#found-other').css('display')!='none'){$('#found-other').fadeOut();}});$('#Found').change(function(){var selected=$('#Found option:selected');if(selected.val()=='Other'){$('#found-other').fadeIn('slow');}else{$('#found-other').fadeOut();}});$("input[name^='Contact_Me']").click(function(){if($("input[name^='Contact_Me']:checked").val()=='Yes')
$('.hidden-content').fadeIn('slow');else
$('.hidden-content').fadeOut().find('input').val("");});$("input[name^='Radiographs_Sent']").click(function(){if($("input[name^='Radiographs_Sent']:checked").val()=='Yes')
$('.hidden-content').fadeIn('slow');else
$('.hidden-content').fadeOut().find('input').val("");;});$('.clearme').one("focus",function(){$(this).val("");});$('label.required').each(function(i){$(this).append('<em> * </em>');});$.xLazyLoader({js:['http://20.scripts.sesamehost.com/scripts/jquery.validate.js','http://13.scripts.sesamehost.com/scripts/jquery.maskedinput-1.2.2.min.js'],name:'validate',success:function(){$(".date-mask").mask("99/99/9999");$(".phone-mask").mask("(999) 999-9999");$.validator.addMethod("phone",function(phone_number,element){phone_number=phone_number.replace(/\s+/g,"");return this.optional(element)||phone_number.length>9&&phone_number.match(/^(1-?)?(\([2-9]\d{2}\)|[2-9]\d{2})-?[2-9]\d{2}-?\d{4}$/);},"Please specify a valid phone number");$("#bd form.validate").each(function(){$(this).validate({errorElement:"div",errorClass:"error",validClass:"success",success:function(label){label.text("ok!").addClass("success");},rules:{First_Name:{required:true,minlength:2},Last_Name:{required:true,minlength:2},Doctor_First_Name:{required:true,minlength:2},Doctor_Last_Name:{required:true,minlength:2},Patient_First_Name:{required:true,minlength:2},Patient_Last_Name:{required:true,minlength:2},Patient_Email:{required:true,email:true},Referred_Patient_First_Name:{required:true,minlength:2},Referred_Patient_Last_Name:{required:true,minlength:2},Doctor_Patient_Referring:{required:true,minlength:2},Doctor_Email:{required:true,email:true},Appointment_Email:{required:true,email:true},Daytime_Phone:{required:true,phone:true},Alternate_Phone:{phone:true},Patient_Phone:{required:true,phone:true},Message:{required:true,minlength:12},Would_Like_To:{required:true},Patient_Name:{required:"#Contact_Me_Yes:checked",minlength:5},Email:{required:"#Contact_Me_Yes:checked",email:true},txtNumber:{required:true,minlength:5}}});});}});}},flash_functions:{init:function()
{$.xLazyLoader({js:'http://8.scripts.sesamehost.com/scripts/jquery.flash_1.3.js',name:'flash',success:function(){var flashModules={defaults:{'width':500,'height':300,'src':'http://media.sesamehost.com/flash/','wmode':'transparent','flashvars':{'autoPlay':'false','thisColor':'0x'+'639CCE'},'express':'flash/playerProductInstall.swf','version':'9'},modules:[{name:'homepage',config:{'src':'flash/','width':540,'height':227}},{name:'braces-diagram',config:{'height':375}},{name:'brace-painter',config:{'height':430,'wmode':'opaque'}},{name:'brushing-and-flossing-ortho',config:{'flashvars':{'brushing':'true','flossing':'true'}}},{name:'brushing-and-flossing-dental',config:{'flashvars':{'brushing':'true','flossing':'true'}}},{name:'color-your-retainer',config:{'width':300,'height':300,'flashvars':{'autoPlay':'true'}}},{name:'common-treatments',config:{'flashvars':{'crowding':'true','openbite':'true','deepOverbite':'true','missing':'true','underbite':'true','spacing':'true','overbite':'true','nonBraces':'true','phaseI':'true'}}},{name:'damon-system-comparison',config:{'width':250,'height':165,'wmode':'opaque'}},{name:'emergency-care',config:{'flashvars':{'pokingWire':'true','bracket':'true','looseWire':'true','appliance':'true','headgear':'true','soreness':'true'}}},{name:'general-soreness',config:{'width':200,'height':150}},{name:'headgear',config:{'width':200,'height':150}},{name:'loose-appliance',config:{'width':200,'height':150}},{name:'loose-bracket',config:{'width':200,'height':150}},{name:'loose-wire',config:{'width':200,'height':150}},{name:'poking-wire',config:{'width':200,'height':150}},{name:'ibraces-logo',config:{'width':200,'height':135,'wmode':'opaque'}},{name:'know-your-teeth',config:{'width':500,'height':400}},{name:'office-tour',config:{'width':500,'height':375,'wmode':'opaque','flashvars':{'caption01':'','caption02':'Entry way','caption03':'Reception area','caption04':'Coffee tables and chairs','caption05':'Coffee bar','caption06':'Family waiting room','caption07':'Adult waiting room','caption08':'Game room','caption09':'Exam and consultation room','caption10':'Records room','caption11':'X-ray room','caption12':'Sterilization area','caption13':'Brushing area','caption14':'Open treatment bay','caption15':'','caption16':''}}},{name:'palatal-expander',config:{'width':200,'height':150}},{name:'patient-care',config:{'src':'flash/','height':375}},{name:'smile-gallery',config:{'flashvars':{'bonding':"true",'bridges':"true",'crowns':"true",'fillings':"true",'implants':"true",'invisalign':"true",'veneers':"true",'whitening':"true"}}},{name:'types-of-appliances',config:{'flashvars':{'elastics':'true','headgear':'true','herbst':'true','palatal':'true','positioners':'true','separators':'true'}}},{name:'types-of-braces',config:{'flashvars':{'metal':'true','gold':'true','ceramic':'true','invisible':'true','lingual':'true'}}}]};for(var j=flashModules.modules.length-1;j>=0;j--){var module=flashModules.modules[j];var modConfig=$.extend({},flashModules.defaults,module.config);modConfig.flashvars=$.extend(flashModules.defaults.flashvars,module.config.flashvars);modConfig.src=modConfig.src+module.name+'.swf';$('#flash-'+module.name).flash(modConfig);}
var flashVideos={defaults:{'src':'video/flvPlayer.swf','dir':'http://media.sesamehost.com/video/','img_dir':'http://media.sesamehost.com/video/','width':320,'height':266,'wmode':'transparent','menu':false,'allowFullScreen':true,flashvars:{'autoStart':'false','showScaleModes':'false','smoothVideo':'true'}},videos:[{name:'the-damon-system',config:{'width':240,'height':206}},{name:'the-damon-system-2',config:{'width':400,'height':330}},{name:'in-ovation',config:{}},{name:'opalescence',config:{'width':400,'height':251}},{name:'invisalign',config:{'width':360}},{name:'suresmile',config:{'height':206}},{name:'suresmile-robot',config:{'height':242,flashvars:{startImage:'none',autoStart:'true'}}}]};for(var j=0;j<flashVideos.videos.length;j++){var video=flashVideos.videos[j];var vidConfig=$.extend({},flashVideos.defaults,video.config);vidConfig.flashvars=$.extend({},flashVideos.defaults.flashvars,video.config.flashvars);vidConfig.flashvars.flvToPlay=vidConfig.dir+video.name+'.flv';vidConfig.flashvars.startImage=vidConfig.img_dir+video.name+'.jpg';$('#video-'+video.name).flash(vidConfig,flashVideos.defaults.pluginOptions);};}});}},games:{init:function()
{$('ul#sesame-games li').hover(function(){$(".cover",this).stop().animate({top:'36px'},{queue:false,duration:160});},function(){$(".cover",this).stop().animate({top:'0px'},{queue:false,duration:160});});}},html_functions:{init:function()
{$('.jshide').addClass('hide');$('a[href$=".pdf"]').attr('target','_blank').not('[class*="noicon"]').append('<span/>').addClass('pdf');$('a[href$=".doc"]').attr('target','_blank').not('[class*="noicon"]').append('<span/>').addClass('doc');$("a[rel^='prettyPhoto[flash]']").parent('li').append('<span/>').addClass('video-link');$('ol.alpha, ol.numeric').addClass('js');$("ol li").each(function(i){$(this).wrapInner('<span/>');});$('ul.q-and-a li').each(function(){$(this).find('h2,h4,h3').prepend('<span>Q: </span>');$(this).find('div').prepend('<span>A: </span>');});$('#toggle-links').css('display','block');$('#toggle-content dl').hide();function toggleInfoContent(id){if($(id).css('display')!='none'){$(id).fadeOut('fast');$('.back-to-top').addClass('hide');}else{$('#toggle-content dl').fadeOut('fast');$(id).fadeIn('slow');$('.back-to-top').removeClass('hide');}}
$("#toggle-links").bind('click',function(e){var target=e.target,$target=$(target);var id=$target.attr('href')
if(target.nodeName==='A'){toggleInfoContent(id);}
return false;});$('#toggle-emergency div p').hide();function toggleEmergency(id){if($(id).css('display')!='none'){$(id).animate({opacity:'toggle'}).parent().animate({width:'80px',height:'60px'});}else{$(id).animate({opacity:'toggle'}).parent().animate({width:'200px',height:'150px'});}}
$("a.toggle-div").bind('click',function(e){var target=e.target,$target=$(target);var id=$target.attr('href')
if(target.nodeName==='A'){toggleEmergency(id);}
return false;});if($('#content').height()>$(window).height()){$('.back-to-top').removeClass('hide');}
$('#pt-login-form a, #dr-login-form a').bind('mouseover',function(e){var target=e.target,$target=$(target);$target.animate({opacity:'.65'},400).bind('mouseout',function(){$target.animate({opacity:'1'},400);});});$('a.iframe').each(function(i){var iframeSrc=$(this).attr('href');$(this).replaceWith('<iframe src="'+iframeSrc+'" class="map"></iframe>');});$("span.callout-phone").prepend("<span></span>");}},gallery_view_tour:{init:function()
{$.xLazyLoader({js:['http://11.scripts.sesamehost.com/scripts/jquery.galleryview-2.0.js','http://7.scripts.sesamehost.com/scripts/jquery.easing.1.3.js','http://19.scripts.sesamehost.com/scripts/jquery.timers-1.1.2.js'],name:'galleryView',success:function(){$('#gallery').galleryView({panel_width:460,panel_height:350,frame_width:80,frame_height:60,transition_speed:600,easing:'easeInOutBack',transition_interval:0,nav_theme:'dark'});}});}},cycle_tour:{init:function()
{$.xLazyLoader({js:'http://6.scripts.sesamehost.com/scripts/jquery.cycle.2.73.all.min.js',name:'cycleTour',success:function(){$('ul.slideshow').cycle({pause:true,wmode:'transparent'});$('#cycle-office-tour').before('<div class="office-tour-nav" id="office-1">').cycle({cleartype:true,cleartypeNoBg:true,speed:500,timeout:5000,pager:'#office-1',before:function(){$('#caption span').fadeOut();},after:function(curr,next,opts){var alt=$(next).find('img').attr('alt');$('#caption span').html(alt).fadeIn();}});}});}},cycle_slideshow:{init:function()
{$.xLazyLoader({js:'http://6.scripts.sesamehost.com/scripts/jquery.cycle.2.73.all.min.js',name:'cycleSlideshow',success:function(){var $ss=$('#slideshow-home .slideshow');for(var i=2;i<6;i++)
$ss.append('<img src="../../images/slideshow/slide'+i+'.jpg" alt="slide" width="462" height="228" />');$('.slideshow img:first').fadeIn(1000,function(){$ss.cycle({fx:'blindY',pause:true,wmode:'transparent',height:'228',cleartype:true,cleartypeNoBg:true,speed:1000,timeout:5000,prev:'#prev',next:'#next',pager:'#pager'});});}});}},cycle_before_after:{init:function()
{$.xLazyLoader({js:'http://6.scripts.sesamehost.com/scripts/jquery.cycle.2.73.all.min.js',name:'cycleBeforeAfter',success:function(){$('#before-after-cycle').before('<div class="before-after-nav">').cycle({cleartype:true,cleartypeNoBg:true,speed:500,timeout:0,pager:'.before-after-nav',before:function(){$('.cycle-detail span').fadeOut();},after:function(curr,next,opts){var cycle_alt=$(next).find('img').attr('alt');$('.cycle-detail span').html(cycle_alt).fadeIn();}});}});}},slider_before_after:{init:function()
{$.xLazyLoader({js:['http://6.scripts.sesamehost.com/scripts/jquery.cycle.2.73.all.min.js','http://3.scripts.sesamehost.com/scripts/jquery.beforeafter.js'],name:'sliderBeforeAfter',success:function(){$('.before-after-slider').beforeAfter({animateIntro:false,showFullLinks:false});$('#slider-cycle').before('<div class="slider-nav">').cycle({cleartype:true,cleartypeNoBg:true,speed:500,timeout:0,pager:'.slider-nav',before:function(){$('.slider-detail span').fadeOut();},after:function(curr,next,opt){var slider_alt=$(next).children('.before-after-slider').children('div').siblings().find('img').attr('alt');$('.slider-detail span').html(slider_alt).fadeIn();}});}});}},ie_functions:{init:function()
{var fancyHover=$.support.leadingWhitespace;if(fancyHover==false)
{$('#nav ul li, #utility-nav ul li').bind('mouseenter mouseleave',function(){$(this).toggleClass('sfhover');});if($('.ie-alert-link').length>0){$.xLazyLoader({js:'http://5.scripts.sesamehost.com/scripts/jquery.cookie.js',name:'cookie',success:function(){var COOKIE_NAME='ie_alert';var options={path:'',expires:14};$('.ie-alert-link').click(function(){$('#ie_alert').slideToggle("slow");$.cookie(COOKIE_NAME,'noshow',options);});var alertBox=$.cookie(COOKIE_NAME);if(alertBox){$('#ie_alert').css('display','none');}else{$('#ie_alert').css('display','block');}}});}}}},cufon:{init:function()
{if(!$.fontAvailable('AdobeGaramondProRegular')){$.xLazyLoader({js:['http://10.scripts.sesamehost.com/scripts/cufon-yui.js','scripts/AdobeGaramondProRegular_400.font.js'],name:'cufon',success:function(){Cufon.replace('#bd h1.headline',{fontFamily:'AdobeGaramondProRegular'});Cufon.replace('#hd span.callout-phone',{fontFamily:'AdobeGaramondProRegular'});}});}}},jcir:{init:function()
{$.xLazyLoader({js:'http://22.scripts.sesamehost.com/scripts/jquery.jcIR.js',img:'images/pixel.gif',name:'jcIR',success:function(){$('.jcIR').jcIR({image_dir:'headings',image_ext:'.jpg',elem_width:'600',elem_height:'50'});}});}},navigation:{init:function()
{$.xLazyLoader({js:'http://21.scripts.sesamehost.com/scripts/superfish.js',name:'superfish',success:function(){}});}},tooltips:{init:function()
{$.xLazyLoader({js:'http://17.scripts.sesamehost.com/scripts/jquery.qtip-1.0.0-rc3.min.js',name:'qtip',success:function(){$.fn.qtip.styles.logins={width:306,background:'#fffef3',button:{'color':'white','font-weight':'bold'},color:'#3c0600',textAlign:'left',title:{'background':'#3c0600'},border:{width:3,radius:5,color:'#832117'},tip:'topRight',name:'dark'}
var drLoginForm=$('#dr-login-form');var drLoginTitle='Dental Sesame Doctor Login';$('#doctor-login').click(function(e){e.preventDefault();}).each(function(){$(this).qtip({content:{title:{text:drLoginTitle,button:'Close'},text:drLoginForm},show:{when:'click',solo:true},hide:{when:'click',fixed:true},style:'logins',position:{corner:{target:'bottomLeft',tooltip:'topRight'}}})});}});}}}
$(function(){$('#navigation>ul').superfish({hoverClass:'sfhover',delay:240,animation:{opacity:'show',height:'show'},autoArrows:false,disableHI:true});
$('#navigation>ul').superfish({hoverClass:'sfhover',delay:240,animation:{opacity:'show',height:'show'},autoArrows:false,disableHI:true});
$('#our-blog').attr('target','_self');$('#logo>a').hover(function(){$('#logo').css('background',' url(../../images/logohover.png) no-repeat');$('#logo').css('background-position','-19px 0px');},function(){$('#logo').css('background','url(../../images/tran.png)');});$('a.email').addClass('addicon').emailProt();globalLib.html_functions.init();globalLib.ie_functions.init();if($('.jcIR').length>0){globalLib.jcir.init();}
if($('ul#gallery').length>0){globalLib.gallery_view_tour.init();}
if($('#slideshow-home').length>0){globalLib.cycle_slideshow.init();}
if($('#cycle-office-tour').length>0){globalLib.cycle_tour.init();}
if($('#before-after-cycle').length>0){globalLib.cycle_before_after.init();}
if($('#slider-cycle').length>0){globalLib.slider_before_after.init();}
if($('ul#sesame-games').length>0){globalLib.games.init();}});
