/*
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 showtrailGreenDog(){

	
	document.onmousemove=followmouse;
	newHTML = '<div style="padding: 4px; background-color:#FFFFFF; border: 1px solid #006600;">';
	newHTML = newHTML + '<div align="center" ><strong><font color="#006600">GREEN</font></strong></div><br><strong><font color="#006600">FREE SPIRIT</font></strong><br>Intelligent, independent, confident and clever, I prefer making my own decisions but will listen to you if you make a good case. We’re partners in this adventure. Treat me like one and we’ll both live happily ever after.<br><br><strong><font color="#006600">GO-GETTER</font></strong><br>Want to get more exercise? Action is my middle name. My “Let’s Go!” lifestyle will keep you motivated to get outside and move. I’ve got tons of energy, and just like the sun, I’m burning and working 24 hours a day, seven days a week. I’ll run for miles, chase a ball for hours, and still want to play at the end of the day. <br><br><strong><font color="#006600">LIFE OF THE PARTY</font></strong><br>I think everything is fun, interesting and meant for play, especially you. Anything you do, I’ll want to do too. With my own brand of surprises, life with me will keep you constantly on your toes, and the fun is guaranteed.</div>'; 
	newHTML = newHTML + '</div>';
	gettrailobjnostyle().innerHTML = newHTML;
	gettrailobj().display="inline";
}
function showtrailGreenCat(){

	
	document.onmousemove=followmouse;
	newHTML = '<div style="padding: 4px; background-color:#FFFFFF; border: 1px solid #006600;">';
	newHTML = newHTML + '<div align="center" ><strong><font color="#006600">GREEN</font></strong></div><br><strong><font color="#006600">MVP</font></strong><br />I’m a savvy cat who knows the score. I’m pretty unflappable, too. I don’t mind entertaining myself, but a human companion at the other end of the couch and a nice scratch behind the ears always make my day. If you’re looking for a resourceful addition to your team, think about signing this Most Valuable Pussycat.<br><br><strong><font color="#006600">PARTY ANIMAL</font></strong><br>I’m a cat on a mission: PARTY! I love to play and explore and test my limits. I’d love to play with you, but I can make a toy out of anything: pencils, post-it notes, potatoes. If you’re looking for some laughs and someone to liven up the party, think about inviting me.<br><br><strong><font color="#006600">LEADER OF THE BAND</font></strong><br>I’m a cat who does everything in a big way. I not only like to be in the middle of things, I like to lead the parade. I’m an adventurous cat, but I’ll still make plenty of time to show you my affectionate side. I’m the demonstrative type, you might say. Want a cat who’s brimming with confidence? That’s me.</div>'; 
	newHTML = newHTML + '</div>';
	gettrailobjnostyle().innerHTML = newHTML;
	gettrailobj().display="inline";
}
function showtrailOrangeDog(){

	
	document.onmousemove=followmouse;
	newHTML = '<div style="padding: 4px; background-color:#FFFFFF; border: 1px solid #FF6600;">';
	newHTML = newHTML + '<div align="center" ><strong><font color="#FF6600">ORANGE</font></strong></div><br><strong><font color="#FF6600">BUSY BEE</font></strong><br />I’m a naturally playful, curious, and trusting canine. Give me something to do by taking me for a big walk every day. After my job’s done, I’ll curl up in front of the fire with you in the evenings. I’m a dog on a mission to please both you and me.<br><br><strong><font color="#FF6600">WALLFLOWER</font></strong><br>Shy yet charming canine searching for patient owner with relaxed lifestyle. Looking to help me come out of my shell. Treat me sweet and kind and I’ll blossom.<br><br><strong><font color="#FF6600">GOOFBALL</font></strong><br>I’m a fun-loving, happy-all-the-time, glass-is-half-full kind of dog looking for someone who loves to laugh and play around. Must have a great sense of humor and a bunch of tennis balls!.</div>'; 
	newHTML = newHTML + '</div>';
	gettrailobjnostyle().innerHTML = newHTML;
	gettrailobj().display="inline";
}
function showtrailOrangeCat(){

	
	document.onmousemove=followmouse;
	newHTML = '<div style="padding: 4px; background-color:#FFFFFF; border: 1px solid #FF6600;">';
	newHTML = newHTML + '<div align="center" ><strong><font color="#FF6600">ORANGE</font></strong></div><br><strong><font color="#FF6600">THE EXECUTIVE</font></strong><br />I have to say, I’m a busy cat. First, I’ve got to check out what’s happening out the window. Next, I’ll see if any closets or cupboards need looking into. And then there are my naps – I can’t be late for those. I can fit a little socializing into my schedule. Shall we plan on breakfast and dinner? I hope you like kibbles.<br><br><strong><font color="#FF6600">SIDEKICK</font></strong><br>Like all sidekicks, I’m just plain good company. I like attention, and I also like my solitude. I don’t go looking for trouble but I’m no scaredy cat either. If you are looking for a steady companion to travel with you on the road of life, look no further.<br><br><strong><font color="#FF6600">PERSONAL ASSISTANT</font></strong><br>You’re working on the computer? Let me press the keys. Reading the paper? I’ll hold the pages down for you. Watching TV? I’ll just plop in your lap so you can pet me. I love an orderly household, don’t you? I’ll help you with all your chores then help you relax when we’re done. You’ll wonder how you ever managed without me.</div>'; 
	newHTML = newHTML + '</div>';
	gettrailobjnostyle().innerHTML = newHTML;
	gettrailobj().display="inline";
}
function showtrailPurpleDog(){

	
	document.onmousemove=followmouse;
	newHTML = '<div style="padding: 4px; background-color:#FFFFFF; border: 1px solid #663399;">';
	newHTML = newHTML + '<div align="center" ><strong><font color="#663399">PURPLE</font></strong></div><br><strong><font color="#663399">COUCH POTATO</font></strong><br />Like the easy life? Then I’m the perfect match for you. I’m a relaxed, laid back kind of dog who enjoys long naps, watching movies, curling up on laps, and walking very short distances from the couch to the food bowl and back.<br><br><strong><font color="#663399">TEACHER’S PET</font></strong><br>I’ve got the whole package: smart, fuzzy, four legs, love to learn and live to please. Go ahead, teach me anything. Sit, stay, balance your checkbook, I can do it all. Keep me entertained and I’ll be yours forever.<br><br><strong><font color="#663399">CONSTANT COMPANION</font></strong><br>Looking for an emotionally secure, mutually satisfying, low maintenance relationship? I am all you need. Let me sit at your feet, walk by your side, and I’ll be your devoted companion forever.</div>'; 
	newHTML = newHTML + '</div>';
	gettrailobjnostyle().innerHTML = newHTML;
	gettrailobj().display="inline";
}
function showtrailPurpleCat(){

	
	document.onmousemove=followmouse;
	newHTML = '<div style="padding: 4px; background-color:#FFFFFF; border: 1px solid #663399;">';
	newHTML = newHTML + '<div align="center" ><strong><font color="#663399">PURPLE</font></strong></div><br><strong><font color="#663399">PRIVATE INVESTIGATOR</font></strong><br />I’m working undercover to keep an eye on you and your household. You may not even know you’re under surveillance. I can vanish into thin air if anyone or anything interferes with my investigation. If you need a cat who knows how to stay out of trouble and will always keep your secrets, I just might take your case.<br><br><strong><font color="#663399">SECRET ADMIRER</font></strong><br>When it comes to relationships, I’m very level-headed. I don’t leap in paws first, if you know what I mean. But give me a little time, and then I’ll shower you with purrs, head-butts, and plenty of lap time. In the meantime, while you may not see a lot of me, I’ll be thinking a lot of you.<br><br><strong><font color="#663399">LOVE BUG</font></strong><br>Do you seek affection? I do! If you also like petting, purrs, and paws kneading your lap, I think we might have A LOT in common. I’m looking for “someone who enjoys quiet times and togetherness.” Could that someone be you?</div>'; 
	newHTML = newHTML + '</div>';
	gettrailobjnostyle().innerHTML = newHTML;
	gettrailobj().display="inline";
}

function hidetrail(){
	gettrailobj().innerHTML = " ";
	gettrailobj().display="none"
	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 < 380){
			xcoord = e.pageX - xcoord - 400; // 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 < 380){
			xcoord = event.clientX + truebody().scrollLeft - xcoord - 400; // 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"

}


