/*
Simple Image Trail script- By JavaScriptKit.com
Visit http://www.javascriptkit.com for this script and more
This notice must stay intact
*/
 
var offsetfrommouse=[15,15]; //image x,y offsets from cursor position in pixels. Enter 0,0 for no offset
var displayduration=0; //duration in seconds image should remain visible. 0 for always.
var currentimageheight = 270;	// maximum image size.

if (document.getElementById || document.all){
	document.write('<div id="trailimageid">');
	document.write('</div>');
}

function gettrailobj(){
if (document.getElementById)
return document.getElementById("trailimageid").style
else if (document.all)
return document.all.trailimagid.style
}

function gettrailobjnostyle()
{
if (document.getElementById)
return document.getElementById("trailimageid")
else if (document.all)
return document.all.trailimagid
}


function truebody(){
return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function showtrail(imageno,showthumb,height)
{
	if (imageno == 1)
	{
		//imagename = 'wesley.jpg'
		//title = 'Wesley Y. Kim, M.D., F.A.A.P.'
		description = '<table border=0>'
		description = description +'<td valign="top" width="93">'
		description = description +'<img src="wesley.jpg" border="1" /></td>'
		description = description +'<td width="800">'
		description = description +'<strong>Wesley Y. Kim, M.D., F.A.A.P.</strong></td></tr>'
		description = description +'<tr><td colspan="2">'
		description = description +'<p align="justify">"I have been in general pediatric practice for the last 26 years. I take pride in being as thorough and complete as I can be. I also like to answer questions and explain things fully to parents. One of the joys of practice has been to watch kids grow up from birth to adulthood (and sometimes bring their own children in to see me)."'
		description = description +'<br><br>'
		description = description +'Dr. Kim attended college at the University of California, Irvine.  He went to medical school at the University of California, San Francisco.  He did his residency at Cedars-Sinai Medical Center and L.A. Children’s Hospital. He is certified by the American Board of Pediatrics and is the senior partner of Saddleback Pediatric Medical Group, Inc.'
		description = description +'</p></td>'
		description = description +'</tr></table>'
	}
	
	if (imageno == 2)
	{ 
		//imagename = 'wesley.jpg'
		//title = 'Wesley Y. Kim, M.D., F.A.A.P.'
		description = '<table border=0>'
		description = description +'<td valign="top" width="93">'
		description = description +'<img src="anna.jpg" border="1" /></td>'
		description = description +'<td width="800">'
		description = description +'<strong>Anna Lee, M.D., F.A.A.P.</strong></td></tr>'
		description = description +'<tr><td colspan="2">'
		description = description +'<p align="justify">"Since completing my residency training in 1996, I have had the pleasure of serving many patients and their families from Northern CA to Rhode Island and now in South Orange County.  I am constantly reminded of why I went into the field of pediatrics.  I truly enjoy the bond that I form with my patients and their families.  I love watching an infant transform into a confident child and a child blossom into a young adult.  It is a great privilege to be a part of that process.  I am honored to have the trust of my patients and their families to guide them through the complexities of pediatric medicine and development."'
		description = description +'<br><br>'
		description = description +'Dr. Lee attended Occidental College in Los Angeles.  She graduated from Rosalind Franklin University/Chicago Medical School.  She completed her residency training at University of California, Davis Medical Center.  She was in private practice in San Jose, CA for 8 years before moving to RI for 2 years.  She and her husband came to their senses and came back to sunny CA and are here to stay.  She joined Saddleback Pediatrics in 2007.  Dr. Lee is certified by the American Board of Pediatrics.'
		description = description +'</p></td>'
		description = description +'</tr></table>'
	}
	
	if (imageno == 3)
	{
		//imagename = 'wesley.jpg'
		//title = 'Wesley Y. Kim, M.D., F.A.A.P.'
		description = '<table border=0>'
		description = description +'<td valign="top" width="93">'
		description = description +'<img src="Natori.jpg" border="1" /></td>'
		description = description +'<td width="800">'
		description = description +'<strong>Paige S. Natori, M.D., F.A.A.P.</strong></td></tr>'
		description = description +'<tr><td colspan="2">'
		description = description +'<p align="justify">"I love kids and I can’t imagine being in any other field than pediatrics. I love watching babies develop their own individual personalities, gaining their independence and growing into young adults. The triangular bond between myself, my patient, and the parents is the most rewarding aspect of what I do."'
		description = description +'<br><br>'
		description = description +'Dr. Natori attended college at the University of California in Irvine. She is a graduate of the Boston University School of Medicine. She served her residency at Harbor-UCLA Medical Center and is certified by the American Board of Pediatrics. She joined Saddleback Pediatric Medical Group in 2005.'
		description = description +'</p></td>'
		description = description +'</tr></table>'
	}
	
	if (imageno == 4)
	{
		//imagename = 'wesley.jpg'
		//title = 'Wesley Y. Kim, M.D., F.A.A.P.'
		description = '<table border=0>'
		description = description +'<td valign="top" width="93">'
		description = description +'<img src="kim.jpg" border="1" /></td>'
		description = description +'<td width="800">'
		description = description +'<strong>Jami Kemp., R.N., M.S.N., C.P.N.P.</strong></td></tr>'
		description = description +'<tr><td colspan="2">'
		description = description +'<p align="justify">It is my joy and pleasure to work with children and their parents. I love to establish long term relationships with families and to assist them to raise happy, healthy children. I try and approach each child in a gentle manner to put them at ease and listen carefully to the questions and concerns of each parent.'
		description = description +'<br><br>'
		description = description +'Kimberly Rice received her RN from the California Hospital School of Nursing. She completed her Pediatric Nurse Practitioner certification through UCLA. She is certified by the National Association of Pediatric Nurse Practitioners.'
		description = description +'</p></td>'
		description = description +'</tr></table>'
	}
	
        if (imageno == 5)
	{
		description = '<table border=0>'
		description = description +'<tr>'
		description = description +'<td width="800">'
		description = description +'<img src="newloaction.jpg"/>'
		description = description +'</td>'
		description = description +'</tr></table>'
	}

	if (height > 0)
	{
		currentimageheight = height;
	}

	document.onmousemove=followmouse;

	cameraHTML = '';
	
	newHTML = '<div style="padding: 5px; background-color: #FFF; border: 1px solid #888;">';
	//newHTML = newHTML + '<h2>' + title + '</h2>';
	newHTML = newHTML + description + '';

	if (showthumb > 0)
	{
		//newHTML = newHTML + '<div align="center" style="padding: 8px 2px 2px 2px;"><img src="' + imagename + '" border="0"></div>';
	}

	newHTML = newHTML + '</div>';

	gettrailobjnostyle().innerHTML = newHTML;

	gettrailobj().visibility="visible";

}


function hidetrail(){
	gettrailobj().visibility="hidden"
	document.onmousemove=""
	gettrailobj().left="-500px"

}

function followmouse(e){

	var xcoord=offsetfrommouse[0]
	var ycoord=offsetfrommouse[1]

	var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
	var docheight=document.all? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(window.innerHeight)

	//if (document.all){
	//	gettrailobjnostyle().innerHTML = 'A = ' + truebody().scrollHeight + '<br>B = ' + truebody().clientHeight;
	//} else {
	//	gettrailobjnostyle().innerHTML = 'C = ' + document.body.offsetHeight + '<br>D = ' + window.innerHeight;
	//}

	if (typeof e != "undefined"){
		if (docwidth - e.pageX < 300){
			xcoord = e.pageX - xcoord - 286; // Move to the left side of the cursor
		} else {
			xcoord += e.pageX;
		}
		if (docheight - e.pageY < (currentimageheight + 110)){
			ycoord += e.pageY - Math.max(0,(110 + currentimageheight + e.pageY - docheight - truebody().scrollTop));
		} else {
			ycoord += e.pageY;
		}

	} else if (typeof window.event != "undefined"){
		if (docwidth - event.clientX < 300){
			xcoord = event.clientX + truebody().scrollLeft - xcoord - 286; // Move to the left side of the cursor
		} else {
			xcoord += truebody().scrollLeft+event.clientX
		}
		if (docheight - event.clientY < (currentimageheight + 110)){
			ycoord += event.clientY + truebody().scrollTop - Math.max(0,(110 + currentimageheight + event.clientY - docheight));
		} else {
			ycoord += truebody().scrollTop + event.clientY;
		}
	}

	var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
	var docheight=document.all? Math.max(truebody().scrollHeight, truebody().clientHeight) : Math.max(document.body.offsetHeight, window.innerHeight)
		if(ycoord < 0) { ycoord = ycoord*-1; }
	gettrailobj().left=xcoord+"px"
	gettrailobj().top=ycoord+"px"

}

