// XHTML Strict External Links
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;

// Jquery Variables
$(document).ready(function(){	   
// jQuery Cycle Before and After //-------------------------------------------------
$('#before-after-cycle') // Give this ID a unique name if more than one office tour is needed on a page
.before('<div class="before-after-nav">') // Ditto for this ID
.cycle({
cleartype: true, // true if clearType corrections should be applied (for IE)
cleartypeNoBg: true, // Set to true to disable extra cleartype fixing (leave false to force background color setting on slides)
speed: 500, // This controls speed of transition
timeout: 0, // This controls delay between slides. Set to 0 if more than one office tour on a page, so they don't auto-play
pager: '.before-after-nav',
before: function() {
$('.cycle-detail span').fadeOut(); // Give this ID a unique name if more than one office tour is needed on a page
},
after: function(curr, next, opts) {
var cycle_alt = $(next).find('img').attr('alt'); // This grabs the image alt text
$('.cycle-detail span').html(cycle_alt).fadeIn(); // This puts alt text into the caption span
}
}); 						   
// PNG Fix for IE
    $(document).pngFix();

// Flash Embedding

// Header Flash
	$('#flash-header').flash(
		{ 
		  src: 'swf/header.swf',
		  width: 317,
		  height: 270,
		  wmode: 'transparent'
		},
		{ version: 8 }
	);

// Home Page Flash
	$('#flash-home').flash(
		{ 
		  src: 'swf/home.swf',
		  width: 302,
		  height: 202,
		  wmode: 'transparent'
		},
		{ version: 8 }
	);

// Life with Braces
	$('#flash-brushing-and-flossing').flash(
		{ 
		src: 'swf/brushing-and-flossing.swf',
		width: 500,
		height: 300,
		wmode: 'transparent',
		  flashvars: { 
			autoPlay: 'false',
			thisColor: '0x' + '7B9800',
			brushing: 'true',
			flossing: 'true'
		  }
		},
		{ version: 8 }
	);

// Types of Braces
	$('#flash-types-of-braces').flash(
		{ 
		  src: 'swf/types-of-braces.swf',
		  width: 500,
		  height: 300,
		  wmode: 'transparent',
		  flashvars: { 
			autoPlay: 'false',
			thisColor: '0x' + '7B9800',
			metal: 'true',
			gold: 'false',
			ceramic: 'true',
			invisible: 'false',
			lingual: 'false'
		  }
		},
		{ version: 8 }
	);
	
// Types of Appliances
	$('#flash-types-of-appliances').flash(
		{ 
		  src: 'swf/types-of-appliances.swf',
		  width: 500,
		  height: 300,
		  wmode: 'transparent',
		  flashvars: { 
			autoPlay: 'false',
			thisColor: '0x' + '7B9800',
			elastics: 'true',
			headgear: 'true',
			herbst: 'false',
			palatal: 'true',
			positioners: 'false',
			separators: 'true'
		  }
		},
		{ version: 8 }
	);
	
// Palatal Expander
	$('#flash-palatal-expander').flash(
		{ 
		  src: 'swf/palatal-expander.swf',
		  width: 200,
		  height: 150,
		  wmode: 'transparent'
		},
		{ version: 8 }
	);
	
// Braces Diagram
	$('#flash-braces-diagram').flash(
		{ 
		  src: 'swf/braces-diagram.swf',
		  width: 500,
		  height: 375,
		  wmode: 'transparent',
		  flashvars: { 
			thisColor: '0x' + '7B9800'
		  }
		},
		{ version: 8 }
	);

//Oral Care Video
	$('#flash-oral-care-video').flash(
		{ 
		  src: 'swf/oral-care-video.swf',
		  width: 455,
		  height: 341,
		  wmode: 'transparent',
		  flashvars: { 
			thisColor: '0x' + '7B9800',
			wmode: 'transparent'
		  }
		},
		{ version: 8 }
	);

// SureSmile Video 1
	$('#flash-suresmile-video-1').flash(
		{ 
		  src: 'swf/flv-player.swf',
		  width: 480,
		  height: 295,
		  wmode: 'transparent',
		  flashvars: { 
			flvToPlay: '../video/suresmile-1.flv',
			autoStart: 'false',
			scaleMode: 'none',
			startImage: 'video/images/suresmile-1.jpg',
			showScaleModes: 'false',
			smoothVideo: 'true'
		  }
		},
		{ version: 8 }
	);
	
// SureSmile Video setup
	$('#flash-suresmile-video-setup').flash(
		{ 
		  src: 'swf/flv-player.swf',
		  width: 480,
		  height: 384,
		  wmode: 'transparent',
		  flashvars: { 
			flvToPlay: '../video/suresmile-setup.flv',
			autoStart: 'false',
			scaleMode: 'none',
			startImage: 'video/images/suresmile-setup.jpg',
			showScaleModes: 'false',
			smoothVideo: 'true'
		  }
		},
		{ version: 8 }
	);

// SureSmile Video 2
	$('#flash-suresmile-video-2').flash(
		{ 
		  src: 'swf/flv-player.swf',
		  width: 480,
		  height: 295,
		  wmode: 'transparent',
		  flashvars: { 
			flvToPlay: '../video/suresmile-2.flv',
			autoStart: 'false',
			scaleMode: 'none',
			startImage: 'video/images/suresmile-2.jpg',
			showScaleModes: 'false',
			smoothVideo: 'true'
		  }
		},
		{ version: 8 }
	);
	
// SureSmile Video 3
	$('#flash-suresmile-video-3').flash(
		{ 
		  src: 'swf/flv-player.swf',
		  width: 480,
		  height: 295,
		  wmode: 'transparent',
		  flashvars: { 
			flvToPlay: '../video/suresmile-3.flv',
			autoStart: 'false',
			scaleMode: 'none',
			startImage: 'video/images/suresmile-3.jpg',
			showScaleModes: 'false',
			smoothVideo: 'true'
		  }
		},
		{ version: 8 }
	);
	
// Orthodontic Treatments
	$('#flash-orthodontic-treatments').flash(
		{ 
		  src: 'swf/orthodontic-treatments.swf',
		  width: 500,
		  height: 300,
		  wmode: 'transparent',
		  flashvars: { 
			autoPlay: 'false',
			thisColor: '0x' + '7B9800',
			crowding: 'true',
			openbite: 'true',
			deepOverbite: 'true',
			missing: 'true',
			underbite: 'true',
			spacing: 'true',
			overbite: 'true',
			nonBraces: 'true',
			phaseI: 'true'
		  }
		},
		{ version: 8 }
	);

//Emergency care 
	$('#flash-emergency-care').flash(
		{ 
		  src: 'swf/emergency-care.swf',
		  width: 500,
		  height: 300,
		  wmode: 'transparent',
		  flashvars: { 
			autoPlay: 'false',
			thisColor: '0x' + '7B9800',
			pokingWire: 'true',
			bracket: 'true',
			looseWire: 'true',
			appliance: 'true',
			headgear: 'true',
			soreness: 'true'
		  }
		},
		{ version: 8 }
	);
  
});//end document.ready

// Office Tours

function highPoint() {
	var targetID = "office-tour-swf";
	var so=new SWFObject("swf/office-tour-high-point.swf", "flash-office-tour-high-point", "500", "375", "8");
	so.addParam("wmode", "transparent");
	so.addVariable("caption01", "");
	so.addVariable("caption02", "");
	so.addVariable("caption03", "");
	so.addVariable("caption04", "");
	so.addVariable("caption05", "");
	so.addVariable("caption06", "");
	so.addVariable("caption07", "");
	so.addVariable("caption08", "");
	so.addVariable("caption09", "");
	so.addVariable("caption10", "");
	so.addVariable("caption11", "");
	so.write(targetID);
	var swfDiv=document.getElementById(targetID);
	swfDiv.innerHTML;	
}
function greensboro() {
	var targetID = "office-tour-swf";
	var so=new SWFObject("swf/office-tour-greensboro.swf", "flash-office-tour-greensboro", "500", "375", "8");
	so.addParam("wmode", "transparent");
	so.addVariable("caption01", "");
	so.addVariable("caption02", "");
	so.write(targetID);
	var swfDiv=document.getElementById(targetID);
	swfDiv.innerHTML;	
}