function clearsearch()  {
	document.search.q.value='';
}

function change_calendar(view_type) {
if (view_type=='all') {
document.getElementById("calendar_header_all").style.display = 'block';
document.getElementById("calendar_header_classes").style.display = 'none';
document.getElementById("calendar_header_events").style.display = 'none';
document.getElementById("calendar_header_support").style.display = 'none';
}
if (view_type=='classes') {
document.getElementById("calendar_header_classes").style.display = 'block';
document.getElementById("calendar_header_all").style.display = 'none';
document.getElementById("calendar_header_events").style.display = 'none';
document.getElementById("calendar_header_support").style.display = 'none';
}
if (view_type=='events') {
document.getElementById("calendar_header_all").style.display = 'none';
document.getElementById("calendar_header_classes").style.display = 'none';
document.getElementById("calendar_header_events").style.display = 'block';
document.getElementById("calendar_header_support").style.display = 'none';
}
if (view_type=='support') {
document.getElementById("calendar_header_all").style.display = 'none';
document.getElementById("calendar_header_classes").style.display = 'none';
document.getElementById("calendar_header_events").style.display = 'none';
document.getElementById("calendar_header_support").style.display = 'block';
}
}

// ---------------------------------------------------------------
// home page menu script
// Copyright 2006-2007 javascript-array.com
var timeout	= 500;
var timeoutopen	= 300;
var closetimer	= 0;
var ddmenuitem	= 0;
var cancelLayerClose = false;

// open hidden layer
function mopen(id)
{
	try{
		// cancel close timer
		mcancelclosetime();
	
		// close old layer
		if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
	
		// get new layer and show it
		ddmenuitem = document.getElementById(id);
		//ddmenuitem.style.visibility = 'visible';
		mopentime();
	}catch(err){
		//do nothing because the page have not loaded yet.
	}
}

// close showed layer
function mclose()
{
	if(cancelLayerClose==false){
		if(ddmenuitem)
		{
			ddmenuitem.style.visibility = 'hidden';
		}
	}else{
		cancelLayerClose = false;
	}
}

// go close timer
function mclosetime()
{
	try{
		closetimer = window.setTimeout(mclose, timeout);
	}catch(err){
		//do nothing because the page have not loaded yet.
	}
}

// cancel close timer
function mcancelclosetime()
{
	try{
		if(closetimer)
		{
			window.clearTimeout(closetimer);
			closetimer = null;
		}
	}catch(err){
		//do nothing because the page have not loaded yet.
	}
}


// go open timer
function mopentime()
{
	opentimer = window.setTimeout(mopenaftertimer, timeoutopen);
}

//open layer after short delay
function mopenaftertimer()
{
	ddmenuitem.style.visibility = 'visible';
}





function mcancelclosespecial()
{
	cancelLayerClose = true;
}

window.onload = function(){ 
	// close layer when click-out
	document.onclick = mclose;
	
	
	try{
		document.all.txtMenuCalendarSearch.onclick = mcancelclosespecial;
	}catch(err){
		//do nothing because the textbox doesn't exists.
	}
	
	try{
		document.all.selMenuPhysicianSearch.onclick = mcancelclosespecial;
	}catch(err){
		//do nothing because the dropdown doesn't exists.
	}
	
}
// ---------------------------------------------------------------

//Site Search
//----------------------------------------------------------------


function clearSearch(item) {
    var tempSearch = item;
    tempSearch.value = "";
}
//------------------------------------------------------------------

//menu calendar search
//----------------------------------------------------------------

function menuCalendarSearch() {
	var sTempCal = document.all.txtMenuCalendarSearch.value;
	if(sTempCal.length > 1){
		window.location = 'calendar_search.aspx?q='+sTempCal;
	}
}
//------------------------------------------------------------------

//menu physician search
//----------------------------------------------------------------

function menuPhysicianSearch() {
	var sTempDoc = document.all.selMenuPhysicianSearch.value;
	if(sTempDoc.length > 1){
		window.location = 'physician_search.aspx?specialty='+sTempDoc;
	}
}
//------------------------------------------------------------------


//request an appointment
//----------------------------------------------------------------

function requestAnAppointment(physicianID) {
	openNewWindow("https://www.ehealthconnection.com/secure/toledo/appointment/default.asp?id="+physicianID,650,600);
}
//------------------------------------------------------------------


function openNewWindow(url,width,height)
{
	newwindow=window.open(url,'new_window','height='+height+',width='+width+',resizable=yes,scrollbars=yes');
	if (window.focus) {newwindow.focus()}
}

