
//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(){
	
	

//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 });
	


	//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 }
	);
	

// jQuery Cycle Plugin
	$('.slideshow').cycle({
	pause: true,
	wmode: 'transparent'
	});
	
	// Duplicate the following block of code to add extra office tours
	$('#cycle-office-tour') // Give this ID a unique name if more than one office tour is needed on a page
	.before('<div class="office-tour-nav" id="office-1">') // Ditto for this ID
	.cycle({
	cleartype: true, // true if clearType corrections should be applied (for IE)
	cleartypeNoBg: true, // Set to true to disable extra cleartype fixing (leave false to force background color setting on slides)
	speed: 500, // This controls speed of transition
	timeout: 5000, // This controls delay between slides. Set to 0 if more than one office tour on a page, so they don't auto-play
	pager: '#office-1',
	before: function() {
	$('#caption span').fadeOut(); // Give this ID a unique name if more than one office tour is needed on a page
	},
	after: function(curr, next, opts) {
	var alt = $(next).find('img').attr('alt'); // This grabs the image alt text
	$('#caption span').html(alt).fadeIn(); // This puts alt text into the caption span
	}
	}); 


// Flash Video functions
					//-------------------------------------------------------------------------------
					
					var flashVideos = {
					
						defaults: {
						  // Define the configuation values applied to each module.
						  // Each module in flashModules can override these values.
						  
						  'src': 'video/flvPlayer.swf',
						  'dir': 'http://media.sesamehost.com/video/',//location of video and image files
						  'width': 320,
						  'height': 266,
						  'wmode': 'transparent',
						  'menu': false,
						  'allowFullScreen': true,
						  flashvars: {
						    'autoStart': 'false', // change value to true to play on start
						    'showScaleModes': 'false', //set to false to disable scale modes menu
						    'smoothVideo': 'true' //set to false to disable video smoothing 
						  }
						},
					
						videos: [
							{name: 'invisalign-best-friends', config: {'width': 320, 'height': 206}},
							{name: 'invisalign-news-travels-fast', config: {'width': 320, 'height': 206}},
							{name: 'invisalign-lobby', config:{}},
							{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: {
									//dir: 'video/',//override location of video and image file
									'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];
						// combine default config settings with module config settings
						var vidConfig = $.extend({}, flashVideos.defaults, video.config);
						// combine default flashvars with module flashvars
						vidConfig.flashvars = $.extend({}, flashVideos.defaults.flashvars, video.config.flashvars);
						vidConfig.flashvars.flvToPlay = vidConfig.dir + video.name + '.flv';
						vidConfig.flashvars.startImage = vidConfig.dir + video.name + '.jpg';
						$('#video-' + video.name).flash(vidConfig, flashVideos.defaults.pluginOptions);
					};
					
// NEW flash module

var flashModules = {
						
						defaults: {			
							'width': 500,
							'height': 300,
							'src': 'http://media.sesamehost.com/flash/',//default location of all Sesame flash mods
							'wmode': 'transparent',
							'flashvars': {
								'autoPlay': 'false', // change value to 'true'to play on start
								'thisColor': '0x' + '639CCE' // change global hex color (default=639CCE)
							},
							'express': 'flash/playerProductInstall.swf',
							'version':'9'
						},
					
					modules: [
					  // Define the configuration values for each flash module.
					  // Change item values in any 'flashvars' section to false to omit,
					  // Add any value to override the default value in flashModuleDefaults.
					  
					  {name: 'homepage', 
					  	config: {
					  		'src':'flash/',//uses local location; default is media.sesamehost.com
					  		'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: 'the-damon-system-comparison', config: {'width':250, 'height':165, 'wmode':'opaque'}},
					  
					  //old emergency care module
					  {name: 'emergency-care',
					    config: {
					      'flashvars': {
					        'pokingWire': 'true',
					        'bracket': 'true',
					        'looseWire': 'true',
					        'appliance': 'true',
					        'headgear': 'false',
					        'soreness': 'true'
					      }
					    }
					  },
					  
					  // Individual Emergency Care Animations //-----------------------------------------------
					  {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}},
  					  // End of animations
					  
					  {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/',//uses local location; default is media.sesamehost.com
					  		'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': 'false',
					        'separators': 'true'
					      }
					    }
					  },
					  
					  {name: 'types-of-braces',
					    config: {
					      'flashvars': {
					        'metal': 'true',
					        'gold': 'false',
					        'ceramic': 'true',
					        'invisible': 'true',
					        'lingual': 'false'
					      }
					    }
					  }
					]
					};
					
					// Loop through the defined modules 
					// and do flash replacement for any that are on the current page
					for (var j = flashModules.modules.length - 1; j >= 0; j--){
						var module = flashModules.modules[j];
						// combine default config settings with individual module config settings
						var modConfig = $.extend({}, flashModules.defaults, module.config);
						// combine default flashvars with module flashvars
						modConfig.flashvars = $.extend(flashModules.defaults.flashvars, module.config.flashvars);
						modConfig.src = modConfig.src + module.name + '.swf';
						$('#flash-' + module.name).flash(modConfig);
					}

//OLD 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 }
	);

	

	//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
	
	

	//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 }
	);





//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 }
	);

	//Toggle functions
	//---------------------------------------------------------------------------------
	// Show only when javascript is available
	$('#toggle-links').css('display','block');
	
	//hide lists first!
	$('#toggle-content dl').hide();
	
	//toggle
	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, // e.target grabs the node that triggered the event.
	$target = $(target); // wraps the node in a jQuery object
	var id = $target.attr('href')
	if (target.nodeName === 'A') {
	toggleInfoContent(id);
	}
	return false;
	});
	
	

	// Add the following block of code to the HTML/Utilities section //
	// Emergency Care toggle //----------------------------------
	//hide items first!
	$('#toggle-emergency div p').hide();
	//toggle
	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, // e.target grabs the node that triggered the event.
	$target = $(target); // wraps the node in a jQuery object
	var id = $target.attr('href')
	if (target.nodeName === 'A') {
	toggleEmergency(id);
	}
	return false;
	});
	//end toggle functions 
	
	//pretty

	$("a[rel^='prettyPhoto']").prettyPhoto({animationSpeed:'slow',theme:'facebook',slideshow:2000});

});//end document.ready

