//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;
    });
	
	$('#nav').accordion({
			active: false,
			header: '.head',
			navigation: true,
			fillSpace: false,
			animated: 'easeslide'
		});
	
		//video
	$('#video-office-news').flash(
		{ 
			src: 'video/flvPlayer.swf',
		  width: 350,
		  height: 290,
		  wmode: 'transparent',
		  allowFullScreen: true,
		  smoothVideo: true,
		  flashvars:
		  {
		  	flvToPlay: "office-news.flv",
		  	scaleMode: "full",
      	hiddenGui: false,
      	showScaleModes: false,
      	autoStart: false,
      	startImage: "video/office-news.jpg"
		  }
		},
		{ version: 9 }
	);	
		
	
	//fancybox
	$("p.fancy a").fancybox(
		{
		  'zoomSpeedIn': 0,
		  'zoomSpeedOut': 0,
		  'overlayShow': true
		}
	);


	//Hide div w/id extra
    $("#office-tour-eldersburg, #office-tour-hampstead, #office-tour-mt-airy, #office-tour-taneytown, #office-tour-westfriendship, #office-tour-westminster").css("display","none");
	//toggles anatomy of a tooth div
	$(".show-eldersburg").click(function() {
		$("#office-tour-eldersburg").toggle("slow");								
	});
	
	$(".show-hampstead").click(function() {
		$("#office-tour-hampstead").toggle("slow");								
	});
	
	$(".show-mt-airy").click(function() {
		$("#office-tour-mt-airy").toggle("slow");								
	});
	
	$(".show-taneytown").click(function() {
		$("#office-tour-taneytown").toggle("slow");								
	});
	
	$(".show-westfriendship").click(function() {
		$("#office-tour-westfriendship").toggle("slow");								
	});
	
	$(".show-westminster").click(function() {
		$("#office-tour-westminster").toggle("slow");								
	});
	
//flash embed

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

//flash modules

	//office tour flash
	$('#office-tour-eldersburg').flash(
		{ 
		  src: 'flash/office-tour-eldersburg.swf',
		  width: 500,
		  height: 375,
		  wmode: 'transparent',
		  flashvars: { 
			//change value to false to pause on start
			autoPlay: 'false',
			//photo captions
			caption01: '',
			caption02: '',
			caption03: '',
			caption04: '',
			caption05: '',
			caption06: ''
			}
		},
		{ version: 8 }
	);
	
	$('#office-tour-hampstead').flash(
		{ 
		  src: 'flash/office-tour-hampstead.swf',
		  width: 500,
		  height: 375,
		  wmode: 'transparent',
		  flashvars: { 
			//change value to false to pause on start
			autoPlay: 'false',
			//change item value to false to omit
			caption01: '',
			caption02: '',
			caption03: '',
			caption04: '',
			caption05: ''
			}
		},
		{ version: 8 }
	);
	
	$('#office-tour-mt-airy').flash(
		{ 
		  src: 'flash/office-tour-mt-airy.swf',
		  width: 500,
		  height: 375,
		  wmode: 'transparent',
		  flashvars: { 
			//change value to false to pause on start
			autoPlay: 'false',
			//change item value to false to omit
			caption01: '',
			caption02: '',
			caption03: '',
			caption04: '',
			caption05: '',
			caption06: ''
			}
		},
		{ version: 8 }
	);
	
	$('#office-tour-taneytown').flash(
		{ 
		  src: 'flash/office-tour-taneytown.swf',
		  width: 500,
		  height: 375,
		  wmode: 'transparent',
		  flashvars: { 
			//change value to false to pause on start
			autoPlay: 'false',
			//change item value to false to omit
			caption01: '',
			caption02: '',
			caption03: '',
			caption04: '',
			caption05: '',
			caption06: ''
			}
		},
		{ version: 8 }
	);
	
	$('#office-tour-westfriendship').flash(
		{ 
		  src: 'flash/office-tour-westfriendship.swf',
		  width: 500,
		  height: 375,
		  wmode: 'transparent',
		  flashvars: { 
			//change value to false to pause on start
			autoPlay: 'false',
			//change item value to false to omit
			caption01: '',
			caption02: '',
			caption03: '',
			caption04: '',
			caption05: '',
			caption06: ''
			}
		},
		{ version: 8 }
	);
	
	$('#office-tour-westminster').flash(
		{ 
		  src: 'flash/office-tour-westminster.swf',
		  width: 500,
		  height: 375,
		  wmode: 'transparent',
		  flashvars: { 
			//change value to false to pause on start
			autoPlay: 'false',
			//change item value to false to omit
			caption01: '',
			caption02: '',
			caption03: '',
			caption04: '',
			caption05: ''
			}
		},
		{ 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' + '67BDEA',
			//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' + '67BDEA',
			//change item value to false to omit
			elastics: 'true',
			headgear: 'true',
			palatal: 'true',
			positioners: 'true',
			retainers: 'true',
			separators: 'true'
			}
		},
		{ 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' + '67BDEA',
			//change item value to false to omit
			crowding: 'true',
			openbite: 'true',
			deepOverbite: 'true',
			missing: 'true',
			underbite: 'true',
			spacing: 'true',
			overbite: 'true',
			nonBraces: 'false',
			phaseI: 'true'
			}
		},
		{ version: 8 }
	);
	
	//brushing and flossing
	$('#flash-brushing-flossing').flash(
		{ 
		src: 'flash/brushing-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' + '67BDEA',
			//change item value to false to omit
			brushing: 'true',
			flossing: 'true'
			}
		},
		{ 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' + '67BDEA',
			//change item value to false to omit
			pokingWire: 'true',
			bracket: 'true',
			looseWire: 'true',
			appliance: 'true',
			headgear: 'true',
			soreness: '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' + '2C6A8C'
		  }
		},
		{ version: 8 }
	);
	
	//brace painter
	$('#flash-brace-painter').flash(
		{ 
		  src: 'flash/brace-painter.swf',
		  width: 500,
		  height: 430,
		  wmode: 'transparent'
		},
		{ 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 }
	);
	
	//damon system
	$('#flash-the-damon-system').flash(
		{ 
		  src: 'video/flv-player.swf',
		  width: 250,
		  height: 229,
		  wmode: 'transparent',
		  flashvars: { 
			//paths to skin & player
			FLVPath: 'the-damon-system.flv',
			SkinPath: 'video/SteelExternalAll.swf'
		  }
		},
		{ 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
