window.onload = function(e)	{
	externalLinks();
	loadImages();

	$(function()
	{
		$('.scroll-pane').jScrollPane({showArrows:true, scrollbarWidth:18});
	});

}

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("class") == "out") {
		anchor.target = "_blank";
		}
	}
}

function loadImages()	 {
	
	im1 = new Image();
	im1.src = "images/before-over.png";
	im2 = new Image();
	im2.src = "images/latest-news-over.png";
	im3 = new Image();
	im3.src = "images/locations-over.png";
	im4 = new Image();
	im4.src = "images/mission-over.png";
	im5 = new Image();
	im5.src = "images/right-for-me-over.png";
	im6 = new Image();
	im6.src = "images/teeth-over.png";

	}

function checkKeyPress(box, formNum, size)	{
	if (box.value.length == size)	{
		if (box.name.substring(box.name.length - 1, box.name.length) != "4")	{
			eval("document.forms["+formNum+"]."+(box.name.substring(0, box.name.length - 1) + (parseInt(box.name.substring(box.name.length - 1, box.name.length)) +1))).focus();
			}
		}
	}

function openBeforeAfterWindow(numImages, url)	 {
	if (parseInt(numImages) == 2)	{
		window.open(url,"BeforeAfterImages","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=520,height=310,left=30,top=80");
		}
	else	{
		window.open(url,"BeforeAfterImages","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=770,height=310,left=30,top=80");
		}
	}

function openTeethBeforeAfterWindow(id)	 {
	window.open("teeth-whitening-before-after-image.php?id=" + id,"BeforeAfterImages","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=510,height=300,left=30,top=80");	}

function openDescriptionWindow(url)	 {
	window.open(url,"Description","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=400,height=400,left=30,top=80");
	}

