	var maxquestions = 8;
	var currentscore;
	var answered = 1;

	function info(question,optiona,optionb,optionc,vala,valb,valc)
	{
		this.question	= question;
		this.optiona	= optiona;
		this.optionb	= optionb;
		this.optionc	= optionc;
        	
		this.vala	= vala;
		this.valb	= valb;
		this.valc	= valc;
        	
	}
	
	var answer	= new Array(3);
	var header	= new Array(3);
	var question = new Array(maxquestions);

	question[0] = new info ("It's the first date. You're staring at each other across the table. Thinking about it, how do you look at him?"
							,"I steal coy glances at lover boy and the tablecloth."
							,"I stare deeply into his eyes, blinking rarely. "
							,"I look at his eyes and mouth, and blink frequently. "
                                                     
							,1
							,2
							,3);

	question[1] = new info ("How would you describe your voice?"
							,"A girlish, fairly high voice. I tend to speak quite quickly "
							,"A sexy, deep, loud voice - move over, Mariella Frostrup! "
							,"A low voice. I speak fairly slowly and clearly.  "
                                                       
							,2
							,1
							,3);

	question[2] = new info ("You've had your eye on a certain bloke for a while. When you run into him in a bar and he says 'You're looking lovely this evening', how do you react?"
							,"'Really? Bloody hell, I feel like a right mess! I had to clean up cat sick before I left the house, then the train was late, and look - I've got laddered tights.'"
							,"'You're looking red hot yourself, big boy.'"
							,"'Thank you'"
                                                        
							,1
							,2
							,3);
	question[3] = new info ("How do you normally stand?"
							,"Shoulders thrust back, pelvis thrust forward, head held high "
							,"Stomach pulled in, one hip slightly forward, feet apart  "
							,"Spine very straight, shoulders lifted high, body turned sideways  "
                                                        
							,3
							,2
							,1);

	question[4] = new info ("What sort of shoes do you most enjoy wearing?"
							,"Strappy high heels "
							,"Pointy stilettos, the higher the better...taxi! "
							,"Fashionable but comfortable round toed boots or trainers "
                                                        
							,3
							,2
							,1);

	question[5] = new info ("It's the second date and you really like him. How are you most likely to sit?"
							,"My legs are crossed. I have a tendency to jig my raised foot up and down "
							,"My legs are crossed at the thighs, and I often cross and uncross my legs "
							,"My knees and toes together, and my heels are apart "
                                                       
							,2
							,3
							,1);

	question[6] = new info ("On a night out, what drinks would you probably opt for?"
							,"Wine. Possibly a cocktail if it's done properly "
							,"Spirits with mixers - vodka and tonic, G&T - or a bottle of beer."
							,"Spirits minus mixers - something straight up or on the rocks. "
                                                        
							,3
							,2
							,1);

	question[7] = new info ("How would you describe your style and body confidence?"
							,"I make the most of my assets and I know what looks sexy. I've got a good body and I like to show it off. I like bright colours and attention-grabbing patterns and textures."
							,"I know what suits me and how to highlight my best points. My body isn't perfect but I'm not hung up about my bad points.  I dress according to the occasion and my mood."
							,"I tend to wear what I feel comfortable in - I'm not a person with a 'sexy' style. There are parts of my body that I dislike and I dress to draw attention away from 'problem' areas."
                                                       
							,2
							,3
							,1);

	


	answer[0] = "Oh dear. When it comes to flirting, your technique tends is more Primark than Agent Provocateur. There could be a variety of reasons for this - perhaps you're feeling unconfident, or maybe you're already in a relationship and think you don't need to bother. If it's the latter, then remind yourself that flirting's not necessarily about pulling someone - it's about charming everyone around you. A good flirt makes everyone she encounters feel good. If you feel unconfident about flirting, feel that 'it's just not you', or just seem to get it wrong no matter what you do, fret not. There are ways to learn - <a href='http://uk.dk.com/static/cs/uk/11/features/superflirt/intro.html' class='whitemedium'>click here to become a superflirt</a>";

	answer[1] = "You can be a successful flirt sometimes but there's definite room for improvement. Perhaps you're great at verbal flirting but a body language disaster - the way you stand, sit, move etc, is really important. Perhaps - and this is a bit harsh - you think you're great at flirting but you're actually way too obvious. Blatant come-ons,  wearing one-slip-and-you'll-die high heels, or a swagger to rival Jessica Rabbit are scary rather than sexy. Whichever way you currently flirt, find out how to become a superflirt <a href='http://uk.dk.com/static/cs/uk/11/features/superflirt/intro.html' class='whitemedium'>here</a>";

	answer[2] = "Whoa! You, young lady, rank pretty highly in the flirtation stakes. You carry yourself with confidence and know how to make the best of your assets. You've probably got men falling at their feet, tons of friends, and more admirers than you could shake your pretty booty at. But remember - a good flirt doesn't become self-satisfied, she's always curious about what makes people tick and how to improve her technique. Become an even more spectacular superflirt  <a href='http://uk.dk.com/static/cs/uk/11/features/superflirt/intro.html' class='whitemedium'>right here</a>";

	header[0] = "We're the flirting police - you're under arrest, girl!";
	header[1] = "When you want to turn it on, you can - but lady, you're no flirt expert. Yet.";
	header[2] = "Grrr! You've probably got 'flirting' listed under the 'Other Interests' section on your CV.";

	function WriteQuestion(questionnumber)
	{
		document.write(question[questionnumber].question);
	}
	function WriteOptionA(questionnumber)
	{
		document.write(question[questionnumber].optiona);
	}
	function WriteOptionB(questionnumber)
	{
		document.write(question[questionnumber].optionb);
	}
	function WriteOptionC(questionnumber)
	{
		document.write(question[questionnumber].optionc);
	}
    function WriteQuestionNumber(questionnumber)
	{
		document.write(questionnumber + 1);
	}

	function CloseWindow()
	{
		window.close();
	}

	function MarkAsDone(currentquestion)
	{

		var progressarraystring = getCookie("progress");
		var progressarray = progressarraystring.split(":");

		progressarray[currentquestion] = 1;
		progressarraystring = progressarray.join(":");
		setCookie("progress",progressarraystring);
	}

	function InitialiseProgress()
	{
		
		var progressarray = new Array(maxquestions);
		var i;

		for ( i = 0; i < maxquestions; i++)
		{
			progressarray[i]  = 0;
		}
		var progressarraystring = progressarray.join(":");

		setCookie("progress",progressarraystring);
	}


	function NextQuestion(currentquestion)
	{

		//alert("Question=" + currentquestion);
		if ( currentquestion == 0 )
		{
			setCookie("c_score","0");
		}

		// first calculate score..
		var score;
		var button;
	
		//score for multiple questions per page
		button = eval("document.ANSWER.radiobutton" + currentquestion + "[0]");
        	if ( button.checked == true )
		{
			//alert("radiobutton1.checked!");
			answered = 1;
			score = question[currentquestion].vala;

		}
		else   //option b
		{
			button = eval("document.ANSWER.radiobutton" + currentquestion + "[1]");
        		if ( button.checked == true )
			{
				answered = 1;
				score = question[currentquestion].valb;

			}
			else   //option c
			{
				button = eval("document.ANSWER.radiobutton" + currentquestion + "[2]");
        			if ( button.checked == true )
				{
				answered = 1;
				score = question[currentquestion].valc;
				}
				
					else
					{
						answered = 0;
					//	return	false;
					}				
			
			} //end else c
		}//end else b
	
	/*
		
		//old way of scoring for 1 questionper page
		if ( document.ANSWER.elements[0].checked == true )
		{
			answered = 1;
			score = question[currentquestion].vala;
		}
		else if ( document.ANSWER.elements[1].checked == true )
		{
			answered = 1;
			score = question[currentquestion].valb;
		}
		else if ( document.ANSWER.elements[2].checked == true )
		{
			answered = 1;
			score = question[currentquestion].valc;
		}
        
		else
		{
			answered = 0;
                        return	false;
		}
	*/	
		
		if ( answered == 1)
		{

		// get previous score from cookie called score...

		var previous_score = parseInt(getCookie("c_score"));
		//alert("previous score = " + previous_score);


		// see if it has already been done.....
		var progressarraystring = getCookie("progress");
		var progressarray = progressarraystring.split(":");

		
		//alert(progressarraystring);

		score = parseInt(previous_score + score);
		//alert("total score = " + score);


		if ( progressarray[currentquestion] != 1)
			setCookie("c_score",score);

		MarkAsDone(currentquestion);


		if (currentquestion ==  maxquestions - 1)
			parent.location.href = "response.html";
		
		}

	}
