var frameloaded=false;
var whichtab="video";
function show_blog_or_video(){
	if (window.location.search.substring(1) == "b"){
		show_blog();
	}else{
		show_video();
	}
}

function show_video(){
	document.getElementById("girlblog").style.visibility = "hidden";
	document.getElementById("blogbody").style.backgroundColor = "#F8E5E4"; 
	document.getElementById("profbody").style.backgroundColor = "#FFC0BD"; 
	document.getElementById("profilestage").style.visibility = "visible";
	document.getElementById("prheadr").src = document.getElementById("prheadr").src.replace("off", "on");
	document.getElementById("jornhead").src = document.getElementById("jornhead").src.replace("on", "off");
	document.getElementById("profilestage").innerHTML = document.getElementById("girlmovies").innerHTML;
}

function show_blog(){
	document.getElementById("profilestage").innerHTML = ""
	document.getElementById("profbody").style.backgroundColor = "#F8E5E4"; 
	document.getElementById("blogbody").style.backgroundColor = "#FFC0BD"; 
	document.getElementById("prheadr").src = document.getElementById("prheadr").src.replace("on", "off");
	document.getElementById("jornhead").src = document.getElementById("jornhead").src.replace("off", "on");
	document.getElementById("profilestage").style.visibility = "hidden";
	document.getElementById("girlblog").style.visibility = "visible";
}

function setbrowserframe(){
	frameloaded='true';
	show_blog();
}

function stagedirection(direction){
	if(direction == "up"){
		currentstage++;
	}else if(direction == "down"){
		currentstage--;
	}else{
		currentstage=2; // this determines which weight stage to show as the default.. 0 is the start point
	}
	if(currentstage==0){
		document.getElementById("downarrow").style.visibility="hidden";
	}else if (currentstage==2){
		document.getElementById("uparrow").style.visibility="hidden";
		document.getElementById("bmi_img").src = document.getElementById("bmi_img").src.replace("pht", "pht_F");
	}else{
		document.getElementById("uparrow").style.visibility="visible";
		document.getElementById("downarrow").style.visibility="visible";
		document.getElementById("bmi_img").src = document.getElementById("bmi_img").src.replace("pht_F", "pht");
		

	}
	whichstage = thestages[currentstage].split("|");
	document.getElementById("stagetitle").innerHTML = whichstage[0];
	document.getElementById("bmi").innerHTML = whichstage[1];
	document.getElementById("bmichange").innerHTML = whichstage[2];
	document.getElementById("weight").innerHTML = whichstage[3];
	document.getElementById("weightchange").innerHTML = whichstage[4];
}

onLoad=show_blog_or_video();
if (agent.indexOf('safari') != -1) {
	document.getElementById("journalframe").addEventListener("onload",setbrowserframe(),false);
}
