//IE Hover Capability
var 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
	//Accessible Popups
	$('a[rel="external"]').click( function() {
        window.open( $(this).attr('href') );
        return false;
    });
	
	//hide items ith class="hidden"
	$('.hidden').css("display","none");
	
	//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");								
	});


	
//flash embed

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

//flash modules

	//office tour
	$('#flash-office-tour').flash(
		{ 
		src: 'flash/flash-office-tour.swf',
		width: 400,
		height: 300,
		wmode: 'transparent'
		},
		{ version: 8 }
	);
	
	//common treatments
	$('#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' + '4C87AF',
			//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 }
	);
	
	//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' + '033B48',
			//change item value to false to omit
			brushing: 'true',
			flossing: 'true'
		  }
		},
		{ version: 8 }
	);
		
	//braces diagram
	$('#braces-diagram').flash(
		{ 
		  src: 'flash/braces-diagram.swf',
		  width: 500,
		  height: 375,
		  wmode: 'transparent',
		  flashvars: { 
			//change hex color (default=639CCE)
			thisColor: '0x' + '4C87AF'
		  }
		},
		{ version: 8 }
	);
	
	//brace painter
	$('#brace-painter').flash(
		{ 
		  src: 'flash/brace-painter.swf',
		  width: 500,
		  height: 430,
		  wmode: 'transparent'
		},
		{ version: 8 }
	);
	
	//oral care video
	$('#oral-care').flash(
		{ 
		  src: 'video/oral-care.swf',
		  width: 500,
		  height: 375,
		  wmode: 'transparent',
		  flashvars: { 
			//change hex color (default=639CCE)
			thisColor: '0x' + '4C87AF'
		  }
		},
		{ version: 8 }
	);
	
	//types of braces
	$('#types-of-braces').flash(
		{ 
		  src: 'flash/types-of-braces.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' + '4C87AF',
			//change item value to false to omit
			metal: 'true',
			gold: 'true',
			ceramic: 'true',
			missing: 'true',
			invisible: 'true',
			lingual: 'true'
			}
		},
		{ version: 8 }
	);
	
	//types of appliances
	$('#types-of-appliances').flash(
		{ 
		  src: 'flash/types-of-appliances.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' + '4C87AF',
			//change item value to false to omit
			metal: 'true',
			gold: 'true',
			ceramic: 'true',
			missing: '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

