//JQuery Setup
$(function(){
 
//Important functions to fire first!
//-------------------------------------------------------------------------------
	
	//IE6 Upgrade Warning
	//set cookie handler
	var alertBox = $.cookie('ie_alert');
	//if cookie val "noshow" then hide message - user has already seen this message!
	if(alertBox == 'noshow') {
	$('#alert').css('display', 'none');
	}else{
	$('#alert').css('display', 'block');
	}
	
	//click to close behavior
	$('.ie-alert-link').click(function() {
	$('#alert').slideToggle("slow");
	$.cookie('ie_alert', 'noshow', { expires: 14 });
	});
	
	//-- /end ie6 warning
	
	//png fix
	//must reference jquery.pngFix1.2.js in order to work
	$(document).pngFix();

// Utilities
//-------------------------------------------------------------------------------
	
	
// Standard Flash Modules
//-------------------------------------------------------------------------------
	
	// Define the default configuation values
	// followed by individual module configuration.
	// Values for individual modules will override the defaults
	var flashModules = {
		
		defaults: {			
			width: 500,
			height: 300,
			wmode: 'transparent',
			flashvars: {
				autoPlay: 'false', // change value to 'true' to play on start
				thisColor: '0x' + '639CCE' // change global hex color (default=639CCE)
			},
			pluginOptions: {version: 9}
		},
	
	modules: [
	  // Define the configuration values for each flash module.
	  // Change item values in any 'flashvars' section to false to omit,
	  // Add any value to override the default value in flashModuleDefaults.
	  
	 
//----------!!!!!!UNCOMMENT OUT WHEN ADDING FLASH!!!!!!!-----------
	  //{name: 'home', config: {width:330, height:330}},

	]
	};
	
	// Loop through the defined modules 
	// and do flash replacement for any that are on the current page
	for (var j = flashModules.modules.length - 1; j >= 0; j--){
		var module = flashModules.modules[j];
		// combine default config settings with individual module config settings
		var modConfig = $.extend({}, flashModules.defaults, module.config);
		// combine default flashvars with module flashvars
		modConfig.flashvars = $.extend({}, flashModules.defaults.flashvars, module.config.flashvars);
		modConfig.src = 'flash/' + module.name + '.swf';
		$('#flash-' + module.name).flash(modConfig, flashModules.defaults.pluginOptions);
	}


//Basic HTML functions
//---------------------------------------------------------------------------------

	// Open external links in new windows
	$('a[href^="http://"]').not('[href*="orthosesame.com"]').addClass('external').attr('target', '_blank');
	
	// Open pdf links in new windows
	$('a[href$=".pdf"]').addClass('pdf').attr('target', '_blank');
	
});//end document.ready