$(document).ready(function(){
	$("a[rel^='prettyPhoto']").prettyPhoto({theme:'facebook'});
});


// PRELOAD SCRIPT

// -----------------------------------------------------------------------



function newImage(arg) {

	if (document.images) {

		rslt = new Image();

		rslt.src = arg;

		return rslt;

	}

}



function changeImages() {

	if (document.images && (preloadFlag == true)) {

		for (var i=0; i<changeImages.arguments.length; i+=2) {

			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];

		}

	}

}



var preloadFlag = false;

function preloadImages() {

	if (document.images) {

		header_rt_03_over = newImage("images/header_rt_03-over.gif");

		left_col_01_over = newImage("images/left_col_01-over.gif");

		utility_01_over = newImage("images/utility_01-over.gif");

		utility_02_over = newImage("images/utility_02-over.gif");

		utility_03_over = newImage("images/utility_03-over.gif");

		nav_01_over = newImage("images/nav_01-over.gif");

		nav_02_over = newImage("images/nav_02-over.gif");

		nav_03_over = newImage("images/nav_03-over.gif");

		nav_04_over = newImage("images/nav_04-over.gif");

		nav_05_over = newImage("images/nav_05-over.gif");

		subnav_ortho_01_over = newImage("images/subnav_ortho_01-over.gif");

		subnav_ortho_02_over = newImage("images/subnav_ortho_02-over.gif");

		subnav_ortho_03_over = newImage("images/subnav_ortho_03-over.gif");

		subnav_ortho_04_over = newImage("images/subnav_ortho_04-over.gif");

		subnav_ortho_05_over = newImage("images/subnav_ortho_05-over.gif");

		subnav_braces_01_over = newImage("images/subnav_braces_01-over.gif");

		subnav_braces_02_over = newImage("images/subnav_braces_02-over.gif");

		subnav_braces_03_over = newImage("images/subnav_braces_03-over.gif");

		subnav_braces_04_over = newImage("images/subnav_braces_04-over.gif");

		subnav_braces_05_over = newImage("images/subnav_braces_05-over.gif");

		subnav_braces_06_over = newImage("images/subnav_braces_06-over.gif");

		subnav_braces_07_over = newImage("images/subnav_braces_07-over.gif");

		subnav_braces_08_over = newImage("images/subnav_braces_08-over.gif");

		subnav_office_01_over = newImage("images/subnav_office_01-over.gif");

		subnav_office_02_over = newImage("images/subnav_office_02-over.gif");

		subnav_office_03_over = newImage("images/subnav_office_03-over.gif");

		preloadFlag = true;

	}

}







// SMILE GALLERY

// -----------------------------------------------------------------------



function smileGallery() { newWindow = window.open('smile_gallery.html','smile_gallery','width=300,height=500,titlebar=yes,scrollbar=yes'); }







// BRACES PAINTER

// -----------------------------------------------------------------------



function bracesPainter() { newWindow = window.open('about_braces_painter.html','bracesPainter','width=500,height=510,titlebar=yes,scrollbar=yes'); }







// ORAL CARE VIDEO

// -----------------------------------------------------------------------



function oralCareVideo() { newWindow = window.open('http://www.orthosesame.com/ptcare-video/video/choice.html','','scrollbars=no,resizable=no,width=500,height=500,left=10,top=10');}







// ORAL CARE VIDEO

// -----------------------------------------------------------------------



function contactMap() { newWindow = window.open('contact_map.html','','scrollbars=no,resizable=no,width=580,height=750,left=10,top=10');}







// OPEN WINDOW SCRIPT 02

// -----------------------------------------------------------------------



function morph01() {

window.open("morph01.html","","height=300,width=250,status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=yes,scrollbars=no, left=150,top=25");

}



function morph02() {

window.open("morph02.html","","height=300,width=250,status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=yes,scrollbars=no, left=150,top=25");

}



function morph03() {

window.open("morph03.html","","height=300,width=250,status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=yes,scrollbars=no, left=150,top=25");

}



function morph04() {

window.open("morph04.html","","height=300,width=250,status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=yes,scrollbars=no, left=150,top=25");

}



function morph05() {

window.open("morph05.html","","height=300,width=250,status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=yes,scrollbars=no, left=150,top=25");

}



function morph06() {

window.open("morph06.html","","height=300,width=250,status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=yes,scrollbars=no, left=150,top=25");

}



function morph07() {

window.open("morph07.html","","height=300,width=250,status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=yes,scrollbars=no, left=150,top=25");

}



function morph08() {

window.open("morph08.html","","height=300,width=250,status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=yes,scrollbars=no, left=150,top=25");

}



function morph09() {

window.open("morph09.html","","height=330,width=250,status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=yes,scrollbars=no, left=150,top=25");

}



function print_diagram() {

window.open("print_diagram.html","","height=500,width=475,status=no,toolbar=no,directories=no,menubar=yes,location=no,resizable=yes,scrollbars=yes, left=150,top=25");

}







// GAMES

// -----------------------------------------------------------------------

function MM_findObj(n, d) { //v4.0

  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);

  if(!x && document.getElementById) x=document.getElementById(n); return x;

}



function MM_openBrWindow(theURL,winName,features) { //v2.0

  window.open(theURL,winName,features);

}







// ROLLOVER

// -----------------------------------------------------------------------

function MM_preloadImages() { //v3.0

  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

}



function MM_swapImgRestore() { //v3.0

  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;

}



function MM_findObj(n, d) { //v4.0

  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);

  if(!x && document.getElementById) x=document.getElementById(n); return x;

}



function MM_swapImage() { //v3.0

  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)

   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

}