	var G_REQUEST_QUEUE = new RequestProcessingQueue();

	function KidSciencePane(varName, PaneID, LoadingID)
	{
		this.base = TabbedPane;
		this.base(varName);
	
		this.paneID			= PaneID;
		this.iframeID		= "DataLoadingFrame";
		this.loadingID		= LoadingID;
		
		this.styler = function(element, state)
		{
			if(state == "Registered")
			{
				// element.style.border = "1px solid black";
			}
			else if(state == "Selected")
			{
				var buttonName = new String(element.className);
				buttonName = buttonName.substring(0, buttonName.indexOf("_"));
				element.className = buttonName + "_On";
			}
			else if(state == "Unselected")
			{
				var buttonName = new String(element.className);
				buttonName = buttonName.substring(0, buttonName.indexOf("_"));
				element.className = buttonName + "_Off";
			}
			else if(state == "Loading")
			{
				element.style.display	 = "block";
			}
			else if(state == "Done Loading")
			{
				setTimeout("document.getElementById('" + element.id + "').style.display = 'none';", 500);
			}
		}
		
		this.urlMaker = function(urlData)
		{
			return urlData;
		}
	}
	KidSciencePane.prototype = new TabbedPane;
	
	function SubmitRating(id, value, DivID)
	{
		G_REQUEST_QUEUE.enqueue("Rate_requestGranted('" + id + "', '" + value + "', '" + DivID + "');");
		G_REQUEST_QUEUE.enqueue("Rate_requestLoaded('" + id + "', '" + value + "', '" + DivID + "');");
		if(G_REQUEST_QUEUE.size() == 2)
			G_REQUEST_QUEUE.process();
	}
	
	function Rate_requestGranted(id, value, DivID)
	{
		var iframe = document.getElementById('DataLoadingFrame');
		iframe.src = "Rate.php?id=" + id + "&rating=" + value;
				
		hideInfo(DivID);

	}
	
	function Rate_requestLoaded(id, value, DivID)
	{
		document.getElementById(id + "_Rate").innerHTML = "<form class=\"rateForm\"><em>You have given this resource a <strong>" + value + "</strong> out of 5 rating.  The new overall rating is <strong>" + frames['DataLoadingFrame'].document.getElementById("new_rating").innerHTML + "</strong>. Thank-you for your input!</em></form>";		

		showInfo(DivID);
		
		document.getElementById(DivID).firstChild.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.innerHTML = "<strong>" + frames['DataLoadingFrame'].document.getElementById("new_rating").innerHTML + "</strong>";
		
		if(G_REQUEST_QUEUE.size() > 0)
			G_REQUEST_QUEUE.process();
	}
