<!--//

// Quick Contact Form Start
function clearText(thefield) {
	if (thefield.defaultValue==thefield.value) { thefield.value = "" }
} 

function replaceText(thefield) {
	if (thefield.value=="") { thefield.value = thefield.defaultValue }
}
// Quick Contact Form End


// Form Validation Start
function Validate(){
	var bitErr = false;
	var bitErrEmail = false;
	var reqField = "";
 
	if (document.contact_main.contact_first_name.value == ""){ bitErr = true; reqField += "- First Name\n";}
	if (document.contact_main.contact_last_name.value == "") { bitErr = true; reqField += "- Last Name\n"; }
	if (document.contact_main.contact_home_phone.value == "") { bitErr = true; reqField += "- Phone\n"; }
	if (document.contact_main.how_did_you_hear_about_our_practice.value == "") { bitErr = true; reqField += "- How did you hear about our practice?\n"; }
	if (document.contact_main.how_did_you_find_my_website.value == "") { bitErr = true; reqField += "- How did you find my website?\n"; }
	if (document.contact_main.contact_comment.value == "") { bitErr = true; reqField += "- Patient Questions and Comments\n"; }
	if (document.contact_main.contact_email.value == " email") { bitErr = true; bitErrEmail = true; }
	if (document.contact_main.contact_email.value.indexOf("@") == -1) { bitErr = true; bitErrEmail = true; }
	if (document.contact_main.contact_email.value.indexOf(".") == -1) { bitErr = true; bitErrEmail = true; }
	
	if (bitErrEmail){
		reqField += "- Email (Use a valid email address.)\n";
	}
	if (bitErr){
		alert("Please fill out the following required information:\n"+reqField);
		return false;
	}
	
	document.contact_main.submit();
}
// Form Validation End


// Bookmark Site Start
function bookmarksite(bookmarktitle, bookmarkurl){
	if (document.all)
	window.external.AddFavorite(bookmarkurl, bookmarktitle);
	else if (window.sidebar)
	window.sidebar.addPanel(bookmarktitle, bookmarkurl, "")
}
// Bookmark Site End


//Vertical Sucker Sprite Start
/*
vsfHover = function() {
	var vsfEls = document.getElementById("v-suckersprite").getElementsByTagName("LI");
	for (var i=0; i<vsfEls.length; i++) {
		vsfEls[i].onmouseover=function() {
			this.className+=" vsfhover";
		}
		vsfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" vsfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", vsfHover);
*/
//Vertical Sucker Sprite End


//Horizontal Sucker Sprite Start
/*
hsfHover = function() {
	var hsfEls = document.getElementById("h-suckersprite1").getElementsByTagName("LI");
	for (var i=0; i<hsfEls.length; i++) {
		hsfEls[i].onmouseover=function() {
			this.className+=" hsfhover";
		}
		hsfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" hsfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", hsfHover);
*/
//Horizontal Sucker Sprite End


// Disable Forms Start
function init()
{
	if (!document.layers) return;
	var box = document.forms[0].elements;
	for (var i=0;i<box.length;i++)
	{
		box[i].disabled = false;
	}
}

function disableIt(obj)
{
	obj.disabled = !(obj.disabled);
	var z = (obj.disabled) ? 'disabled' : 'enabled';
	if(z == 'disabled') obj.style.backgroundColor='#c0c0c0'; else obj.style.backgroundColor='#fff';
}

function extracheck(obj)
{
	return !obj.disabled;
}
// Disable Forms End


// ToggleID Start
function toggle(id){
	if (document.getElementById){
		var el = document.getElementById(id);
		el.style.display = (el.style.display == 'none') ? 'block' : 'none';
	}
}
// ToggleID End

// Flash embedding for validation
// -----------------------------------------------------------------
function printFlash(source, width, height, id, bg_color) {
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" ');
	document.write('width="'+width+'" height="'+height+'" id="'+id+'" align="middle">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="movie" value="'+source+'" />');
	document.write('<param name="menu" value="false" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="bgcolor" value="'+bg_color+'" />');
	document.write('<embed src="'+source+'" menu="false" quality="high" bgcolor="'+bg_color+'" width="'+width+'" height="'+height+'" name="'+id+'" align="middle" ');
	document.write('allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
}

//------------------- OPEN NEW WINDOW -------------------//
var newWindow = null;

function closeWin(){
	if (newWindow != null){
		if(!newWindow.closed)
			newWindow.close();
	}
}

function popUpWin(url, type, strWidth, strHeight){
	closeWin();
	if (type == "fullScreen"){
		strWidth = screen.availWidth - 10;
		strHeight = screen.availHeight - 160;
	}
	var tools="";
	if (type == "standard" || type == "fullScreen") tools = "resizable=no,toolbar=no,location=no,scroll=yes,scrollbars=yes,menubar=no,width="+strWidth+",height="+strHeight+",top=0,left=0";
	if (type == "console") tools = "resizable=no,toolbar=no,location=no,directories=no,status=no,scroll=no,scrollbars=no,menubar=no,width="+strWidth+",height="+strHeight+",left=0,top=0";
	newWindow = window.open(url, 'newWin', tools);
	newWindow.focus();
}

function popUpSWF(url, type, Width, Height, arg1, arg2, arg3){
	closeWin();
	tools = "resizable=no,toolbar=no,location=no,directories=no,status=no,scroll=no,scrollbars=no,menubar=no,width="+Width+",height="+Height+",left=0,top=0";
	if(type == "mp"){
		newWindow = window.open(url+"?bandwidth="+arg1+"&video="+arg2+"&lan="+arg3, 'newWin', tools);
	}
	if(type == "mc"){
		newWindow = window.open(url+"?category="+arg1+"&videoNum="+arg2, 'newWin', tools);
	}
	if(type == "bna"){
		newWindow = window.open(url+"?procedure="+arg1+"&caseNum="+arg2, 'newWin', tools);
	}
	newWindow.focus();
}
