// IE Suckerfish Hover Fix
sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

// XHTML Strict External Links
function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href")&&
       anchor.getAttribute("rel")=="external")
     anchor.target = "_blank";
 }
}
window.onload = externalLinks;

// Jquery Variables
$(document).ready(function(){	   

// SimpleTip Tooltip



$("#new-patient-offer-link").simpletip({ 
// Configuration properties
content: 'Free Consultation and all necessary x-rays for all new patients!', position: 'bottom', offset: [5, 5]
});



// Flash Embedding

// Home Page Flash
	$('#flash-home').flash(
		{ 
		  src: 'swf/home.swf',
		  height: 157,
		  width: 384,
		  wmode: 'transparent'
		},
		{ version: 8 }
	);

// Hide Duplicate Sub Nav Items
$("body.smile-gallery #subnav li.first").hide();
$("body.our-team #subnav li.first").hide();
$("body.about-us #subnav li.first").hide();

// Columnizer Settings

	$('p').addClass("dontsplit");
	$('li').addClass("dontsplit");
	$('.columns').columnize(
		{
		  width: 250,
		  buildOnce: true,
		  lastNeverTallest: true
		}			
	);
// Office Tour
$('#slideshow').cycle({ 
    fx:     'fade', 
    speed:  'fast', 
    timeout: 0, 
    pager:  '#slideshow-nav',
	before: function() {  
	$('#caption').html(this.alt); 
	},
	pagerAnchorBuilder: function(idx, slide) { 
	return '<li><a href="#"><img src="' + slide.src + '" height="80" width="80" /></a></li>'; 
	} 
});

// wrap img.caption in a div and use the title attr as a caption  
	$("#content img.caption").each(function (i) {
		var $this = $(this);
		var caption = $this.attr('title');
		var width = $this.attr('width') + 10;
		$this.wrap('<div class="inset" style="width:'+width+'px;"></div>').after("<p>" + caption + "</p>");
	});
	
	
	
	
	

});// End Jquery Variables