/**
* JSAX.RQ
* written by Florian Sax 20060131
*
* Assigns the variables in location.search to _GET
* example:
document.location.href == "http://localhost/index.php?var1=test&var2=test2"
_GET["var1"] == "test"
_GET.var2 == "test2"
*
* Copyright (C) 2006 Florian Sax <flosax(at)users.sourceforge.net>
* JSAX.RQ is protected by the GPL <http://www.gnu.org/copyleft/gpl.html>
*/


if( !window.JSAX){
	JSAX = {};
}

JSAX.RQ = {
	Version: 20060223,
	_GET: {},
	_POST: { "variables":"cannot be recieved from browser"},
	GET: function(){
/*
		if( document.location.href != document.location.protocol+'//'+
			document.location.hostname+
			document.location.port+
			document.location.pathname+
			document.location.search+
			document.location.hash){
			alert( "document.location object is not standard conform!");
		}
*/
		var string = unescape( document.location.search.substr( 1));
		var vars = string.split( "&");
		for( var i=0; i < vars.length; i++){
			var pos = vars[i].indexOf( "=");
			if( pos > 0){
				var key = vars[i].substr( 0, pos);
				JSAX.RQ._GET[key] = vars[i].substr( pos +1);
			}
		}
		// consume this function
		JSAX.RQ.GET = function(){
			return JSAX.RQ._GET;
		}
		return JSAX.RQ._GET;
	}
};
window._GET = JSAX.RQ.GET();


