

//---------------------IE Hover Capability
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(){

//--------------------JQuery Setup

// Accordian Navigation

$('#menu').accordion({ 
    header: 'a.title',
    active: false,
    navigation: true,
    fillSpace: false,
    animated: false
});

// original
// jQuery('#menu').accordion({ 
//     header: 'div.title', 
//     active: false, 
//     alwaysOpen: false, 
//     animated: false, 
//     autoheight: false
// });


//misc functions

	//Accessible Popups
	$('a[rel="external"]').click( function() {
        window.open( $(this).attr('href') );
        return false;
    });
	
	//clear form fields
	$('.clearme').one("focus", function() {
  		$(this).val("");
	});
//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");	
} 
}
//flash embed

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

//flash modules

	//before-and-after
	$('#flash-before-after').flash(
		{ 
		src: 'flash/before-after.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' + '9ab99a',
			//change item value to false to omit
			caption01: 'Patient: Brenton',
			caption02: 'Patient: Jordan',
			caption03: 'Patient: Miranda',
			caption04: 'Patient: Robert',
			caption05: 'Patient: Tiffany',
			caption06: 'Patient: Violet'		  
			}
		},
		{ version: 8 }
	);

	//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',
			//change hex color (default=639CCE)
			thisColor: '0x' + '9ab99a',
			//change item value to false to omit
			caption01: 'Exterior',
			caption02: 'Reception',
			caption03: 'Office',
			caption04: 'Treatment Area',
			caption05: 'Treatment Area',
			caption06: 'Treatment Area',		  
			caption07: 'Sterilization Area'
			}
		},
		{ 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' + '9ab99a',
			//change item value to false to omit
			brushing: 'true',
			flossing: 'true'
		  }
		},
		{ version: 8 }
	);
//know your teeth
	$('#flash-know-your-teeth').flash(
		{ 
		src: 'flash/know-your-teeth.swf',
		width: 500,
		height: 400,
		wmode: 'transparent'
		},
		{ version: 8 }
	);

//smile-gallery
	$('#flash-smile-gallery').flash(
		{ 
		src: 'flash/smile-gallery.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' + '9ab99a',
			//change item value to false to omit
			brushing: 'true',
			flossing: 'true'
		  }
		},
		{ 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' + '9ab99a',
			//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' + '9ab99a',
			//change item value to false to omit
			elastics: 'true',
			headgear: 'false',
			herbst: 'true',
			palatal: 'false',
			positioners: 'false',
			separators: 'false'
		  }
		},
		{ 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' + '9ab99a',
			//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' + '9ab99a'
		  }
		},
		{ version: 8 }
	);
	
	//brace painter
	$('#flash-brace-painter').flash(
	  { 
		src: 'flash/brace-painter.swf',
		width: 500,
		height: 430,
		wmode: 'transparent'
	  },
	  { 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' + '9ab99a',
			//change item value to false to omit
			pokingWire: 'true',
			bracket: 'true',
			looseWire: 'true',
			appliance: 'true',
			headgear: 'true',
			soreness: 'true'
		  }
		},
		{ version: 8 }
	);
	
	//Damon System 
	
	//comparison
	$('#flash-the-damon-system-comparison').flash(
		{ 
		  src: 'the-damon-system-comparison.swf',
		  width: 250,
		  height: 165
		},
		{ 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 }
	);
});//end document.ready
