var pwlp="<b><i>The Porkjerky.com Weight Loss Program</i></b>";		// Makes name easy to use
var slide=0;							// holds current slide the slideshow is on
var section=1;							// section of screen exerciser is currently in
var calories=0;							// running count of calories burned
var hard=0;							// intensity level of workout
var show=new Array(4);						// holds slideshow pics

for (slide=0; slide<4; ++slide)
    // declares/sets/loads pics for slideshow
	{show[slide]= new Image();
	show[slide].src="diet/slide" + slide + ".jpg";
	}
slide=2;


    //	++++++++++++++++++	CONFIGURATION DATA  ABOVE		++++++++++++++++++
    //	++++++++++++++++++	MAIN PAGE FUNCTIONS BELOW		++++++++++++++++++


function changeslide()
    // changes slideshow picture and caption 
	{var text="My Slide Show Fucked Up";
	slide=(slide + 1)%4;
	switch (slide)
    // assigns right caption to picture
		{case 0:	text="Notice how my bedroom wall is intact.  By using " + pwlp + " my program, I have always been able to use the ";
			text+="door. Just like a normal fucking person."
			break;
		case 1:	text="And to think that only 60 months ago I still didn't fit into those.<br>";
			text+="How would you even wipe an ass that huge?";
			break;
		case 2:	text="Call me a new-age pussy, but I'm sticking to proper diet and regular exercise. ";
			break; 
		case 3:	text="Here's a computer enhanced picture of what might have been if I was a fuckhead and got fat in the first place.";
			break; 
		}
	document.getElementById("caption").innerHTML = text
	document.getElementById("slideshow").src=show[slide].src;			
	setTimeout("changeslide()", 7500); 
    // changes picture/caption every 7.5 seconds
	}	
function eligibility() 
    // puts message in chart based on height/weight entered
	{var ret="You're either so fat that your fingers can't use the keyboard or so stupid that you don't know how to use the above chart. ";
	ret+="In either case, I recommend <a href=\"" + ROOT + "free/suicide.php\">this page</a> of porkjerky.com to solve your problem, and not the one you are viewing."; 
	var n=Math.round(Math.random()*150); 	
	var wt=document.getElementById("inpounds").value;
	var ht=document.getElementById("infeet").value *12 +document.getElementById("ininches").value*1;
	var size=wt/ht;
	if (size<=1.95)
    // anorexic message
		{n%=3;
		switch(n)
			{case 0:	ret="Neat-o, you're super skinny. Nothing's sexier than a skeleton with a distended stomach.";	break;
			case 1:	ret="Yippee a bulimic fuck. I am impressed.";						break;
			case 2:	ret="Wow, you're anorexic. Wish I could be cool and have anemia too.";			break;
			}
		}
	if ((size>1.95) && (size<2.25))
    // fit message
		{n%=5;
		switch(n)
			{case 0:	ret="Way to go, you're not a fat fuck. You need a chart to tell you that?";	break;
			case 1:	ret="Wow, you're not fat---Want a cookie? (Sweet bitchlips I am funny)";	break;
			case 2:	ret="La de cocksucking da.  You're the proper weight for your height.";	break;
			case 3:	ret="Big fucking deal, you're suppose to be that size.";			break;
			case 4:	ret="I'd say 'Congratulations', but you're suppose to be that fucking size.";	break;	
			}
		ret+=pwlp + " is for you.";
		}
	if ((size>=2.25) && (size<=2.6))
    // slightly fat message
		{n%=4;
		switch(n)
			{case 0:	ret="Uh-oh, you're entering chunkified territory." + pwlp + " is a must for you.";	break;
			case 1:	ret="Yikes, I see a Moo-Moo your near future. Better get on " + pwlp + " now.";	break;
			case 2:	ret="Hey Tubby Tubinski--you need to get on " + pwlp + " before its too late.";		break;
			case 3:	ret="Put Down the Pie. Put Down the Pie. Fatassedness is on your horizon.";	
				ret+=pwlp + " may work.";			
				break;
			}
		}
	if ((size>2.6) && (size<=5))
    // fat message
		{n%=5;
		switch(n)
			{case 0:	ret="Fuck me you're fat. And not just fat fat, I'm talking a Rolo away from bedridden fat.";	break;
			case 1:	ret="Hide the fucking Crisco you're huge.";						break;
			case 2:	ret="Mother of fuck you're huge. Rolling and clicking the mouse probably gets you winded.";	break;
			case 3:	ret="Sweet hunks of chocolate covered blubber you are gigantic.";				break;
			case 4:	ret="Jesus Field Goal Kicking Christ.  You are huge enough for not just ";
				ret+="2 people, but 2 morbidly obese people. ";
				break;
			}
		}
	if (size>5)
    // superfat message 
		{ret="No, seriously--How do you even wipe your ass or just take a shit for that matter? I'm geniunely curious,  ";
		ret+="<a href=\"mailto:jason@porkjerky.com\" class=\"addrlink\">E-mail me</a>.";  
		}
	document.getElementById("eligiblemsg").innerHTML =ret;
	}
function loadexerciser()
    // opens exercisor page
	{loc=ROOT + "omniscience/diet/exercisor.php?level=" + hard;
 	window.open(loc,'linker','width=400,height=430,scrollbars=no,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=no'); 
	return false;
	}

    //	++++++++++++++++++	MAIN PAGE FUNCTIONS ABOVE		++++++++++++++++++
    //	++++++++++++++++++	EXERCISOR FUNCTIONS  BELOW		++++++++++++++++++

function dorep() 
    // handles button click, updates calories burned, etc.
	{calories+=.055; 
	var n=Math.round(Math.random()*20); 
	var msg="Just a couple more, you can do it.";
	if (hard>0) 
		{calories+=.095; 
		movepopup();
		}
	switch(n) 
		{case 0: 	msg="For a fat, lazy lump of worthless crap, you're doing pretty average.";
			break;
		case 1: 	msg="Come on Chubberella, you gotta want it."; 
			break; 
		case 2: 	msg="Before long, people will have to call you 'That skinny, ugly asshole'."; 
			break; 
		case 3: 	msg="Don't be a hero, take this at your own pace, There's no one here to impress."; 
			break; 
		case 4: 	msg="Looking good. Looking real good.<p>Relatively speaking of course--Come on, ";
			msg+="I'm not a miracle worker, you're still a fat fuck."; 
			break; 
		case 5: 	msg="Come on, lardfuck, keep it up. Just a couple hundred thousand more."; 
			break; 
		case 6: 	msg="I don't say this to a lot of people who come here to workout, but for a lazy piece "; 
			msg+="of shit, you're doing pretty mediocrely."; 
			break; 
		case 7: 	msg="You're gonna fit into that sexy new house dress in no time at all."; 
			break; 
		case 8: 	msg="Come on, you can do it. Just dig deep. Deep into your fat ass."; 
			break; 
		case 9: 	msg="At the rate you're going, Sea World's losing an attraction."; 
			break; 
		case 10: 	msg="If you feel winded or overheated, just take a break and cool off for a minute."; 
			break; 
		case 11: 	msg="You haven't had a workout like this since that stubborn package of M&M's."; 
			break; 
		case 12: 	msg="You're getting buff now. The milligrams of weight are just falling off of "; 
			msg+="you like you wouldn't believe."; 
			break; 
		case 13: 	msg="Who needs gastric bypass when you have 3,000 years and this great exercise tool?"; 
			break; 
		case 14: msg="Boy, you're gonna be sore tomorrow."; 
			break; 
		case 15: msg="Look at you go. This is a piece of cake--It's just an expression--not an offer."; 
			break; 
		case 16: 	msg="Not too long until you have a rock hard bod. Of course, you'll still be ugly as "; 
			msg+="shit and a dumbfuck. But a rock hard bod none-the-less"; break;
		} 
	document.getElementById("encouragement").innerHTML = msg; 
	document.getElementById("totcals").innerHTML = Math.round(calories*1000)/1000; 
	document.getElementById("totpounds").innerHTML = Math.round((calories/3500)*100000)/100000;
	}
function movepopup() 
	{var xloc=Math.round(Math.random()*150); 
	var yloc=1;
	 if ((section==1) || (section==3) || (section==6) || (section==8)) xloc%=5; 
	else xloc%=3; 
	switch(section) 
		{case 1: 	if (xloc==0) yloc=3; 
			if (xloc==1) yloc=5; 
			if (xloc==2) yloc=6; 
			if (xloc==3) yloc=7; 
			if (xloc==4) yloc=8; 
			break; 
		case 2: 	if (xloc==0) yloc=6; 
			if (xloc==1) yloc=7; 
			if (xloc==2) yloc=8; 
			break; 
		case 3: 	if (xloc==0) yloc=1; 
			if (xloc==1) yloc=4; 
			if (xloc==2) yloc=6; 
			if (xloc==3) yloc=7; 
			if (xloc==4) yloc=8; 
			break; 
		case 4: 	if (xloc==0) yloc=3; 
			if (xloc==1) yloc=5; 
			if (xloc==2) yloc=8; 
			break; 
		case 5: 	if (xloc==0) yloc=1; 
			if (xloc==1) yloc=4; 
			if (xloc==2) yloc=6; 
			break; 
		case 6: 	if (xloc==0) yloc=1; 
			if (xloc==1) yloc=2; 
			if (xloc==2) yloc=3; 
			if (xloc==3) yloc=5; 
			if (xloc==4) yloc=8; 
			break; 
		case 7: 	if (xloc==0) yloc=1; 
			if (xloc==1) yloc=2; 
			if (xloc==2) yloc=3; 
			break; 
		case 8: 	if (xloc==0) yloc=1; 
			if (xloc==1) yloc=2; 
			if (xloc==2) yloc=3; 
			if (xloc==3) yloc=4; 
			if (xloc==4) yloc=6; 
			break;
		}
	section=yloc; 
	xloc=Math.round(Math.random()*25); 
	yloc=Math.round(Math.random()*25); 
	if (section>3) yloc+=190; 
	if (section>5) yloc+=190; 
	if ((section!=1) && (section!=4) && (section!=6)) xloc+=270; 
	if ((section==3) || (section==5) || (section==8)) xloc+=270; 
	window.moveTo(xloc, yloc);
	}

function changeworkout() {hard=(hard+1)%2; } 

function calorietime() 
	{++calories;
	var msg="Congratulations:<br>Just sitting on that fat ass of yours burns a calorie every 43 seconds. ";
	msg+="It's been added to the total.";
	document.getElementById("totcals").innerHTML =Math.round(calories*1000)/1000;
	document.getElementById("encouragement").innerHTML = msg;
	document.getElementById("totpounds").innerHTML = Math.round((calories/3500)*100000)/100000;
	setTimeout("calorietime()", 43000);
	}




