
var browserOK = false;
var pics;
browserOK = true;
pics = new Array();
var objCount = 0; 
var strSelection = '';

//This loads all the images ready for use - see end of this script for the preparation calls.
function PreLoadImages(name, first, second){
	if (browserOK){
		pics[objCount] = new Array(4);
		pics[objCount][0] = new Image();
		pics[objCount][0].src = first;
		pics[objCount][1] = new Image();
		pics[objCount][1].src = second;
		pics[objCount][2] = name;
		objCount++;
	}
}


function ReplaceImage(){ //v2.0
	j = 0;
	ImgArray = new Array;
	oldImgArray = document.OriginImage;

	for (i = 0; i < ReplaceImage.arguments.length; i += 2) {
		obj=ReplaceImage.arguments[i]
		ImgArray[j++] = obj;
		if (oldImgArray == null || oldImgArray[j-1] != obj)
			ImgArray[j++] = obj.src;
		else
			ImgArray[j++] = oldImgArray[j];
		obj.src = ReplaceImage.arguments[i + 1];
	}
	if (document.OriginImage == null)
		document.OriginImage = ImgArray;
}

//This is called as the mouse over event with the IName value
function MOImageOn(name)	{
	if (browserOK)	{
		for (i = 0; i < objCount; i++)	{
		if (document.images[pics[i][2]] != null)
			if (name != pics[i][2])	{
				if (pics[i][0].complete)
					document.images[pics[i][2]].src = pics[i][0].src;
				}	else	{
					if (pics[i][1].complete)
						document.images[pics[i][2]].src = pics[i][1].src;
					}
			}
		}

	switch(strSelection){
		case "character":
			ReplaceImage(document.IName1,'img/character-over.gif');
			break;
		case "competence":
			ReplaceImage(document.IName2,'img/competence-over.gif');
			break;
		case "compassion":
			ReplaceImage(document.IName3,'img/compassion-over.gif');
			break;
	}

	}

//This is called on the mouse out event - currently without any values
function MOImageOff(name){
	if (browserOK)	{
		for (i = 0; i < objCount; i++)	{
		if (document.images[pics[i][2]] != null)
			if (name != pics[i][2])	{
				if (pics[i][0].complete)
					document.images[pics[i][2]].src = pics[i][0].src;
				}	else	{
					if (pics[i][1].complete)
						document.images[pics[i][2]].src = pics[i][0].src;
					}
			}
		}

	switch(strSelection){
		case "character":
			ReplaceImage(document.IName1,'img/character-over.gif');
			break;
		case "competence":
			ReplaceImage(document.IName2,'img/competence-over.gif');
			break;
		case "compassion":
			ReplaceImage(document.IName3,'img/compassion-over.gif');
			break;
	}
	}

function clickText(objText){
  if (objText == 'character'){
        desc = 'The clinicians at Rose Street strive to be men and women of character.  We seek to develop qualities which are the foundation of lasting success.  Qualities like integrity, courage, justice, patience, industry, and simplicity.  These goals are integral to a trusting relationship which results in healing and change.'
		ReplaceImage(document.IName1,'img/character-over.gif');
		ReplaceImage(document.IName2,'img/competence.gif');
		ReplaceImage(document.IName3,'img/compassion.gif');
  } else if (objText == 'competence'){
        desc = 'We have training and experience from some of the finest educational institutions in the world - places like Yale University and the Menninger Clinic.  Also we have studied with some of the finest teachers and clinicians in the country.  Our interns are trained under close supervision by our senior therapists so that we can assure that new therapists are equipped in a manner consistent with the goals and philosophy of RSMHC.'
		ReplaceImage(document.IName1,'img/character.gif');
		ReplaceImage(document.IName2,'img/competence-over.gif');
		ReplaceImage(document.IName3,'img/compassion.gif');


  } else if (objText == 'compassion'){
        desc = 'We are above all else, people who recognize our connections to others.  When others suffer, we suffer.  When others rejoice, we are right there rejoicing too.  We are committed to leave our kids a better, more compassionate world, and we feel like that job starts right here in our own offices with you, the ones who have entrusted us with both your pain and your dreams.';
		ReplaceImage(document.IName1,'img/character.gif');
		ReplaceImage(document.IName2,'img/competence.gif');
		ReplaceImage(document.IName3,'img/compassion-over.gif');
  }

if (document.getElementById) 
{
    document.getElementById("object1").innerHTML = desc;
} 
else
{
	if (document.layers) 
	{
		x = document.layers["object1"];
		text2 = '<P CLASS="testclass">' + text + '</P>';
		x.document.open();
		x.document.write(text2);
		x.document.close();
   }
}
strSelection = objText;
	switch(strSelection){
		case "character":
			ReplaceImage(document.IName1,'img/character-over.gif');
			break;
		case "competence":
			ReplaceImage(document.IName2,'img/competence-over.gif');
			break;
		case "compassion":
			ReplaceImage(document.IName3,'img/compassion-over.gif');
			break;
	}
 

}

function changeText(objText){
  if (objText == 'character'){
        desc = 'The clinicians at Rose Street strive to be men and women of character.  We seek to develop qualities which are the foundation of lasting success.  Qualities like integrity, courage, justice, patience, industry, and simplicity.  These goals are integral to a trusting relationship which results in healing and change.'
		ReplaceImage(document.IName1,'img/character-over.gif');
		ReplaceImage(document.IName2,'img/competence.gif');
		ReplaceImage(document.IName3,'img/compassion.gif');
  } else if (objText == 'competence'){
        desc = 'We have training and experience from some of the finest educational institutions in the world - places like Yale University and the Menninger Clinic.  Also we have studied with some of the finest teachers and clinicians in the country.  Our interns are trained under close supervision by our senior therapists so that we can assure that new therapists are equipped in a manner consistent with the goals and philosophy of RSMHC.'
		ReplaceImage(document.IName1,'img/character.gif');
		ReplaceImage(document.IName2,'img/competence-over.gif');
		ReplaceImage(document.IName3,'img/compassion.gif');


  } else if (objText == 'compassion'){
        desc = 'We are above all else, people who recognize our connections to others.  When others suffer, we suffer.  When others rejoice, we are right there rejoicing too.  We are committed to leave our kids a better, more compassionate world, and we feel like that job starts right here in our own offices with you, the ones who have entrusted us with both your pain and your dreams.';
		ReplaceImage(document.IName1,'img/character.gif');
		ReplaceImage(document.IName2,'img/competence.gif');
		ReplaceImage(document.IName3,'img/compassion-over.gif');
  }
  	switch(strSelection){
		case "character":
			ReplaceImage(document.IName1,'img/character-over.gif');
			break;
		case "competence":
			ReplaceImage(document.IName2,'img/competence-over.gif');
			break;
		case "compassion":
			ReplaceImage(document.IName3,'img/compassion-over.gif');
			break;
	}
}

//Change these to reflect the image - Image name, Image for ON, Image for OFF
PreLoadImages("IName1", "img/character.gif", "img/character-over.gif");
PreLoadImages("IName2", "img/competence.gif", "img/competence-over.gif");
PreLoadImages("IName3", "img/compassion.gif", "img/compassion-over.gif");

//-->
