
//jQuery elements
$(document).ready(function(){
						 
//Global variables

//change hex for flash bg color (default=639CCE)
var flashBg="436386";
						   
//misc functions
	//Accessible Popups
	$('a[rel="external"]').click( function() {
        window.open( $(this).attr('href') );
        return false;
    });
	
	//Hide div w/id extra
    $("#anatomy-of-a-tooth, #flash-know-your-teeth").css("display","none");
	//toggles anatomy of a tooth div
	$(".show-anatomy").click(function() {
		$("#anatomy-of-a-tooth").toggle("slow");								
	});
	
	$(".show-teeth").click(function() {
		$("#flash-know-your-teeth").toggle("slow");								
	});
	
	//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("slow");		
		} 
	}  
	
//FANCYBOX
 $("a.form-icon").fancybox({ 
	'zoomSpeedIn': 300, 
	'zoomSpeedOut': 300, 
	'overlayShow': true,
	'frameHeight': 600,
	'frameWidth': 700
}); 
 
//IE6 hover capability
  if (jQuery.browser.msie) {
    $('#nav li').hover(
      function() {
        $(this).addClass("sfhover");
      },
      function() {
        $(this).removeClass("sfhover");
      }
    );
  }

//flash embed

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

//flash modules

	//brace painter
	$('#flash-brace-painter').flash(
		{ 
		  src: 'flash/brace-painter.swf',
		  width: 500,
		  height: 430,
		  wmode: 'transparent'
		},
		{ version: 8 }
	);
	
	//braces diagram
	$('#flash-braces-diagram').flash(
		{ 
		  src: 'flash/braces-diagram.swf',
		  width: 480,
		  height: 360,
		  wmode: 'transparent',
		  flashvars: { 
			//see global variables at top for flash background color
			thisColor: '0x' + flashBg
		  }
		},
		{ version: 8 }
	);
	
	//brushing and flossing
	$('#flash-brushing-and-flossing').flash(
		{ 
		src: 'flash/brushing-and-flossing.swf',
		width: 480,
		height: 288,
		wmode: 'transparent',
		flashvars: { 
			//change value to false to pause on start
			autoPlay: 'false',
			//see global variables at top for flash background color
			thisColor: '0x' + flashBg,
			//change item value to false to omit
			brushing: 'true',
			flossing: 'true'
			}
		},
		{ version: 8 }
	);
	
	//color your retainer
	$('#flash-color-your-retainer').flash(
		{ 
		  src: 'flash/color-your-retainer.swf',
		  width: 300,
		  height: 300,
		  wmode: 'transparent',
		  flashvars: { 
			//change value to false to pause on start
			autoPlay: 'false',
			//see global variables at top for flash background color
			thisColor: '0x' + flashBg
			}
		},
		{ version: 8 }
	);
	
	//common treatments
	$('#flash-common-treatments').flash(
		{ 
		src: 'flash/common-treatments.swf',
		width: 480,
		height: 288,
		wmode: 'transparent',
		flashvars: { 
			//change value to false to pause on start
			autoPlay: 'false',
			//see global variables at top for flash background color
			thisColor: '0x' + flashBg,
			//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 }
	);
	
	//damon system
	$('#flash-the-damon-system').flash(
		{ 
		  src: 'video/flv-player.swf',
		  width: 300,
		  height: 275,
		  wmode: 'transparent',
		  flashvars: { 
			//paths to skin & player
			FLVPath: 'the-damon-system.flv',
			SkinPath: 'video/SteelExternalAll.swf'
		  }
		},
		{ version: 8 }
	);
	
	//damon system comparison
	$('#flash-the-damon-system-comparison').flash(
		{ 
		  src: 'flash/the-damon-system-comparison.swf',
		  width: 250,
		  height: 165,
		  wmode: 'transparent'
		},
		{ version: 8 }
	);
	
	//emergency care
	$('#flash-emergency-care').flash(
		{ 
		  src: 'flash/emergency-care.swf',
		  width: 480,
		height: 288,
		  wmode: 'transparent',
		  flashvars: { 
		  	//change value to false to pause on start
			autoPlay: 'false',
			//see global variables at top for flash background color
			thisColor: '0x' + flashBg,
			//change item value to false to omit
			pokingWire: 'true',
			bracket: 'true',
			looseWire: 'true',
			appliance: 'true',
			headgear: 'true',
			soreness: 'true'
		  }
		},
		{ version: 8 }
	);

// iBraces elements	
	//ibraces logo
	$('#flash-ibraces-logo').flash(
		{ 
		  src: 'flash/ibraces-logo.swf',
		  width: 200,
		  height: 135,
		  wmode: 'transparent'
		},
		{ version: 8 }
	);
	
	//ibraces video 1
	$('#flash-ibraces-1').flash(
		{ 
		  src: 'video/flv-player.swf',
		  width: 320,
		  height: 285,
		  wmode: 'transparent',
		  flashvars: { 
			//paths to skin & player
			FLVPath: 'ibraces-1.flv',
			SkinPath: 'video/SteelExternalAll.swf'
		  }
		},
		{ version: 8 }
	);
	
	//ibraces video 2
	$('#flash-ibraces-2').flash(
		{ 
		  src: 'video/flv-player.swf',
		  width: 350,
		  height: 280,
		  wmode: 'transparent',
		  flashvars: { 
			//paths to skin & player
			FLVPath: 'ibraces-2.flv',
			SkinPath: 'video/SteelExternalAll.swf'
		  }
		},
		{ version: 8 }
	);
	
	//ibraces video 3
	$('#flash-ibraces-3').flash(
		{ 
		  src: 'video/flv-player.swf',
		  width: 350,
		  height: 280,
		  wmode: 'transparent',
		  flashvars: { 
			//paths to skin & player
			FLVPath: 'ibraces-3.flv',
			SkinPath: 'video/SteelExternalAll.swf'
		  }
		},
		{ version: 8 }
	);
	
	//In-Ovation
	$('#flash-in-ovation').flash(
		{ 
		  src: 'video/flv-player.swf',
		  width: 320,
		  height: 285,
		  wmode: 'transparent',
		  flashvars: { 
			//paths to skin &amp; player
			FLVPath: 'in-ovation.flv',
			SkinPath: 'video/SteelExternalAll.swf'
		  }
		},
		{ version: 8 }
	);
	
	//know your teeth
	$('#flash-know-your-teeth').flash(
		{ 
		  src: 'flash/know-your-teeth.swf',
		  width: 500,
		  height: 400,
		  wmode: 'transparent'
		},
		{ version: 8 }
	);
	
	//office tour flash
	$('#flash-office-tour').flash(
		{ 
		  src: 'flash/office-tour.swf',
		  width: 480,
		  height: 360,
		  wmode: 'transparent',
		  flashvars: { 
			//change value to false to pause on start
			autoPlay: 'false',
			//change item value to false to omit
			caption01: 'Front door Suite 107-Let the Adventure begin!',
			caption02: 'Our Team L to R Lorna, Serrena, Roz, Dr D, Shannie, Tina',
			caption03: 'Convenient parking behind our office',
			caption04: 'Additional parking on upper level',
			caption05: 'Serrena taking your call at the front desk',
			caption06: 'Serrena scheduling appointment',
			caption07: 'Ed surfs the web at the Internet station',
			caption08: 'Video games-reception area',
			caption09: 'Roz in our modern lab',
			caption10: 'Roz placing final details on a retainer in our lab',
			caption11: 'Close up of a retainer',
			caption12: 'On deck area in our treatment room',
			caption13: 'Tooth brushing station near the on-deck area',
			caption14: 'Shannie sterilizing instruments',
			caption15: 'The team in the treatment area',
			caption16: 'Dr D explaining treatment',
			caption17: 'Dr D in our exam room',
			caption18: 'Roz taking a digital panoramic X-ray on Serrena',
			caption19: 'Roz taking digital photos on Shannie',
			caption20: 'Tina setting up a digital cephalometric-head X-ray',
			caption21: 'Dr D and Tina position a digital periapical X-ray',
			caption22: 'Tina does a SureSmile scan on Serrena',
			caption23: 'Lorna doing computer work on cases'
			}
		},
		{ version: 8 }
	);
	
	//patient care video
	$('#flash-patient-care').flash(
		{ 
		  src: 'video/flash-pt-care.swf',
		  width: 480,
		  height: 360,
		  wmode: 'transparent',
		  flashvars: { 
			//see global variables at top for flash background color
			thisColor: '0x' + flashBg
		  }
		},
		{ version: 8 }
	);
	
	//palatal expander
	$('#flash-palatal-expander').flash(
		{ 
		  src: 'flash/palatal-expander.swf',
		  width: 200,
		  height: 150,
		  wmode: 'transparent'
		},
		{ version: 8 }
	);
	
	//patient smiles
	$('#flash-patient-smiles').flash(
		{ 
		  src: 'flash/patient-smiles.swf',
		  width: 480,
		  height: 360,
		  wmode: 'transparent',
		  flashvars: { 
			//change value to false to pause on start
			autoPlay: 'false',
			//change item value to false to omit
			caption01: 'Shayna Zablan',
			caption02: 'Kayse Silva',
			caption03: 'Keli Jo',
			caption04: 'Chelsie Sagadraca',
			caption05: 'Allison Lanser',
			caption06: 'Padiong',
			caption07: 'Otomo Family',
			caption08: 'Edgar Cabrera',
			caption09: 'Bowers Family',
			caption10: 'Courtnie Arconado',
			caption11: 'Elijah & Liana',
			caption12: 'Lauren Ayala',
			caption13: 'Ashley Branco',
			caption14: 'Leslee Ann Barclay',
			caption15: 'Liana Cabiles',
			caption16: 'Dana Pagan',
			caption17: 'LiAnne Coon',
			caption18: 'Lei Nani Hong',
			caption19: 'Heather Fung',
			caption20: 'Chris Kodani',
			caption21: 'Aja Lee Pedro-Moniz',
			caption22: 'Celina Ortiz',
			caption23: 'Harley Nardella',
			caption24: 'Danielle Cunningham',
			caption25: 'Danielle Tam Sing'
			}
		},
		{ version: 8 }
	);
	
	//smile gallery
	$('#flash-smile-gallery').flash(
		{ 
		src: 'flash/flash-smile-gallery.swf',
		width: 480,
		height: 288,
		wmode: 'transparent',
		flashvars: { 
			//change value to false to pause on start
			autoPlay: 'false',
			//see global variables at top for flash background color
			thisColor: '0x' + flashBg,
			//change item value to false to omit
			bonding: 'true',
			bridges: 'true',
			crowns: 'true',
			fillings: 'true',
			implants: 'true',
			invisalign: 'true',
			veneers: 'true',
			whitening: 'true'
			}
		},
		{ version: 8 }
	);
	
	//suresmile video 1
	$('#flash-suresmile-1').flash(
		{ 
		  src: 'video/flv-player.swf',
		  width: 320,
		  height: 285,
		  wmode: 'transparent',
		  flashvars: { 
			//paths to skin &amp; player
			FLVPath: 'suresmile-1.flv',
			SkinPath: 'video/SteelExternalAll.swf'
		  }
		},
		{ version: 8 }
	);
	
	//suresmile video 2
	$('#flash-suresmile-2').flash(
		{ 
		  src: 'video/flv-player.swf',
		  width: 320,
		  height: 285,
		  wmode: 'transparent',
		  flashvars: { 
			//paths to skin & player
			FLVPath: 'suresmile-2.flv',
			SkinPath: 'video/SteelExternalAll.swf'
		  }
		},
		{ version: 8 }
	);
	
	//types of appliances
	$('#flash-types-of-appliances').flash(
		{ 
		src: 'flash/types-of-appliances.swf',
		width: 480,
		height: 288,
		wmode: 'transparent',
		flashvars: { 
			//change value to false to pause on start
			autoPlay: 'false',
			//see global variables at top for flash background color
			thisColor: '0x' + flashBg,
			//change item value to false to omit
			elastics: 'true',
			headgear: 'true',
			palatal: 'true',
			positioners: 'true',
			retainers: 'true',
			separators: 'true'
			}
		},
		{ version: 8 }
	);
	
	//types of braces
	$('#flash-types-of-braces').flash(
		{ 
		src: 'flash/types-of-braces.swf',
		width: 480,
		height: 288,
		wmode: 'transparent',
		flashvars: { 
			//change value to false to pause on start
			autoPlay: 'false',
			//see global variables at top for flash background color
			thisColor: '0x' + flashBg,
			//change item value to false to omit
			metal: 'true',
			gold: 'true',
			ceramic: 'true',
			invisible: 'true',
			lingual: 'true'
			}
		},
		{ version: 8 }
	);
	

//games
	$("a.asteroids").click(function() {
		$('#sesame-game').flash(
			{ 
			  src: 'games/asteroids.swf',
			  width: 400,
			  height: 300,
			  wmode: 'transparent'
			},
			{ version: 8 }
		);
	});
	$("a.frogger").click(function() {
		$('#sesame-game').flash(
			{ 
			  src: 'games/frogger.swf',
			  width: 400,
			  height: 300,
			  wmode: 'transparent'
			},
			{ version: 8 }
		);
	});	$("a.pong").click(function() {
		$('#sesame-game').flash(
			{ 
			  src: 'games/pong.swf',
			  width: 400,
			  height: 300,
			  wmode: 'transparent'
			},
			{ version: 8 }
		);
	});
	$("a.simon").click(function() {
		$('#sesame-game').flash(
			{ 
			  src: 'games/simon.swf',
			  width: 400,
			  height: 300,
			  wmode: 'transparent'
			},
			{ version: 8 }
		);
	});
	$("a.snake").click(function() {
		$('#sesame-game').flash(
			{ 
			  src: 'games/snake.swf',
			  width: 400,
			  height: 300,
			  wmode: 'transparent'
			},
			{ version: 8 }
		);
	});
	$("a.space-invaders").click(function() {
		$('#sesame-game').flash(
			{ 
			  src: 'games/space-invaders.swf',
			  width: 400,
			  height: 300,
			  wmode: 'transparent'
			},
			{ version: 8 }
		);
	});
	$("a.tetris").click(function() {
		$('#sesame-game').flash(
			{ 
			  src: 'games/tetris.swf',
			  width: 400,
			  height: 300,
			  wmode: 'transparent'
			},
			{ version: 8 }
		);
	});
	$("a.tic-tac-toe").click(function() {
		$('#sesame-game').flash(
			{ 
			  src: 'games/tic-tac-toe.swf',
			  width: 400,
			  height: 300,
			  wmode: 'transparent'
			},
			{ version: 8 }
		);
	});
	
});//end document.ready