
  function ToggleDisplay(id)
  {
    var elem = document.getElementById('d' + id);
    if (elem) 
    {
      if (elem.style.display != 'block') 
      {
        elem.style.display = 'block';
        elem.style.visibility = 'visible';
      } 
      else
      {
        elem.style.display = 'none';
        elem.style.visibility = 'hidden';
      }
    }
  }
  
  function getCalendar()
  {
    var year = document.getElementById("ctl00_cphBody_ddlYear").value;
    var month = document.getElementById("ctl00_cphBody_ddlMonth").value;
    
    window.open('calendar.aspx?month='+month+'&year='+year)
  }
  

//function to resize the calendar window to fit the user's screen, then to display it.
//function getCalEvent(htmlfile)
//{
//	var attrib = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=100,height=100,left=" + lft + ",top=" + top;
//	window.open(htmlfile,"EditEvent",attrib);
//}

//function to display a pdf file and to resize it to fit the user's screen.
//Does not work as intended if passed a URL instead of a virtual directory, but hides
//the actual link from the clients and prompts to open or save.
//Example: getpdf('cseries/c-10.pdf'); return false;
function getpdf(file)
{
	if (screen.width >= 1024) 
	{
		var wdth = "900";
		var hght = "660";
	}
	else if (screen.width <= 800 || screen.width > 640)
	 {
		var wdth = screen.width - 100;
		var hght = screen.height - 100;
	}
	else if (screen.width == 640) 
	{
		var wdth = screen.width - 50;
		var hght = screen.height - 50;
	} 
	
	
	var lnk = "/documents/adobefiles/" + file;
	var attrib = "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width="+wdth+",height="+hght+",left=20,top=20";
	
	window.open(lnk,"SizedWindow",attrib);
}

//function to display a form in the center of the screen and resize it if needed.
function findCenter(htmfile, windowname) 
{
	if(screen.width < 800) 
	{
		var wdth = "600";
		var hght = "460";
		var lft = (screen.width - 612)/2;
		var top = (screen.height - 518)/2;
		//var ans = "yes";
	}
	else 
	{
		var wdth = "745";
		if(windowname == "filings")
		{
			var hght = "450";
		}
		else
		{
			var hght = "590";
		}
		var lft = (screen.width - 802)/2;
		var top = (screen.height - 668)/2;
		//var ans = "no";
	}
	var attrib = "toolbar=yes,location=yes,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width="+wdth+",height="+hght+",left="+lft+",top="+top;
	window.open(htmfile,windowname,attrib);
}

//function to size a form to the user's screen and position it. 
function resizeForm(htmlfile)
{
	if(screen.width < 800)
	{
		var wdth = "400";
		var hght = "460";
		var lft = (screen.width - 412)/2;
		var top = (screen.height - 518)/2;
		sbans = "yes";
	}
	else 
	{
		var wdth = "400";
		var hght = "550";
		var lft = "20";
		var top = "20";
		sbans = "no";
	}
	window.open(htmlfile,"form","toolbar=no,location=yes,directories=no,status=no,menubar=no,scrollbars="+sbans+",resizable=no,width="+wdth+",height="+hght+",left="+lft+",top="+top+"+");
}
