// JavaScript Document

var doAlerts=false;
function changeSheets(whichSheet){
  whichSheet=whichSheet-1;
  if(document.styleSheets){
    var c = document.styleSheets.length;
    if (doAlerts) alert('Change to Style '+(whichSheet+1));
    for(var i=0;i<c;i++){
      if(i!=whichSheet){
        document.styleSheets[i].disabled=true;
      }else{
        document.styleSheets[i].disabled=false;
      }
    }
  }
}

function DivShowOrHide(DivID) {
	if(DivID == "")
		return;

	var DivElement = document.getElementById(DivID);
	if (DivElement == null) {
		return;
	}

	if(DivElement.style.display == "none")
		DivElement.style.display = "inline";
	else
		DivElement.style.display = "none";
}


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
		var MiscWindow = null;
		function OpenMiscWindow (destination, width, height) 
		{
			var strTmp = 'width=' + width + ',height=' + height;
			if (!MiscWindow || MiscWindow.closed) 
			{
				MiscWindow = window.open(destination, '', strTmp);
			}
			else 
			{
				MiscWindow.focus();
			}
		}
		
		
		
//nav

	var navDivs = new Array("About", "Offices", "Visit", "Care", "Laser", "Adult", "Peds", "Employment");
		
	function setIdProperty( id, property, value ) {
		var styleObject = document.getElementById( id );
		if (styleObject != null) {
			styleObject = styleObject.style;
			styleObject[ property ] = value;
			}
		}

	function activateTab(i) {
		closeAllExcept(i);
		document.getElementById( i ).style.display='block';
		document.getElementById( i + "_parent" ).className='active';
		}

	function deactivateTab(i) {
		document.getElementById( i ).style.display='none';
		document.getElementById( i + "_parent" ).className='';
		}

	function switchDiv(divName) {
		activateTab(divName);
		}
	
	function closeAllExcept(divName) {
		for (i = 0; i < navDivs.length; i++) {
			if (navDivs[i] != divName) {
				deactivateTab(navDivs[i]);
				}
			}
		}
		
	function showHide(image) {
		try {
			if (image == "image1") {
				document.getElementById("image1").style.display = 'block';
				document.getElementById("image2").style.display = "none";
				document.getElementById("image3").style.display = "none";			
			} else 	if (image == "image2") {
				document.getElementById("image1").style.display = "none";
				document.getElementById("image2").style.display = "block";
				document.getElementById("image3").style.display = "none";			
			} else  {
				document.getElementById("image1").style.display = "none";
				document.getElementById("image2").style.display = "none";
				document.getElementById("image3").style.display = "block";				
			}
					
		} catch (err) {
			alert("Error in JavaScript Function showHide(image): getElementById(image)=null");
		}
	}		
		
		
				
	
function Clickheretoprint()
{ 
  var disp_setting="toolbar=yes,location=no,directories=yes,menubar=yes,"; 
      disp_setting+="scrollbars=yes,width=650, height=600, left=100, top=25"; 
  var content_vlue = document.getElementById("Section2").innerHTML; 
  var content_vlue2 = document.getElementById("Footer").innerHTML; 
  
  var docprint=window.open("","",disp_setting); 
   docprint.document.open(); 
   docprint.document.write('<html><head><title>Acton Medical Associates, P.C.</title>'); 
   docprint.document.write('<link href="actonmedical/print.css" rel="stylesheet" type="text/css">'); 
   docprint.document.write('</head><body onLoad="self.print()"><center>'); 
   docprint.document.write('<h4>Acton Medical Associates, P.C.</h4>');        
   docprint.document.write('http://www.actonmedical.com');            
   docprint.document.write(content_vlue);   
   docprint.document.write(content_vlue2);          
   docprint.document.write('</center></body></html>'); 
   docprint.document.close(); 
   docprint.focus(); 
}

function mailpage()
{
mail_str = "mailto:?subject=Check out " + document.title;
mail_str += "&body=I thought you'd be interested in this article from " + document.title;
mail_str += ". You can view it at: " + location.href; 
location.href = mail_str;
}



// slidehow

var SlideShowSpeed = 4000;
var CrossFadeDuration = 3;

var Picture = new Array();
var Caption = new Array();

Picture[1]  = 'images/rotation00.gif';
Picture[2]  = 'images/rotation01.gif';
Picture[3]  = 'images/rotation02.gif';
Picture[4]  = 'images/rotation03.gif';
Picture[5]  = 'images/rotation04.gif';
Picture[6]  = 'images/rotation05.gif';
Picture[7]  = 'images/rotation06.gif';
Picture[8]  = 'images/rotation07.gif';
Picture[9]  = 'images/rotation08.gif';
Picture[10]  = 'images/rotation09.gif';
Picture[11]  = 'images/rotation10.gif';
Picture[12]  = 'images/rotation11.gif';
Picture[13]  = 'images/rotation12.gif';
Picture[14]  = 'images/rotation13.gif';
Picture[15]  = 'images/rotation14.gif';
Picture[16]  = 'images/rotation15.gif';
Picture[17]  = 'images/rotation16.gif';


// =====================================
// Do not edit anything below this line!
// =====================================

var tss;
var iss;
var jss = 1;
var pss = Picture.length-1;

var preLoad = new Array();
for (iss = 1; iss < pss+1; iss++){
preLoad[iss] = new Image();
preLoad[iss].src = Picture[iss];}

function runSlideShow(){
if (document.all){
document.images.PictureBox.style.filter="blendTrans(duration=2)";
document.images.PictureBox.style.filter="blendTrans(duration=CrossFadeDuration)";
document.images.PictureBox.filters.blendTrans.Apply();}
document.images.PictureBox.src = preLoad[jss].src;
if (document.all) document.images.PictureBox.filters.blendTrans.Play();
jss = jss + 1;
if (jss > (pss)) jss=1;
tss = setTimeout('runSlideShow()', SlideShowSpeed);
}