
//IE Hover Capability
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);


$(document).ready(function(){
	
	//jquery image replacement
	$.sifr({
		// save is true by default if sIFR is run without an element
		path: 'flash/', font: 'avenir.swf' 
	});
	$('h2.page-title').sifr({
		width: 524,
		height: 54,
		offsetTop: 17
	});
	$('h3.sidebar-title').sifr({
		width: 200,
		height: 18
	});

//misc functions
	//forms
	$('#message').fadeIn(1500);
	
	//hide items ith class="hidden"
	$('.hidden').css("display","none");


	//nospam emails...
	$('a.email').nospam({
      replaceText: true,    // BOOLEAN, optional default false. If set to true, replaces matched elements' text with the e-mail address
      filterLevel: 'normal' // STRING, optional accepts 'low' or 'normal', default 'normal'.
                            // low: email/domain/tld
                            // normal: dlt/niamod/liame (email/domain/tld reversed)
    });
	//png fix for IE
    $(document).pngFix(); 

	//Accessible Popups
	$('a[rel="external"]').click( function() {
        window.open( $(this).attr('href') );
        return false;
    });
	
	//clear form fields
	$('.clearme').one("focus", function() {
  		$(this).val("");
	});

	//toggle hidden form elements
	$("#Found").change(onSelectChange);
	
	//Hide div w/id extra
    $("#found-other").css("display","none");

	function onSelectChange(){  
		var selected = $("#Found option:selected");       
		if(selected.val() == 'Other'){  
            //show the hidden field
            $("#found-other").show("slow");
		} else {
			//otherwise, hide it 
            $("#found-other").hide("fast");		
		} 
	}  
//fancybox	
	$('a.img-right-mini,a.map').css("display","inline");
	$("#locate-us a, a.map").fancybox({ 
		'zoomSpeedIn': 500, 
		'zoomSpeedOut': 500, 
		'frameWidth': 500,
		'frameHeight': 500, 
		'overlayShow': true });
	$("a.newsletter").fancybox({ 
		'zoomSpeedIn': 500, 
		'zoomSpeedOut': 500, 
		'frameWidth': 640,
		'frameHeight': 500, 
		'overlayShow': true });
	
	//Invisalign Media Center
	$("a#invisalign-video").fancybox({
		'zoomSpeedIn':	500, 
		'zoomSpeedOut':	500,
		'frameWidth': 320,
		'frameHeight': 240, 
		'overlayShow':	true
	});
	
	//SureSmile Media Center
	$("a#suresmile-1, a#suresmile-2").fancybox({
		'zoomSpeedIn':	500, 
		'zoomSpeedOut':	500,
		'frameWidth': 350,
		'frameHeight': 300, 
		'overlayShow':	true
	});
	
	//SmartClip Media Center
	$("a#smartclip-2").fancybox({
		'zoomSpeedIn':	500, 
		'zoomSpeedOut':	500,
		'frameWidth': 360,
		'frameHeight': 280, 
		'overlayShow':	true
	});
	
	//iBraces Media Center
	$("a#ibraces-1, a#ibraces-2, a#ibraces-3").fancybox({
		'zoomSpeedIn':	500, 
		'zoomSpeedOut':	500,
		'frameWidth': 350,
		'frameHeight': 300, 
		'overlayShow':	true
	});

	//OrthoCAD Video
	$("a#orthocad-1").fancybox({
		'zoomSpeedIn':	500, 
		'zoomSpeedOut':	500,
		'frameWidth': 350,
		'frameHeight': 350, 
		'overlayShow':	true
	});


//flash embed

//home page flash
	$('#flash-home').flash(
		{ 
		  src: 'flash/home2.swf',
		  width: 780,
		  height: 208,
		  wmode: 'transparent'
		},
		{ version: 8 }
	);

//smile gallery sidebar flash
	$('#sidebar-gallery-flash').flash(
		{ 
		  src: 'flash/smile-gallery-button.swf',
		  width: 200,
		  height: 120,
		  wmode: 'transparent'
		},
		{ version: 8 }
	);



//flash modules

	//before-and-after
	$('#flash-before-after').flash(
		{ 
		src: 'flash/before-after.swf',
		width: 500,
		height: 375,
		wmode: 'transparent',
		  flashvars: { 
			//change value to false to pause on start
			autoPlay: 'false',
			//change hex color (default=639CCE)
			thisColor: '0x' + '555294',
			//change item value to false to omit
			caption01: 'Patient: Brenton',
			caption02: 'Patient: Jordan',
			caption03: 'Patient: Miranda',
			caption04: 'Patient: Robert',
			caption05: 'Patient: Tiffany',
			caption06: 'Patient: Violet'		  
			}
		},
		{ version: 8 }
	);
	//brushing-flossing
	$('#flash-brushing-and-flossing').flash(
		{ 
		src: 'flash/brushing-and-flossing.swf',
		width: 500,
		height: 300,
		wmode: 'transparent',
		  flashvars: { 
			//change value to false to pause on start
			autoPlay: 'false',
			//change hex color (default=639CCE)
			thisColor: '0x' + '555294',
			//change item value to false to omit
			brushing: 'true',
			flossing: 'true'
		  }
		},
		{ version: 8 }
	);
		
	//types of braces
	$('#flash-types-of-braces').flash(
		{ 
		  src: 'flash/types-of-braces.swf',
		  width: 500,
		  height: 300,
		  wmode: 'transparent',
		  flashvars: { 
			//change value to false to pause on start
			autoPlay: 'false',
			//change hex color (default=639CCE)
			thisColor: '0x' + '555294',
			//change item value to false to omit
			metal: 'true',
			gold: 'false',
			ceramic: 'true',
			invisible: 'false',
			lingual: 'false'
		  }
		},
		{ version: 8 }
	);
		
	//types of appliances
	$('#flash-types-of-appliances').flash(
		{ 
		  src: 'flash/types-of-appliances.swf',
		  width: 500,
		  height: 300,
		  wmode: 'transparent',
		  flashvars: { 
			//change value to false to pause on start
			autoPlay: 'false',
			//change hex color (default=639CCE)
			thisColor: '0x' + '555294',
			//change item value to false to omit
			elastics: 'true',
			headgear: 'false',
			herbst: 'true',
			palatal: 'false',
			positioners: 'false',
			separators: 'false'
		  }
		},
		{ version: 8 }
	);
		
	//common treatments
	$('#flash-common-treatments').flash(
		{ 
		  src: 'flash/common-treatments.swf',
		  width: 500,
		  height: 300,
		  wmode: 'transparent',
		  flashvars: { 
			//change value to false to pause on start
			autoPlay: 'false',
			//change hex color (default=639CCE)
			thisColor: '0x' + '555294',
			//change item value to false to omit
			crowding: 'true',
			openbite: 'true',
			deepOverbite: 'true',
			missing: 'true',
			underbite: 'true',
			spacing: 'true',
			overbite: 'true',
			nonBraces: 'true',
			phaseI: 'true'
		  }
		},
		{ version: 8 }
	);
	
	//palatal expander
	$('#flash-palatal-expander').flash(
		{ 
		  src: 'flash/palatal-expander.swf',
		  width: 200,
		  height: 150,
		  wmode: 'transparent'
		},
		{ version: 8 }
	);
	
	//braces diagram
	$('#flash-braces-diagram').flash(
		{ 
		  src: 'flash/braces-diagram.swf',
		  width: 500,
		  height: 375,
		  wmode: 'transparent',
		  flashvars: { 
			//change hex color (default=639CCE)
			thisColor: '0x' + '555294'
		  }
		},
		{ version: 8 }
	);
	
	//brace painter
	$('#flash-brace-painter').flash(
	  { 
		src: 'flash/brace-painter.swf',
		width: 500,
		height: 430,
		wmode: 'transparent'
	  },
	  { version: 8 }
	);

	//smartclip
	$('#flash-smartclip-1').flash(
	  { 
		src: 'flash/smartclip.swf',
		width: 250,
		height: 187,
		wmode: 'transparent'
	  },
	  { version: 8 }
	);

	$('#flash-smartclip-2').flash(
	  { 
		  src: 'video/flv-player.swf',
		  width: 360,
		  height: 270,
		  wmode: 'transparent',
		  flashvars: { FLVPath: 'smartclip-2.flv', SkinPath: 'video/SteelExternalAll.swf' }
	  },
	  { version: 8 }
	);

	//Emergency care 
	$('#flash-emergency-care').flash(
		{ 
		  src: 'flash/emergency-care.swf',
		  width: 500,
		  height: 300,
		  wmode: 'transparent',
		  flashvars: { 
			//change value to false to pause on start
			autoPlay: 'false',
			//change hex color (default=639CCE)
			thisColor: '0x' + '555294',
			//change item value to false to omit
			pokingWire: 'true',
			bracket: 'true',
			looseWire: 'true',
			appliance: 'true',
			headgear: 'true',
			soreness: 'true'
		  }
		},
		{ version: 8 }
	);

	//Invisalign
	
	//invisalign video
	$('#flash-invisalign').flash(
		{ 
		  src: 'video/flv-player.swf',
		  width: 320,
		  height: 240,
		  wmode: 'transparent',
		  flashvars: { FLVPath: 'invisalign.flv', SkinPath: 'video/SteelExternalAll.swf' }
		},
		{ version: 9 }
	);

	//SureSmile
	
	//suresmile video
	$('#flash-suresmile-1').flash(
		{ 
		  src: 'video/flv-player.swf',
		  width: 350,
		  height: 300,
		  wmode: 'transparent',
		  flashvars: { FLVPath: 'suresmile-1.flv', SkinPath: 'video/SteelExternalAll.swf' }
		},
		{ version: 9 }
	);

	$('#flash-suresmile-2').flash(
		{ 
		  src: 'video/flv-player.swf',
		  width: 350,
		  height: 300,
		  wmode: 'transparent',
		  flashvars: { FLVPath: 'suresmile-2.flv', SkinPath: 'video/SteelExternalAll.swf' }
		},
		{ version: 9 }
	);
	
	//iBraces
	
	$('#flash-ibraces-1').flash(
		{ 
		  src: 'video/flv-player.swf',
		  width: 350,
		  height: 300,
		  wmode: 'transparent',
		  flashvars: { FLVPath: 'ibraces-1.flv', SkinPath: 'video/SteelExternalAll.swf' }
		},
		{ version: 9 }
	);
	$('#flash-ibraces-2').flash(
		{ 
		  src: 'video/flv-player.swf',
		  width: 350,
		  height: 300,
		  wmode: 'transparent',
		  flashvars: { FLVPath: 'ibraces-2.flv', SkinPath: 'video/SteelExternalAll.swf' }
		},
		{ version: 9 }
	);
	$('#flash-ibraces-3').flash(
		{ 
		  src: 'video/flv-player.swf',
		  width: 350,
		  height: 300,
		  wmode: 'transparent',
		  flashvars: { FLVPath: 'ibraces-3.flv', SkinPath: 'video/SteelExternalAll.swf' }
		},
		{ version: 9 }
	);

	//OrthoCAD video
	$('#flash-orthocad').flash(
		{ 
		  src: 'video/flv-player.swf',
		  width: 350,
		  height: 350,
		  wmode: 'transparent',
		  flashvars: { FLVPath: 'orthocad.flv', SkinPath: 'video/SteelExternalAll.swf' }
		},
		{ version: 9 }
	);
		//patient care
	$('#flash-patient-care').flash(
		{ 
		  src: 'video/flash-pt-care.swf',
		  width: 500,
		  height: 375,
		  wmode: 'transparent',
		  flashvars: { 
			//change hex color (default=639CCE)
			thisColor: '0x' + '555294'
		  }
		},
		{ version: 8 }
	);

//smile gallery
$('#flash-gallery').flash(
		{ 
		  src: 'flash/gallery.swf',
		  width: 500,
		  height: 500,
		  wmode: 'transparent',
		  flashvars: { 
		  	autoPlay: 'false',
		  	thisColor: '0x' + '555294',
		  	caption01: 'Phase I with Upper/Lower Braces To Correct Crossbite and Make Room For Adult Teeth To Come In',
			caption02: 'Headgear w/ Full Braces To Correct Overbite',
			caption03: 'Full Phase Braces w/ Elastic Rubber Bands to Correct Crossbite',
			caption04: 'Upper/Lower Clear Braces To Correct Overbite and TMJ',
			caption05: 'Upper and Lower Braces To Correct Crowding',
			caption06: 'Upper/Lower Braces To Correct Overbite and Realign Teeth',
			caption07: 'Phase I- Palatal Expander & Upper Braces To Create Extra Room For Adult Teeth',
			caption08: 'Upper/Lower Braces To realign teeth and Close the Gap Between Front Teeth',
			caption09: 'Invisalign To  Close Gap Between Front Teeth',
			caption10: 'Phase I- Palatal Expander & Upper Braces To Correct Crossbite',
			caption11: 'Invisalign To Close The Gap between Front Teeth',
			caption12: 'Braces To Realign Teeth and Correct Crowding',
			caption13: 'Invisalign To Open the Bite and Realign Teeth',
			caption14: 'Invisalign To Correct Alignment of Upper and Lower teeth',
			caption15: 'Phase I w/ Palatal Expander To correct Crossbite',
			caption16: 'Phase I- Palatal Expander with Upper Braces To Make Room For Upper Lateral Incisors To Erupt',
			caption17: 'Upper/Lower Braces to Correct Overbite and Realign Front Teeth',
			caption18: 'Invisalign To Close Front Gap and Correct Overbite',
			caption19: 'Invisalign To Realign Teeth and Correct Crowding',
			caption20: 'Upper Braces with Headgear To Coordinate Growth of the Upper and Lower Jaws',
			caption21: 'Braces To Realign Teeth and Close Gaps',
			caption22: 'Full Phase Of Braces To Close the Bite, Realign All Adult Teeth, And Close the Gap',
			caption23: 'Palatal Expander To Create Extra Room For Adult Teeth',
			caption24: 'Full Phase Of Braces To Realign All The Teeth',
			caption25: 'Upper Braces To Correct Dental Crossbite',
			caption26: 'Upper Braces w/ Lower space Maintainer To Realign Front Teeth and save space For Future adult teeth',
			caption27: 'Full Phase of Braces To Close Open Bite',
			caption28: 'SmartClip- Self Ligating Braces To Correct Crowding',
			caption29: 'Palatal Expander Followed By Braces To Correct Crowding',
			caption30: 'Phase I- Palatal Expander & Upper Braces To Correct Crossbite',
			caption31: 'Bluegrass Appliance & Upper/Lower Braces To Correct The Overjet',
			caption32: 'Upper/Lower Braces To Place Teeth into Their Proper Position, Realign Gums, and Assist in The Restorative Process',
			caption33: 'Upper Braces with Headgear To Coordinate Upper and Lower Jaws Growth'
		  }
		},
		{ version: 8 }
	);

//staff photos
$('#flash-staff-photos').flash(
		{ 
		  src: 'flash/staff-photos.swf',
		  width: 500,
		  height: 375,
		  wmode: 'transparent',
		  flashvars: { 
		  	caption01: 'Janneris, Patricia, Jay, Maria, Anastasia',
			caption02: 'Maria, Janneris, Anastasia, Jay, Patricia',
			caption03: 'Maria',
			caption04: 'Maria, Jay, Anastasia, Patricia',
			caption05: 'Jay',
			caption06: 'Daniela, Monica, Gina, Lisa, Lois',
			caption07: 'Monica, Lisa, Gina, Lois, Daniela'
		  }
		},
		{ version: 8 }
	);

//office tour
$('#flash-office-tour').flash(
		{ 
		  src: 'flash/office-tour.swf',
		  width: 500,
		  height: 375,
		  wmode: 'transparent',
		  flashvars: { 
		  	caption01: 'Building',
			caption02: 'Reception Desk',
			caption03: 'Waiting Area',
			caption04: 'Internet Cafe',
			caption05: 'Video Game Table',
			caption06: 'Consultation Room',
			caption07: 'Treatment Room',
			caption08: 'Adult Treatment Area',
			caption09: 'Brushing Station',
			caption10: 'i-CAT',
			caption11: 'SureSmile',
			caption12: 'Sterilization',
			caption13: 'Laboratory'
		  }
		},
		{ version: 8 }
	);



//baseball sponsorship 2008
$('#flash-baseball-2008-photos').flash(
		{ 
		  src: 'flash/baseball-2008-photos.swf',
		  width: 500,
		  height: 375,
		  wmode: 'transparent',
		  flashvars: { 
		  	caption01: '',
			caption02: '',
			caption03: '',
			caption04: '',
			caption05: ''
		  }
		},
		{ version: 8 }
	);

//fall festival 2006
$('#flash-fall-festival-2006').flash(
		{ 
		  src: 'flash/fall-festival-2006-photos.swf',
		  width: 500,
		  height: 375,
		  wmode: 'transparent',
		  flashvars: { 
		  	caption01: '',
			caption02: '',
			caption03: '',
			caption04: '',
			caption05: '',
			caption06: '',
			caption07: '',
			caption08: '',
			caption09: '',
			caption10: '',
			caption11: '',
			caption12: '',
			caption13: '',
			caption14: '',
			caption15: '',
			caption16: '',
			caption17: '',
			caption18: '',
			caption19: '',
			caption20: '',
			caption21: '',
			caption22: '',
			caption23: '',
			caption24: '',
			caption25: '',
			caption26: '',
			caption27: '',
			caption28: '',
			caption29: '',
			caption30: '',
			caption31: '',
			caption32: ''
		  }
		},
		{ version: 8 }
	);

//lissy baby shower
$('#flash-lissy-baby-shower').flash(
		{ 
		  src: 'flash/lissy-baby-shower-photos.swf',
		  width: 500,
		  height: 375,
		  wmode: 'transparent',
		  flashvars: { 
		  	caption01: '',
			caption02: '',
			caption03: '',
			caption04: '',
			caption05: '',
			caption06: '',
			caption07: ''
		  }
		},
		{ version: 8 }
	);

//open house 2008
$('#flash-open-house-2008').flash(
		{ 
		  src: 'flash/open-house-2008-photos.swf',
		  width: 500,
		  height: 375,
		  wmode: 'transparent',
		  flashvars: { 
		  	caption01: '',
			caption02: '',
			caption03: '',
			caption04: '',
			caption05: '',
			caption06: '',
			caption07: '',
			caption08: '',
			caption09: '',
			caption10: '',
			caption11: '',
			caption12: '',
			caption13: '',
			caption14: '',
			caption15: '',
			caption16: '',
			caption17: '',
			caption18: '',
			caption19: '',
			caption20: '',
			caption21: '',
			caption22: '',
			caption23: '',
			caption24: ''
		  }
		},
		{ version: 8 }
	);

//spring fling 2006
$('#flash-spring-fling-2006').flash(
		{ 
		  src: 'flash/spring-fling-2006-photos.swf',
		  width: 500,
		  height: 375,
		  wmode: 'transparent',
		  flashvars: { 
		  	caption01: '',
			caption02: '',
			caption03: '',
			caption04: '',
			caption05: '',
			caption06: '',
			caption07: '',
			caption08: '',
			caption09: '',
			caption10: '',
			caption11: '',
			caption12: '',
			caption13: '',
			caption14: '',
			caption15: '',
			caption16: '',
			caption17: '',
			caption18: '',
			caption19: '',
			caption20: '',
			caption21: '',
			caption22: '',
			caption23: '',
			caption24: '',
			caption25: '',
			caption26: '',
			caption27: '',
			caption28: '',
			caption29: '',
			caption30: '',
			caption31: '',
			caption32: '',
			caption33: '',
			caption34: '',
			caption35: '',
			caption36: '',
			caption37: '',
			caption38: '',
			caption39: '',
			caption40: '',
			caption41: ''
		  }
		},
		{ version: 8 }
	);


});//end document.ready
