//JQuery Setup
$(document).ready(function(){
  
  //IE6 hover capability
  if (jQuery.browser.msie) {
    $('#nav li').hover(
      function() {
        $(this).addClass("sfhover");
      },
      function() {
        $(this).removeClass("sfhover");
      }
    );
  }

  //png fix for IE6
  $(document).pngFix();
	
  //sifr
  $.sifr({ 
    font: 'flash/pointedbrush.swf', 
    color: '#8f0059',
    textAlign: 'left'});
  $('.home h2').sifr();
  $('#content h1').sifr();
  
	//clear form fields
	$('.clearme').one("focus", function() {
  		$(this).val("");
	});

  //home page flash
  $('#flash_home').flash(
  { 
	  src: 'flash/homepage.swf',
	  width: 570,
	  height: 230,
	  wmode: 'transparent'
	},
	{ 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' + '0c8395',
			//change item value to false to omit
			metal: 'true',
			gold: 'true',
			ceramic: 'true',
			invisible: 'true',
			lingual: 'false'
		  }
		},
		{ 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' + '0C8395',
			//change item value to false to omit
			brushing: 'true',
			flossing: 'true'
		  }
		},
		{ 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' + '0C8395',
			//change item value to false to omit
			elastics: 'true',
			headgear: 'true',
			herbst: 'true',
			palatal: 'true',
			positioners: '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' + '0C8395',
			//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' + '0C8395'
		  }
		},
		{ version: 8 }
	);
	
	//brace painter
	$('#flash-brace-painter').flash(
	  { 
		src: 'flash/brace-painter.swf',
		width: 500,
		height: 430,
		wmode: 'transparent'
	  },
	  { version: 8 }
	);

	//color your retainer
	$('#flash-color-your-retainer').flash(
	  { 
		src: 'flash/color-your-retainer.swf',
		width: 300,
		height: 300,
		wmode: 'transparent',
    flashvars: { 
			//change hex color (default=639CCE)
			thisColor: '0x' + '0C8395'
		  }
	  },
	  { version: 8 }
	);

	//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' + '0C8395'
		  }
	  },
	  { 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' + '0C8395',
        //change item value to false to omit
        pokingWire: 'true',
        bracket: 'true',
        looseWire: 'true',
        appliance: 'true',
        headgear: 'true',
        soreness: 'true'
		  }
		},
		{ version: 8 }
  );
  
  	//games
	$("a.asteroids").click(function() {
		$('#sesame-game').flash(
			{ 
			  src: 'games/asteroids.swf',
			  width: 400,
			  height: 300,
			  wmode: 'transparent'
			},
			{ version: 8 }
		);
    $('#sidebar img').addClass("resize");
	});
	$("a.frogger").click(function() {
		$('#sesame-game').flash(
			{ 
			  src: 'games/frogger.swf',
			  width: 400,
			  height: 300,
			  wmode: 'transparent'
			},
			{ version: 8 }
		);
    $('#sidebar img').addClass("resize");
	});	$("a.pong").click(function() {
		$('#sesame-game').flash(
			{ 
			  src: 'games/pong.swf',
			  width: 400,
			  height: 300,
			  wmode: 'transparent'
			},
			{ version: 8 }
		);
    $('#sidebar img').addClass("resize");
	});
	$("a.simon").click(function() {
		$('#sesame-game').flash(
			{ 
			  src: 'games/simon.swf',
			  width: 400,
			  height: 300,
			  wmode: 'transparent'
			},
			{ version: 8 }
		);
    $('#sidebar img').addClass("resize");
	});
	$("a.snake").click(function() {
		$('#sesame-game').flash(
			{ 
			  src: 'games/snake.swf',
			  width: 400,
			  height: 300,
			  wmode: 'transparent'
			},
			{ version: 8 }
		);
    $('#sidebar img').addClass("resize");
	});
	$("a.space-invaders").click(function() {
		$('#sesame-game').flash(
			{ 
			  src: 'games/space-invaders.swf',
			  width: 400,
			  height: 300,
			  wmode: 'transparent'
			},
			{ version: 8 }
		);
    $('#sidebar img').addClass("resize");
	});
	$("a.tetris").click(function() {
		$('#sesame-game').flash(
			{ 
			  src: 'games/tetris.swf',
			  width: 400,
			  height: 300,
			  wmode: 'transparent'
			},
			{ version: 8 }
		);
    $('#sidebar img').addClass("resize");
	});
	$("a.tic-tac-toe").click(function() {
		$('#sesame-game').flash(
			{ 
			  src: 'games/tic-tac-toe.swf',
			  width: 400,
			  height: 300,
			  wmode: 'transparent'
			},
			{ version: 8 }
		);
    $('#sidebar img').addClass("resize");
	});

	//office tour
	$('#flash-office-tour').flash(
		{ 
		  src: 'flash/office-tour.swf',
		  width: 500,
		  height: 375,
		  wmode: 'transparent',
		  flashvars: { 
			//change value to false to pause on start
			autoPlay: 'false',
			//set captions for each slide or leave blank if none
      caption01: "",
      caption02: "",
      caption03: "",
      caption04: "",
      caption05: "",
      caption06: ""
		  }
		},
		{ version: 8 }
	);

  //google maps FancyBox
	$("a.fancy").fancybox({ 
		'zoomSpeedIn': 0, 
		'zoomSpeedOut': 0,
		'frameWidth': 430,
		'frameHeight': 380, 
		'overlayShow': true }
  );


});//end document.ready