// XHTML Strict External Links
sfHover = function() {
	var sfEls = document.getElementById("navigation").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);

function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href")&&
       anchor.getAttribute("rel")=="external")
     anchor.target = "_blank";
 }
}
window.onload = externalLinks;

//flash embed
$(document).ready(function(){

	// PNG Fixer Upper
	$(document).pngFix();

	//home page flash
	$('#flash-home').flash(
		{ 
		  src: 'home.swf',
		  width: 740,
		  height: 170,
		  wmode: 'transparent'
		},
		{ version: 8 }
	);
	
	//brushing and flossing
	$('#flash-brushing-and-flossing').flash(
		{ 
		src: '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' + '152B5E',
			//change item value to false to omit
			brushing: 'true',
			flossing: 'true'
		  }
		},
		{ version: 8 }
	);

	//color your retainer
	$('#flash-color-your-retainer').flash(
		{ 
		src: 'color-your-retainer.swf',
		width: 300,
		height: 300,
		wmode: 'transparent',
		  flashvars: { 
			//change value to false to pause on start
			autoPlay: 'false',
			//change hex color (default=639CCE)
			thisColor: '0x' + '152B5E'
		  }
		},
		{ version: 8 }
	);

	//orthodontic treatments
	$('#flash-orthodontic-treatments').flash(
		{ 
		  src: 'orthodontic-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' + '152B5E',
			//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 
	
	//comparison
	$('#flash-the-damon-system-comparison').flash(
		{ 
		  src: 'the-damon-system-comparison.swf',
		  width: 250,
		  height: 165,
		  wmode: 'transparent'
		},
		{ version: 7 }
	);
	
	//damon video
	$('#flash-the-damon-system').flash(
		{ 
		  src: 'video/flv-player.swf',
		  width: 300,
		  height: 275,
		  wmode: 'transparent',
		  flashvars: { FLVPath: 'the-damon-system.flv', SkinPath: 'video/SteelExternalAll.swf' }
		},
		{ version: 9 }
	);
	
	//for children slideshow 
	$('#flash-for-children').flash(
		{ 
		  src: 'for-children.swf',
		  width: 230,
		  height: 290,
		  wmode: 'transparent'
		},
		{ version: 9 }  
	);
	
	//for adults slideshow 
	$('#flash-for-adults').flash(
		{ 
		  src: 'for-adults.swf',
		  width: 230,
		  height: 290,
		  wmode: 'transparent'
		},
		{ version: 9 }
	);
	
	//token slideshow 
	$('#flash-token').flash(
		{ 
		  src: 'token.swf',
		  width: 230,
		  height: 290,
		  wmode: 'transparent'
		},
		{ version: 9 }
	);
	
	//for tmj slideshow 
	$('#flash-tmj').flash(
		{ 
		  src: 'tmj.swf',
		  width: 230,
		  height: 290,
		  wmode: 'transparent'
		},
		{ version: 9 }
	);
	
	//for appliances slideshow 
	$('#flash-appliances').flash(
		{ 
		  src: 'appliances.swf',
		  width: 230,
		  height: 290,
		  wmode: 'transparent'
		},
		{ version: 9 }
	);
	
	//for life slideshow 
	$('#flash-life').flash(
		{ 
		  src: 'life.swf',
		  width: 230,
		  height: 290,
		  wmode: 'transparent'
		},
		{ version: 9 }
	);
	
	//for links slideshow 
	$('#flash-links').flash(
		{ 
		  src: 'links.swf',
		  width: 230,
		  height: 290,
		  wmode: 'transparent'
		},
		{ version: 9 }
	);
	
	//for dictionary slideshow 
	$('#flash-dictionary').flash(
		{ 
		  src: 'dictionary.swf',
		  width: 230,
		  height: 290,
		  wmode: 'transparent'
		},
		{ version: 9 }
	);

	
	//the game room
	$("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: 432,
			  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: 398,
			  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 }
		);
	});
});