// JavaScript Document
$j(document).ready(function(){
	
	$j.preloadCssImages({ mainMenuP: ".mainmenu li a" });

	
	$j('.mainmenu').accordion({
		active: false,
		header: '.parent',
		event: 'mouseup',
		autoHeight: false,
		navigation: false,
		collapsible:true,
		showSpeed: 200,
		hideSpeed: 140
	});
	
	$j('a').focus(function(){
		this.blur();		
	});
	
	//$j('.mainmenu').accordion('enable');
	
	$j("a[href='#']").click( function(){ return false; });
	
});
// set up locatation of flash feature colors
// this is necessary because the flash features are old and moldy
var thisurl = location.href.substring(location.href.lastIndexOf("http://")+7, location.href.length); 
var colorstxt = thisurl.substring(0, thisurl.lastIndexOf('/'))+"/colors.txt";
// swfobject embed
flashvars = { colorslocation: colorstxt };
params = { wmode: "transparent" };
attributes = {};
// flash header home page
swfobject.embedSWF("flash/flash_header_6.swf", "header", "900", "183", "9", "flash/expressInstall.swf", flashvars, params, attributes);	
// flash header
//swfobject.embedSWF("flash/flash_header_5.swf", "header", "900", "183", "9", "flash/expressInstall.swf", flashvars, params, attributes);	
// before and after flash feature	
//swfobject.embedSWF("http://tools.televoxsites.com/features/beforeafter.swf", "bandaFF", "510", "306", "9.0.124", "flash/expressInstall.swf", flashvars, params, attributes);
// types of braces flash feature
swfobject.embedSWF("http://tools.televoxsites.com/features/typesofbraces_nointrosound.swf", "tobFF", "510", "306", "9.0.124", "flash/expressInstall.swf", flashvars, params, attributes);
// parts of braces flash feature
swfobject.embedSWF("http://tools.televoxsites.com/features/partsofbraces_nointrosound.swf", "pobFF", "510", "250", "9.0.124", "flash/expressInstall.swf", flashvars, params, attributes);
// color band chooser
swfobject.embedSWF("http://tools.televoxsites.com/features/ColorPlanner.swf", "cpFF", "500", "400", "9.0.124", "flash/expressInstall.swf", flashvars, params, attributes);
//oral hygiene 
swfobject.embedSWF("http://tools.televoxsites.com/features/nosound/oralhygiene_nosound.swf", "oralFF", "510", "380", "9.0.124", "flash/expressInstall.swf", flashvars, params, attributes);
//office tour
flashvars = { xmlFile: "flash/officetour/office.xml" }
swfobject.embedSWF("flash/officetour/office.swf", "officetour", "500", "307", "9.0.124", "flash/expressInstall.swf", flashvars, params, attributes);

function fieldCheck() {
	if (document.apptrequest.PatientName.value.length < 2) {
		alert("Please enter your name.");
		return false;
	}
	if (document.apptrequest.Email.value.length < 6) {
		alert("Please enter a valid Email address.");
		return false;
	}
	if (document.apptrequest.Address.value.length < 6) {
		alert("Please enter your address.");
		return false;
	}
	if (document.apptrequest.Phone.value.length < 7) {
		alert("Please enter your phone number.");
		return false;
	}
}
function uploadCheck() {
	if (document.uploadForm.file.value.length < 2) {
		alert("Please attach a file to upload.");
		return false;
	}
	if (document.uploadForm.Name.value.length < 2) {
		alert("Please enter your name.");
		return false;
	}
	if (document.uploadForm.Email.value.length < 6) {
		alert("Please enter a valid email address.");
		return false;
	}
}
function fbCheck() {
	if (document.feedbackForm.Name.value.length < 1) {
		alert("Please enter your name");
		return false;
	}
	if (document.feedbackForm.Email.value.length < 6) {
		alert("Please enter a valid email address");
		return false;
	}
	if (document.feedbackForm.Message.value.length < 2) {
		alert("Please enter your comments or feedback");
		return false;
	}
}


