<!--
/* this script to the first page of any site to destroy any frames a user might be stuck in */
if (top != self) { top.location = self.location; }

function convertSpaces(str) {
	var out = "", flag = 0;
	for (i = 0; i < str.length; i++) {
		if (str.charAt(i) != " ") {
		out += str.charAt(i);
		flag = 0;
	}
	else {
		if(flag == 0) {
		out += "+";
		flag = 1;
		}
   	     }
	}
	
	return out;
}


function getDirections ()
{
	var urlDirections = "http://www.mapquest.com/directions/main.adp?go=1&do=nw&ct=NA&1y=US";
	var urlTJAddress = "&1ah=&2y=US&2a=606+E.+Marshall+Street&2p=&2c=West+Chester&2s=PA&2z=19380&2ah=&lr=2&x=78&y=16";
	
	if (IsFormComplete("directions")) {

	var formAddress = 	window.document.directions.Address.value;
	var formCity = 		window.document.directions.City.value;
	var formState = 	window.document.directions.State.value;
	var formZip = 		window.document.directions.Zip.value;

	var reformAddress=convertSpaces(formAddress);
	var reformCity=convertSpaces(formCity);

	urlDirections += "&1a=";
	urlDirections += reformAddress;
	urlDirections += "&1p=&1c=";
	urlDirections += reformCity;
	urlDirections += "&1s=";
	urlDirections += formState;
	urlDirections += "&1z=";
	urlDirections += formZip;
	urlDirections += urlTJAddress;

	window.open(urlDirections);}
}

function IsFormComplete(FormName)
{
var x       = 0
var FormOk  = true

while ((x < document.forms[FormName].elements.length) && (FormOk))
   {
     if (document.forms[FormName].elements[x].value == '')
     { 
        alert('Please enter the '+document.forms[FormName].elements[x].name +' and try again.')
        document.forms[FormName].elements[x].focus()
        FormOk = false 
     }
     x ++
   }
return FormOk
}

document.WM = new Object();
document.WM.hirelist = new Object();
document.WM.hirelist.expandos = new Array();
document.WM.hirelist.heights = new Array();
document.WM.hirelist.names = new Array();

function WM_toggle(id) {
  if (document.all){
    if(document.all[id].style.display == 'none'){
      document.all[id].style.display = '';
    } else {
      document.all[id].style.display = 'none';
    }
  } else if (document.getElementById){
    if(document.getElementById(id).style.display == 'none'){
      document.getElementById(id).style.display = 'block';
    } else {
      document.getElementById(id).style.display = 'none';
    }
  } else if(document.layers) {
      if(parseInt(id + 1)){
	  ditem = id + 1;
      } else {
	  ditem = document.WM.hirelist.names[id];
      }
      if(document.WM.hirelist.expandos[ditem].clip.bottom == 0) {
	     document.WM.hirelist.expandos[ditem].clip.bottom = document.WM.hirelist.heights[ditem];
      } else {
	  document.WM.hirelist.expandos[ditem].clip.bottom = 0;
      }
      WM_align();
  }
}

function WM_align() {
    var i,j,stupid_netscape_array_infinate_loop_error;
    stupid_netscape_array_infinate_loop_error = document.WM.hirelist.expandos.length;
    for(i=0; i<stupid_netscape_array_infinate_loop_error; i++) {
		j = i + 1;
		if(document.WM.hirelist.expandos[j]){
	    	if(document.layers) {
				document.WM.hirelist.expandos[j].top = document.WM.hirelist.expandos[i].top + document.WM.hirelist.expandos[i].clip.bottom;
	   		}
		}
    }
}

function WM_initialize_toolbar(){
    if(document.layers) {
		for(i=0; i<document.layers['container'].document.layers.length; i++){
	    	document.WM.hirelist.expandos[i] = document.layers['container'].document.layers[i];
	    	document.WM.hirelist.names[document.layers['container'].document.layers[i].name] = i;
	    	document.WM.hirelist.heights[i] = document.WM.hirelist.expandos[i].clip.bottom;
		}
		for (p=0;p<document.WM.hirelist.expandos.length;p=p+2){
	    	WM_toggle(p);
		}
		document.layers['container'].visibility = 'visible';
    } else if (document.all){
		for(i = 0; i < document.all('container').all.length; i++){
		    document.all('container').all[i].style.position = 'relative';
		    if(document.all('container').all[i].className == 'menu'){
			document.all('container').all[i].style.display = 'none';
		    }
		}
		document.all('container').style.visibility = 'visible';
    } else if (document.getElementsByTagName && document.getElementById){
		var contained = document.getElementById('container').getElementsByTagName('div');
		for(i = 0; i < contained.length; i++){
		    contained[i].style.position = 'relative';
		    if(contained[i].getAttribute('class') == 'menu'){
			contained[i].style.display = 'none';
		    }
		}
		document.getElementById('container').style.visibility = 'visible';
    }
}

function WM_imageToggle(daImage, src1, src2, netscape_container){
  var objStr,obj;
  // Check to make sure that images are supported in the DOM.
	  myImage = document.images[daImage];
  if(document.layers){
      myImage = document.layers['container'].document.layers[netscape_container].document.images[daImage];
  }
  if(document.images){
    // Check to see whether you are using a name, number, or object
      if(myImage.src == src1){
	  	myImage.src = src2;
      } else {
	  	myImage.src = src1;
      }
  }
}

function writeServicesNav()
{
/* use this to activate:  onmouseover="writeServicesNav();" */
	document.writeln('<table border="0" width=100% class=whiteTable cellspacing="5">');
        document.writeln('<tr><td><a href="periodontia.htm">Periodontia</a></td>');
        document.writeln('<tr><td><a href="pediatric.htm">Pediatric dental care</a></td></tr>');
        document.writeln('<tr><td><a href="occlusion.htm">Occlusion</a></td></tr>');
        document.writeln('<tr><td><a href="endodontics.htm">Endodontics</a></td></tr>');
        document.writeln('<tr><td><a href="dentalImplants.htm">Dental implants</a></td></tr>');
        document.writeln('<tr><td><a href="tmj.htm">TMJ</a></td></tr>');
        document.writeln('<tr><td><a href="restorative.htm">Restorative</a></td></tr>');
        document.writeln('<tr><td><a href="surgery.htm">Surgery</a></td></tr>');
        document.writeln('</table>');
}

function doPreload()
{

   var the_images = new Array('images/docs2.jpg','images/DSCN0286.JPG','images/gray_spacer.gif','images/jester1.jpg','images/ourPeople.jpg','images/ped1.jpg','images/ped2.jpg','images/saldivar2.jpg','images/serv2.jpg','images/TemJestCOLOR.gif','images/TemJestCOLOR.v3.gif','images/TemJesttriangle.v2.gif','images/temple1.jpg');
   preloadImages(the_images);
}

function preloadImages(the_images_array) {

   for(var loop = 0; loop < the_images_array.length; loop++)
	
   {
 	var an_image = new Image();
	an_image.src = the_images_array[loop];
   }
}


//-->