
// Browser sniff with object function
    function hideShowlayer(hidelayer,hideanother,showlayer){
    if(document.getElementById){
   	document.getElementById(hidelayer).style.visibility="hidden";
  	document.getElementById(hideanother).style.visibility="hidden";
  	document.getElementById(showlayer).style.visibility="visible";
   	}
    else if(document.all){
     document.all[hidelayer].style.visibility="hidden";
      document.all[hideanother].style.visibility="hidden";
     document.all[showlayer].style.visibility="visible";
	}   
	else return false;
	}

   function hideShowBorder(hideborder,showborder,showanother){
    if(document.getElementById){
    document.getElementById(hideborder).style.borderBottomWidth="0px";
    document.getElementById(showborder).style.borderBottomWidth="1px";
  	document.getElementById(showanother).style.borderBottomWidth="1px";
   	}
  
  
   	else if(document.all){
     document.all[noborderlayer].style.borderBottomWidth="0px";
     document.all[borderlayer].style.borderBottomWidth="1px";
	}   
 else return false;
	}

var preloadFlag= false;
function preloadImages(){
if (document.images)
	{	
	homeOn= new Image(100,28)
	homeOn.src="images/templates/nav_home_on.gif";
	homeOff= new Image(100,28)
	homeOff.src="images/templates/nav_home_off.gif";

	aboutOn= new Image(125,28)
	aboutOn.src="images/templates/nav_aboutus_on.gif";
	aboutOff= new Image(125,28)
	aboutOff.src="images/templates/nav_aboutus_off.gif";
	
	contactOn= new Image(130,28)
	contactOn.src="images/templates/nav_contactus_on.gif";
	contactOff= new Image(130,28)
	contactOff.src="images/templates/nav_contactus_off.gif";
	t_Off= new Image(105,22)
	t_Off.src="images/templates/t_off.gif";
	t1805_On= new Image(105,22)	
	t1805_On.src="images/templates/t1805.gif";
	t1850_On= new Image(105,22)	
	t1850_On.src="images/templates/t1850.gif";	
	t1900_On= new Image(105,22)	
	t1900_On.src="images/templates/t1900.gif";
	t1950_On= new Image(105,22)	
	t1950_On.src="images/templates/t1950.gif";
	preloadFlag= true;
	}
}
function ImgSwap(where, ImgObj){
if (document.images && (preloadFlag == true)){
document.images[where].src=eval(ImgObj + ".src");
}
}



function openWin(url) {
window.open(url,'','scrollbars,resizable,width=600,height=540,left=0,top=0');

}


function setAddr(link, fname, lname) 
{ 
  link.href = 'mai' + 'lto:' + fname +'.'+ lname + '@georgetown-umc.org'; 
} 
 
function setOutAddr(link, fname, lname, at) 
{ 
  link.href = 'mai' + 'lto:' + fname +'.'+ lname + '@' + at ; 
} 

 function toggle_visibility(id) {
       var e = document.getElementById(id);
       if(e.style.display == 'block'){
          e.style.display = 'none';}
       else{
          e.style.display = 'block';
    }
    return false;
  }



  $(document).ready(function(){
	
	//set class for links to external sites and other document types
	$('#content a[href^="http://"]').addClass('external').attr('target', '_blank');
	$('#content a[href$=".pdf"]').addClass('pdf').attr('target','_blank');
	$('#content a[href$=".ppt"]').addClass('powerpoint').attr('target','_blank');
	$('#content a[href$=".doc"]').addClass('word').attr('target','_blank');
	$('#content a[href$=".xls"]').addClass('excel').attr('target','_blank');
	$('#content a[href$=".csv"]').addClass('excel').attr('target','_blank');

	


});

