if (typeof(Sys) == "undefined")
{
//	alert(window.location.pathname + " says: Registering BrowserUtil.js because my developer forgot to.");
	document.writeln("<scr" + "ipt src=\"/js/BrowserUtil.js\" type=\"text/javascript\"></script>");
}

//handle issue with Safari not showing video consistantly
var isSafari = (navigator.userAgent.indexOf("Safari") > -1) ? true : false;

if(isSafari || Sys.Browser.agent == Sys.Browser.Safari)
{
	safariDiv = document.createElement("div");
	safariDiv.setAttribute("id", "safariFix");
	document.body.appendChild(safariDiv);
}	
//End Safari fix

function Answer(videoPath, text)
{
	this.videoPath = (videoPath) ? videoPath : null;
	this.text = (text) ? text : null;
}

function Answer(videoPath, videoTitle, text)
{
	this.videoPath = (videoPath) ? videoPath : null;
	this.videoTitle = (videoTitle) ? videoTitle : null;
	this.text = (text) ? text : null;
}

function StateTracker()
{
	this.activeButton = null;
	this.activeState = null;
}

StateTracker.prototype.setState = function(buttonObj, stateStr)
{
	this.activeButton = (buttonObj) ? buttonObj : this.activeButton;
	this.activeState = (stateStr) ? stateStr : this.activeState;
}

function showInfo()
{
	if (defaultPanel.style.display == "block") defaultPanel.style.display = "none";
	if (!viewPortPanel.style.display || viewPortPanel.style.display == "none") viewPortPanel.style.display = "block";
	if (stateTracker.activeState == "video")
	{
		answerTextPanel.style.display = "none";
		playerPanel.style.display = "block";
		//handle issue with Safari not showing video consistantly
		if (isSafari) safariDiv.innerHTML += "";
		//End Safari fix
		
		var guid = stateTracker.activeButton.answer.videoPath;
		if (guid.length == 0)
			return;
			
		var jsOrd = "&ord=" + Math.random()*999999;
		var jsUrl = "http://oxygen.feedroom.com/?&skin=twoclip&fr_story=" + guid + jsOrd;
    //  alert(jsUrl);
		playerPanel.innerHTML = "<iframe id=\"frmFeedroom\" src=\"" + jsUrl + "\" width=\"322\" height=\"277\" scrolling=\"no\" marginheight=\"0\" marginwidth=\"0\" topmargin=\"0\" leftmargin=\"0\" frameborder=\"0\"></iframe>";
		var titleDiv = document.createElement("div");
		titleDiv.align = "center";
		titleDiv.style.backgroundColor = "#FFFFFF";
		titleDiv.style.lineHeight = "4em";
		titleDiv.style.fontWeight = "bold";
		titleDiv.style.width = "322px";
		titleDiv.style.height = "32px";
		
		if (stateTracker.activeButton.answer.videoTitle != null)
		{
			var title = stateTracker.activeButton.answer.videoTitle;
			titleDiv.innerHTML = title;
		}
		playerPanel.appendChild(titleDiv);
		
	//	videoPlayer.createPlayer([stateTracker.activeButton.answer.videoPath]);
	}
	else if(stateTracker.activeState == "text")
	{
	//	videoPlayer.destroyPlayer();
		playerPanel.innerHTML = "";
		
		playerPanel.style.display = "none";
		answerTextPanel.style.display = "block";
		answerTextPanel.innerHTML = stateTracker.activeButton.answer.text;
		answerTextPanel.scrollTop = 0;//scroll div back to top
	}
	clientTracker.sendRequest();//send insight request;
}

function setTab(type)
{
	//show or hide appropriate tab
	if (type == 'text')
	{
		textTabImage.style.display = 'block';
		videoTabImage.style.display = 'none';
	}
	else
	{
		textTabImage.style.display = 'none';
		videoTabImage.style.display = 'block';
	}
	stateTracker.setState(null, type);
	showInfo();
	
	if (Sys.Browser.agent == Sys.Browser.InternetExplorer)
		event.returnValue = false; 
		
	return false;
}

//handle tracking when a user clicks on a button or tab
var clientTracker = new InsightClientActionTracker();
clientTracker.setAttribute("content", "talksex_qa");
//End tracking

//var videoPlayer = new VideoPlayer();
//videoPlayer.setParentBlock("player");

var videoTabImage = document.getElementById("videoTab");
var textTabImage = document.getElementById("textTab");

var defaultPanel = document.getElementById("defaultViewBlock");
defaultPanel.style.display = "block";

var	viewPortPanel = document.getElementById("viewPortBlock");
var	answerTextPanel = document.getElementById("answerText");

var	answerTextDocument = document.getElementById("textContainer");
answerTextPanel.style.display = "none";

var	playerPanel = document.getElementById("player");

var stateTracker = new StateTracker();
stateTracker.setState(null, "video");

var questionNavBar = new StatefulNavBar(
	{containerId:"questionNavBlock", 
	parentId:"questionNav"});
questionNavBar.setOrientation("vertical");
questionNavBar.showAnswer = function()
{
	stateTracker.setState(questionNavBar.buttonManager.selectedButton, null);
	setTab(stateTracker.activeState);
}
		
one = new Button(	{
	image:{path:"images/", name:"button", type:"gif"}, 
	cssClass:"buttonText", textAlign:"left", height:"55", width:"259", 
	text:"I can&#039;t <b>find my G SPOT</b>.<br />Where is it?", 
	action:questionNavBar.showAnswer, actionParam:"one"});
one.answer = new Answer(
						"9e556aa86ba36860784ce1be4e63518d6c7b1b59",
						"G Marks the Spot",
						"<p><b>SUE SAYS:</b> Please don't make finding your G Spot a project for this weekend. There are many contributing factors to orgasmic expulsion or G Spot ejaculation. Women who describe the experience generally tell me that they are in a long-term stable committed loving relationship. They are comfortable with their bodies and enjoy good sex; they simply don't care what they look like, sound like or smell like. In all probability they are very sexually aroused, have had an orgasm and have an intense desire to push down. Women who have had babies say it is the same bearing down sensation they had during delivery. They take a deep breath and push down. They will expel a large quantity of fluid from their urethra.</p>"
						+"<p>The first time it happens, many women are convinced they have \"peed the bed\" so are terribly ashamed and apologetic. Then they realize this is not urine, it smells sweet like clover, it is clear, not yellow like urine, and it does not stain the sheets or mattress.</p>"
						+"<p>The G Spot is an area about the size of a silver dollar, located inside the vagina on the anterior (front) wall of the vagina, about 1 1/2 inches up, and it may feel slightly swollen but few folks can actually say \"there it is\".</p>"
						+"<p>Most women tell me it happens when their partner is performing the \"VENUS BUTTERFLY\". That is partner performing oral sex on her clitoris, manual (fingers) stimulating inside the vagina stroking the front wall, and external or internal anal stimulation. Other women say they can have a G Spot orgasm with intercourse combined with clitoral stimulation from a small vibrator.</p>"
						+"<p>After they have had a G Spot orgasm, women say they feel depleted, weak and exhausted. To that I say, \"do it on HIS side of the bed, let him have the wet spot\".</p>"
						+"<p>For more information, read the books; UNDERSTANDING THE G SPOT by Donald Hicks; THE GOOD VIBRATIONS GUIDE TO THE G SPOT by Cathy Winks, published by Down There Press. ISBN 0 940208-27-7. For more detailed information read THE G SPOT AND OTHER DISCOVERIES ABOUT HUMAN SEXUALITY by Kahn, Whipple and Perry, published by Dell Pocketbooks, ISBN 0-440-13040-9.</p>"
						+"<p>I am reminded of the old expression \"getting there is half the fun.\" Enjoy, but don't be too goal orientated to locate your G Spot.</p>"
						);
						
two = new Button(	{
	image:{path:"images/", name:"button", type:"gif"}, 
	cssClass:"buttonText", textAlign:"left", height:"55", width:"259", 
	text:"I hate the <b>taste of sperm</b>, what<br />should I do?", 
	action:questionNavBar.showAnswer, actionParam:"two"});
two.answer = new Answer(
						"2dd9b398ac7a00ae472e3300166f317d4e81007a",
						"Hard to Swallow",
						"<p><b>SUE SAYS:</b>  Ejaculate, containing sperm has a unique individual taste for each male. Some males have bitter tasting ejaculate, tastes burnt, sour, and strong. Other males, primarily vegetarians have ejaculate that generally tastes sweet, nut like. So you could ask him to not eat any meat. That may not go over too well.</p>"
						+"<p>Do not believe the old myth that eating fresh pineapple for a few days before oral sex will change the taste.</p>"
						+"<p>Now, if he used a condom when you performed oral sex, the ejaculate would be contained in the condom, therefore no taste. But unless you are using flavored condoms, they don't taste too great either.</p>"
						+"<p>I would like to ask if he is pressuring you to take his ejaculate into your mouth, if so&#133; why does he want you to do this. Insist on a straight answer. If it tastes awful, why is it so important to him?</p>"
						+"<p>Ask him if he has ever tasted his ejaculate. If not, have him ejaculate into a condom, then squish it into his mouth. Most males won't do this; they consider it \"too gross.\" If it is too gross for him, why is it ok for you? Think about it.</p>"
						+"<p>You could agree to perform oral sex, but he must signal when he thinks he is about to ejaculate, then you take your mouth away and continue to stimulate him manually. That works well.</p>"
						+"<p>You could use a strong mouthwash just before you commence oral sex. Mouthwash tingles and numbs your mouth so you don't taste the ejaculate.</p>"
						+"<p>Many females start out disliking the taste of ejaculate but they persist, and eventually find that \"it is an acquired taste\" You decide.</p>"
						);

three = new Button(	{
	image:{path:"images/", name:"button", type:"gif"}, 
	cssClass:"buttonText", textAlign:"left", height:"55", width:"259", 
	text:"My boyfriend goes <b>limp during sex</b>.<br />Any advice?", 
	action:questionNavBar.showAnswer, actionParam:"three"});
three.answer = new Answer(
						"4085758a5c8b0fd5f9d485b2a74679185e7fd75c",
						"The Hard Facts",
						"<p><b>SUE SAYS:</b> Yup&#133; but not advice, just information. A guy's erection does not stay hard for a prolonged period of time.</p>"
						+"<p>Physiologically, an erection is caused by a rapid increase of blood supply in his penis. This drains and refills when he has an erection; this supplies fresh blood containing food and oxygen to the tissues. When the blood drains out, he loses his erection.</p>"
						+"<p>It is not that you are not sexy enough or that he is not interested is sex right now, erections ebb and flow, and as males get older, it takes longer. This does not mean, \"game over\". Nothing you can do to re-stimulate right now, so relax and enjoy while he uses this \"down time\" to stimulate you. He can hug and snuggle, whisper sweet nothings, kiss, fondle and pet, oral sex and use a small vibrator to keep you up. Then his erection will return, and \"ain't nobody gonna stop you now\".</p>"
						+"<p>If his erection does not return, he can still satisfy you with manual and oral clitoral stimulation.</p>"
						+"<p>Now that you know this, you can relax and enjoy, that will take the pressure to perform off him and sex will be more enjoyable for both of you.</p>"
						);

four = new Button({image:{path:"images/", name:"button", type:"gif"}, cssClass:"buttonText", textAlign:"left", height:"55", width:"259", text:"My <b>post-baby vagina feels loose</b>.<br />Can I tighten it?", action:questionNavBar.showAnswer, actionParam:"four"});
four.answer = new Answer(
						"10aeae2642d881b9ce212d294600909fde608df7",
						"Kegel Exercises",
						"<p><b>SUE SAYS:</b> There are a series of exercises to tighten up the \"Pubococcygeal\" (PC) muscles that originate at your pubic bone, go under your genitals and attach to your tailbone. After pregnancy, pelvic surgery, even as we age, these muscles lose tone. This can result in incontinence (loss of bladder control) hemorrhoids, low back pain, loose vagina, a reduction of sexual pleasure and for guys, an inability to slow ejaculation.</p>"
						+"<p>First, have a full bladder, sit on the \"john\" start to pee, then suddenly clamp down and stop. Start/ stop several times in a row. If you can't cut off the flow of urine but dribble on, you need to start KEGEL exercises now. From now on, every time you urinate, start/stop all the way through. This is called the \"Faucet\" and is a good indicator of your progress.</p>"
						+"<p>Now, whether you are the driver or passenger in a car, every time you stop at red lights or a stop sign, slowly tighten all your P.C. muscles, anal, vaginal and urethra. Hold for a count of ten, slowly release and repeat 10 times.</p>"
						+"<p>This is called the Genital Elevator, slowly lift and contract your pelvic muscles, one at a tine, lift up to the imaginary 10th. Floor, then slowly descend floor by floor. Repeat these exercises three times a day. These exercises should be started early in pregnancy, a.s.a.p. Post-partum and after surgery as soon as it is comfortable.</p>"
						+"<p>Not only does this improve bladder control, doing kegels regularly will improve your sex life. Females will be able to clamp down and grip her partner's penis increasing both their sexual pleasures.</p>"
						+"<p>These exercises are being recommended for males who experience Premature Ejaculation, now called Ejaculatory Incompetence. While the penis is not a muscle, the increased muscle tone will improve blood supply resulting in firmer erections and Kegels also help males contract their PC muscles and delay ejaculation.</p>"
						+"<p>Like any other muscle group, you either \"use it or lose it\", so think of great sex together, and prevent the future purchase of adult diapers.</p>"
						);

five = new Button({image:{path:"images/", name:"button", type:"gif"}, cssClass:"buttonText", textAlign:"left", height:"55", width:"259", text:"My partner has <b>trouble ejaculating</b><br />during sex. What do you suggest?", action:questionNavBar.showAnswer, actionParam:"five"});
five.answer = new Answer(
						"e2dd69c2f1e08828dac26ef31ce716e000d8cc67",
						"Help! I Can't Come!",
						"<p><b>SUE SAYS:</b> If you can ejaculate on your own, through masturbation, that tells me that you are fine.  There is nothing anatomically, physically wrong.  But the inability to ejaculate during intercourse indicates that there is some block there, an emotional or psychological block that's stopping you from ejaculating.</p>"
						+"<p>It's not impotence.  Impotence is the inability to attain or maintain an erection long enough for satisfactory sexual experience.  So this is not impotence, this is called \"delayed ejaculation\" and usually it's caused by some block - either guilt, or shame, or fear.</p>"
						+"<p>If it's something that's really bothering you, or if it's taking three hours to ejaculate, or you never do and your partner is feeling guilty about it, or feeling inadequate about it, then you should find yourself a good sex therapist.  Look in the yellow pages under \"Marriage and Family Therapists\" or under \"Psychologists\".  There are very few people listed in the phone book as \"Sex Therapists\" as such, and be sure to check their accreditation before you go.</p>"
						);

six = new Button({image:{path:"images/", name:"button", type:"gif"}, cssClass:"buttonText", textAlign:"left", height:"55", width:"259", text:"My partner wants to <b>try anal sex</b>.<br />What do I do?", action:questionNavBar.showAnswer, actionParam:"six"});
six.answer = new Answer(
						"995b8752847feb694819e7b9bfa5378959b55100",
						"'Where Does This Leg Go?'",
						"<p><b>SUE SAYS:</b> It seems to be a guy thing, very few females want to initiate anal sex, I think that guys are curious about it, talk about bum sex as the \"last taboo\", it is seen as more pleasurable since the rectum is a sphincter, (ring of muscle) and is tighter than the vagina. I also wonder if it is performed from a position of power, he has full control, she is in a submissive position, almost \"me da man\".</p>"
						+"<p>Before you agree to try anal sex, talk about it with your partner, outline your concerns and firmly establish some \"bottom line\" rules.</p>"
						+"<p>Anatomically, the bowel is a tube for excretion of solid body wastes, lined with mucous membrane and has two sphincters, one at the open end to prevent \"accidents\", the other up about 2 inches acting as a valve. You do not want to damage these sphincters, nor tear or puncture the thin mucous membrane because it does not heal very well. This may leave you vulnerable to a fissure or a fistula.</p>"
						+"<p>That means; you must insist that he;<ul>"
						+"<li>Must be gentle, no vigorous thrusting.</li>"
						+"<li>Must practice SAFER SEX, use a (fresh new) condom every time.</li>"   
						+"<li>Must use lots of lubrication.</li>"
						+"<li>Must stop the minute you indicate you do not want to continue.</li>"
						+"<li>If there is any bleeding, do not continue.</li>"
						+"<li>\"STOP\", \"OUCH\" \"NO\" means now, he is out of there immediately.</li>"
						+"</ul></p>"
						+"<p></p>"
						+"<p>To begin, he should roll a condom over two fingers, lubricate well and start by touching around the rectum till you relax and are comfortable with touch. Then he may gently insert one, then two well-lubricated fingers. When you are ok with that, he can, very gently insert his condom covered penis. Your rectum may go into spasm with this, so he must allow it to relax before he continues thrusting.</p>"
						+"<p>When he withdraws his penis from your rectum, he must hold onto the condom to prevent slippage. And he must use a new condom if you are going to continue with vaginal intercourse.</p>"
						+"<p>Anal sex is considered HIGH RISK sexual behavior, so you must practice SAFER SEX, USE A CONDOM EVERY TIME.</p>"
						);
					
questionNavBar.addButton(one);
questionNavBar.addButton(two);
questionNavBar.addButton(three);
questionNavBar.addButton(four);
questionNavBar.addButton(five);
questionNavBar.addButton(six);