sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}

if (window.attachEvent) window.attachEvent("onload", sfHover);

function externalLinks() { 
if (!document.getElementsByTagName) return; 
var anchors = document.getElementsByTagName("a"); 
for (var i=0; i<anchors.length; i++) { 
var anchor = anchors[i]; 
if (anchor.getAttribute("href") && 
anchor.getAttribute("rel") == "external") 
anchor.target = "_blank"; 
} 
} 
window.onload = externalLinks;





// Homepage Image/Testimonial Slider
        theimage = new Array();
        // The dimensions of ALL the images should be the same or some of them may look stretched or reduced in Netscape 4.
        // Format: theimage[...]=[image URL, link URL, name/description]
        theimage[0] = ["imgnew/index/flash.jpg", "", "Chastain Veterinary Medical Group", 
					   "Five stars is really not enough!!! &ndash; Barbara, via Google Places"];
        theimage[1] = ["imgnew/index/flash.jpg", "", "Chastain Veterinary Medical Group", 
					   "I find the staff to be friendly and knowlegable. &ndash; JMM, via Google Places"];
        theimage[2] = ["imgnew/index/flash.jpg", "", "Chastain Veterinary Medical Group", 
					   "I love them more than before! &ndash;  Connie, via Yelp"];
        theimage[3] = ["imgnew/index/flash.jpg", "", "Chastain Veterinary Medical Group", 
					   "I often tell people that my pet receives better healthcare than I do at PRAH. &ndash; Maggie, via Yelp"];
        theimage[4] = ["imgnew/index/flash.jpg", "", "Chastain Veterinary Medical Group", 
					   "Love all of the doctors and the staff we've worked with. &ndash; Mandy, via Google Places"];
        theimage[5] = ["imgnew/index/flash.jpg", "", "Chastain Veterinary Medical Group", 
					   "The care, concern and follow up for our boys continues to be exceptional. &ndash; Cathy, via Yelp"];
        theimage[6] = ["imgnew/index/flash.jpg", "", "Chastain Veterinary Medical Group", 
					   "I've been coming here for the past 5 years with my pets and the doctors and staff are very friendly. &ndash; Pinky B, via Yelp"];
        theimage[7] = ["imgnew/index/flash.jpg", "", "Chastain Veterinary Medical Group", 
					   "Everyone there was so nice and welcoming. &ndash; EmileJR, via CitySearch"];


       ///// Plugin variables
        playspeed=300000;// The playspeed determines the delay for the "Play" button in ms
        dotrans=1; // if value = 1 then there are transitions played in IE
        transtype = 'blendTrans'; // 'blendTrans' or 'revealtrans'
        transattributes = '4'; // duration=seconds,transition=#<24
        
        //***************************************************
        //key that holds where in the array currently are
        i=0;
        //***************************************************
        //if random
        function SetRandom() 
        {
	        tempimage = new Array();
	        for(p=0; p<theimage.length; p++){
		        for(p1=0; p1>-1; p1) {
			        tempNum = Math.floor(Math.random()*theimage.length)
			        if(!tempimage[tempNum]){
				        tempimage[tempNum]=theimage[p];
				        break;
			        }
		        }
	        }
	        for(p=0;p<theimage.length;p++)theimage[p]=tempimage[p];
        }

        //if random order
        SetRandom();

        //****************************************************
        window.onload = function()
        {
	        //preload images into browser
	        preloadSlide();

	        //set transitions
	        GetTrans();

	        //set the first slide
	        SetSlide(0);

	        //autoplay
	        PlaySlide();
        }

        //****************************************************
        function SetSlide(num) 
        {
	        //too big
	        i=num%theimage.length;
	        //too small
	        if(i<0)i=theimage.length-1;

	        //switch the image
	        if(document.all&&!window.opera&&dotrans==1)eval('document.images.imgslide.filters.'+transtype+'.Apply()')
	        document.images.imgslide.src=theimage[i][0];
	        if (document.all && !window.opera && dotrans == 1) eval('document.images.imgslide.filters.' + transtype + '.Play()')

	        //Add the code to set the Testimonials
	        document.getElementById('Testimonial').innerHTML = theimage[i][3];
        }

        //****************************************************
        function PlaySlide() {
	        if (!window.playing) {
		        PlayingSlide(i+1);
		        if(document.getElementById('slideshow').play){
		            document.getElementById('slideshow').play.value = "   Stop   ";
		        }
	        }
	        else {
		        playing=clearTimeout(playing);
		        if(document.getElementById('slideshow').play){
			        document.getElementById('slideshow').play.value="   Play   ";
		        }
	        }
	        // if you have to change the image for the "playing" slide
	        if(document.images.imgPlay){
		        setTimeout('document.images.imgPlay.src="'+imgStop+'"',1);
		        imgStop=document.images.imgPlay.src
	        }
        }

        function PlayingSlide(num) {
	        playing=setTimeout('PlayingSlide(i+1);SetSlide(i+1);', playspeed);
        }

        //****************************************************
        //desc: picks the transition to apply to the images
        function GetTrans() {
            //si=document.slideshow.trans.selectedIndex;
	       // var objDoc = document.getElementById['

            if ((document.getElementById('slideshow').trans && document.getElementById('slideshow').trans.selectedIndex == 0) || (!document.getElementById('slideshow').trans && dotrans == 0)) {
		        dotrans=0;
	        }
	        else if ((document.getElementById('slideshow').trans && document.getElementById('slideshow').trans.selectedIndex == 1) || (!document.getElementById('slideshow').trans && transtype == 'blendTrans')) {
		        dotrans=1;
		        transtype='blendTrans';
		        document.imgslide.style.filter = "blendTrans(duration=1,transition=1)";
	        }else{
		        dotrans=1;
		        transtype='revealtrans';
		        if (document.getElementById('slideshow').trans) transattributes = document.getElementById('slideshow').trans[document.getElementById('slideshow').trans.selectedIndex].value;
		        document.imgslide.style.filter = "revealTrans(duration=1,transition=" +transattributes+ ")";
	        }
        }
        //###########################################
        function preloadSlide() {
	        for(k=0;k<theimage.length;k++) {
		        theimage[k][0]=new Image().src=theimage[k][0];		        
	        }
        }
// End of Homepage Image/Testimonial Slider
