//variables and funciton calls for the animated title


window.onload = initIndex; 
var popTime = null; 
var x = 0; 
var y = -100; 
var positions = new Array("-99px", "-98px", "-95px", "-88px", "-80px", "-64px", "-39px", "-9px", "1px", "5px", "0px"); 
var t = null; 
var fadeTime = null; 
var divNum = 0; 
var posNum = 0; 
	var iNum = 0; 
	var iMax = 100; 




function initIndex()
{
	popTime = setInterval("popUp()",10); 
}

//This function pops up the speechBubble.  
function popUp()
{
//	var size = new Array("1px","2px","3px","4px","5px","6px","7px","8px","9px","20px","30px","40px","50px","60px","90px","150px","200px","250px","300px","400px","519px"); 
//	var sizeX = "" + x + "px";
	var speechBubble = document.getElementById("speechBubble")
	speechBubble.setAttribute("width",x); 
	if(x ==500)
	{
		clearInterval(popTime); 
		t = setInterval(moveAround,3); 
	}
	x += 5; 
}


function moveAround()
{
	var divs = document.getElementById("div"+divNum+""); 
	var position = "0px " + y + "px"; 
	divs.style.backgroundPosition = position; 
	y+= 5; 
	if(y == 0)
	{
		checkValue(divs); 
		y = -100; 
	}
}

function checkValue(divs)
{
	divNum++; 
	clearInterval(t); 
	if (divNum < 12)
	{
		t = setInterval(moveAround,3); 
	}
	else if (divNum == 12)
	{
		checkFade(); 
	}
}


function checkFade()
{
	fadeTime = setInterval(fadeIn, 50); 
}


function fadeIn()
{
	var faders = document.getElementById("rightSide"); 
	var faders1 = document.getElementById("leftSide"); 
	var faders2 = document.getElementById("girls"); 
	var faders3 = document.getElementById("text"); 
	var faders4 = document.getElementById("links"); 
	var newOpacity = iNum / 100; 
	var newOpacity1 = iNum; 
	faders.style.filter = "alpha(opacity=" + newOpacity1 + ")";
	faders.style.opacity = newOpacity; 
	faders1.style.filter = "alpha(opacity=" + newOpacity1 + ")";
	faders1.style.opacity = newOpacity; 
	faders2.style.filter = "alpha(opacity=" + newOpacity1 + ")";
	faders2.style.opacity = newOpacity; 
	faders3.style.filter = "alpha(opacity=" + newOpacity1 + ")";
	faders3.style.opacity = newOpacity; 
	faders4.style.filter = "alpha(opacity=" + newOpacity1 + ")";
	faders4.style.opacity = newOpacity; 
	iNum ++; 
	if (iNum == iMax)
	{
		clearInterval(fadeTime); 
	}
}
/*
function fadeIn()
{
	var faders = new Array(); 
	faders[0] = document.getElementById("rightSide"); 
	faders[1] = document.getElementById("leftSide"); 
	faders[2] = document.getElementById("links"); 
	faders[3] = document.getElementById("text"); 
	faders[4] = document.getElementById("girls"); 
	for (i=0; i<faders.length; i++)
	{
		faders[i].style.filter = "alpha(opacity=" + newOpacity + ")";
		faders[i].style.opacity = newOpacity;
	}
	newOpacity += 0.001; 
}*/



//and these two are the functions that shake the images
var arrX = new 
Array("-1px","-2px","-3px","-4px","-5px","-4px","-3px","-2px","-1px","0px","1px","2px","3px","4px","5px","4px","3px","2px","1px","0px","-1px","-2px","-3px","-4px","-5px","-4px","-3px","-2px","-1px","0px","1px","2px","3px","4px","5px","4px","3px","2px","1px","0px","-1px","-2px","-3px","-4px","-5px","-4px","-3px","-2px","-1px","0px","1px","2px","3px","4px","5px","4px","3px","2px","1px","0px","-1px","-2px","-3px","-4px","-5px","-4px","-3px","-2px","-1px","0px","1px","2px","3px","4px","5px","4px","3px","2px","1px","0px"); 
var linkPos = 0; 
var time = null; 
var shaker; 
function checkX()
{
	if (linkPos == 0)
	{
		time = setInterval(shakeImage,5); 
	}
}

function shakeImage()
{
	shaker.style.left = arrX[linkPos]; 
	linkPos++; 
	if (linkPos == arrX.length)
	{
		linkPos = 0; 
		clearInterval(time); 
	}
}



function writeToBox1()
{
	var writeIn = document.getElementById("textArea"); 
	writeIn.innerHTML = violetHTML; 
}

function writeToBox2()
{
	var writeIn = document.getElementById("textArea"); 
	writeIn.innerHTML = katieroseHTML; 
}

function writeToBox3()
{
	var writeIn = document.getElementById("textArea"); 
	writeIn.innerHTML = camillaHTML; 
}

function writeToBox4()
{
	var writeIn = document.getElementById("textArea"); 
	writeIn.innerHTML = yasamanHTML; 
}


//Here is all of the innerHTML thingys: 

var violetHTML = '<div id="info"><h1>Violet</h1><img id="emot" width="30px" src="../images/emot/emot_BIGsmiley.jpg" alt="" /><p><span>Activities:</span> Um, spending time with my dad, putting together outfits, writing poetry, making funny voices<br /><span>Likes:</span> Haiku, making new friends,my mom’s parmesan chicken. NOT In-N-Out Burger. <br /><span>Luvs:</span> My mom. (I miss her.) my dad. my super fabulous flower friends!<br /><span>About Me:</span> Sometimes I come across as tough, but I’m not. I’m good at crying silently, that’s all. But I don’t have as much to cry about as I used to, which is a very excellent thing.</p><a href="../images/screensavers/violet_screensaver.jpg.zip">*all about Violet screensaver  :)</a><br /><a href="../images/screensavers/violet_widescreen.jpg.zip">*all about Violet in widescreen!!</a>'; 

var katieroseHTML = '<div id="info"><h1>Katie-Rose</h1><img id="emot" width="30px" src="../images/emot/emot_goofy.jpg" alt="" /> <p><span>Activities:</span> Videoing everything that happens, to prepare for my career as a cinematographer, eating Cheez-Its, staring pointedly at Max’s pink plaid socks.<br /><span>Likes:</span> Tie-dye, YouTube, iMovie, blogs, instant messaging<br /><span>Luvs:</span> Do I have to spell it out? my awesometatiousful flower-power friends! Der! Also the color yellow. sunshine yellow, like my video camera. Oh! and the most awesometatiousful-est website EVER: LuvYaBunches.com!!!!!!<br /><span>About Me:</span> One day I want to be a cinematographer . . . or a producer, or a screenwriter! Back-up plan: President of the United States.</p><a href="../images/screensavers/katierose_screensaver.jpg.zip">*all about Katie-Rose screensaver  :)</a><br /><a href="../images/screensavers/katierose_widescreen.jpg.zip">*all about Katie-Rose in widescreen!!</a>'; 


var camillaHTML = '<div id="info"><h1>Camilla</h1><img id="emot" width="70px" src="../images/emot/emot_turtle2.jpg" alt="" /> <p><span>Activities:</span> Dance class, practicing pop star moves in the mirror (but ONLY when no one’s watching), daydreaming<br /><span>Likes:</span> Pandas (the animal, NOT the club), the beach, Mom Abigail’s sparkly lime green scarf with pink flowers, Mom Joyce’s awesome convertible. (Max.) (Don’t tell!!!!)<br /><span>Luvs:</span> Tally, my orange-and-red wooden bobble-head turtle. ALL turtles. And my BFF’s, of course!!!!!!<br /><span>About Me:</span> Sometimes I worry. Um, maybe more than sometimes. I’m getting better, though. And it’s all thanks to flower power!!!!</p><a href="../images/screensavers/camilla_screensaver.jpg.zip">*all about Camilla screensaver  :)</a><br /><a href="../images/screensavers/camilla_widescreen.jpg.zip">*all about Camilla in widescreen!!</a>';

var yasamanHTML = '<div id="info"><h1>Yasaman</h1><img id="emot" width="30px" src="../images/emot/emot_surprise.jpg" alt="" /> <p><span>Activities:</span> Working on web design, building my very first website, blogging, creating new smilies. Spending time with my little sister.<br /><span>Likes:</span> The Internet, computers, HTML, Turkish apple tea, the color orange, Miley Cyrus.<br /><span>Luvs:</span> My little sister Nigar, my family, my cat, Blackberry, books, school. FROGS. and my besties, Katie-Rose, Milla, and Violet!!!!!!<br /><span>About Me:</span> My favorite time of day is when I get home, because after I take off my hijab, and after I fix my little sister a snack, and after I do my chores . . . After all that, I get to sit down at my computer and it’s . . . ahhhhhh. Paradise.</p><a href="../images/screensavers/yasaman_screensaver.jpg.zip">*all about Yasaman screensaver  :)</a><br /><a href="../images/screensavers/yasaman_widescreen.jpg.zip">*all about Yasaman in widescreen!!</a>';


