
///////do not edit bellow this point/////////////////////////////////
var qs = getArgs(); 
var question=qs["question"];
var answer=qs["answer"];
nextanswer=0;
	if(answer==undefined){answer=0;}
	nextanswer=Math.round(answer)+1;

if(qs["question"]==1 || qs["question"]==undefined){
	document.write("<a href='shareadvice.php?question=1'>QUESTION 1</a> - <font color=yellow>"+shareadvice_question1_title+"</font>");
	document.write("<br>\""+shareadvice_question1_text+"\"");
	if(shareadvice_question1_author!=""){
		document.write("<br>- "+shareadvice_question1_author);
	}
	document.write("<p>");
	if(qs["question"]==1){
		if(nextanswer>=shareadvice_answer1.length){nextanswer=0;}
		document.write("\""+shareadvice_answer1[answer]+"\""+"<br>- "+shareadvice_answer1_author[answer]+"<p>");	
		document.write("<a href='shareadvice.php'>&lt;&lt;back to questions</a>");
		document.write("<img src='images/spacer.gif' width=100 height=1 border=0>");
		document.write("<a href='shareadvice.php?question="+question+"&answer="+nextanswer+"'><img src='images/next.gif' border=0></a>");
	}
}

if((qs["question"]==2 || qs["question"]==undefined) && shareadvice_question2_title !=""){
	document.write("<a href='shareadvice.php?question=2'>QUESTION 2</a> - <font color=yellow>"+shareadvice_question2_title+"</font>");
	document.write("<br>\""+shareadvice_question2_text+"\"");
	if(shareadvice_question2_author!=""){
		document.write("<br>- "+shareadvice_question2_author);
	}
	document.write("<p>");
	if(qs["question"]==2){
		if(nextanswer>=shareadvice_answer2.length){nextanswer=0;}
		document.write("\""+shareadvice_answer2[answer]+"\""+"<br>- "+shareadvice_answer2_author[answer]+"<p>");	
		document.write("<a href='shareadvice.php'>&lt;&lt;back to questions</a>");
		document.write("<img src='images/spacer.gif' width=100 height=1 border=0>");
		document.write("<a href='shareadvice.php?question="+question+"&answer="+nextanswer+"'><img src='images/next.gif' border=0></a>");
	}
}

/////////////////////////////////////
function getArgs() {
	var args = new Object();
	var query = location.search.substring(1); 
	var pairs = query.split("&"); 
	for(var i = 0; i < pairs.length; i++) {
		var pos = pairs[i].indexOf('='); 
		if (pos == -1) continue; 
		var argname = pairs[i].substring(0,pos); 
		var value = pairs[i].substring(pos+1); 
		args[argname] = unescape(value); 
	}
	return args; 
}


