// YNIN Quiz Result Lister
// version 2.0
// 2010-04-06
// Copyright (c) Cody Coleman
//
// This script will add a link to all possible results at the end of all quizzes located within Ydoc Nameloc Interactive Network.
// ==UserScript==
// @name          YNIN Quiz Result Lister
// @namespace     http://www.yninteractive.com/
// @description	  This script will add a link to all possible results at the end of all quizzes located within Ydoc Nameloc Interactive Network.
// @include       http://www.yninteractive.com/quiz/*
// @include       http://yninteractive.com/quiz/*
// ==/UserScript==
alert(document.getElementById('tbRBoxHead').innerHTML);
if(document.getElementById('tbRBoxHead'))
{
var myfileName=document.location.href;
var qindex=myfileName.indexOf("?");
if(qindex>=0)
{
	myfileName=myfileName.substring(0,qindex);
}
var gmcontenttag = document.getElementById("tbRBoxHead").innerHTML;
var resultindex=gmcontenttag.indexOf("Results");

if(resultindex<=-1)
{
	document.getElementById("tbRBoxHead").innerHTML=gmcontenttag.replace('</td><td class="tRBoxBody">',"<a href='"+myfileName+"?Code=Results'>Results</a><br/><br/></td><td class='tRBoxBody'>");
}

}

