﻿var j = jQuery.noConflict();
j(
	function(){
		
	}
);
function go(u){
	document.location = u;
}

function logOff(){
	j.post("/ajax/logOff", {}, function () {
		refresh();
	});
}

function refresh(){
    document.location.reload( false );
}
function viewState(i,v){
	if(!i)
		i = 0;
	if(!v)
		v = "#views > div";
	j(j(v).hide()[i]).show();
	j(window).scrollTop(0);
}

String.prototype.get = function() {
	var r = {};
	var s = this;
	var q = s.substring(s.indexOf('?') + 1); // remove everything up to the ?
	q = q.replace(/\&$/, ''); // remove the trailing &
	jQuery.each(q.split('&'), function() {
		var splitted = this.split('=');
		var key = splitted[0];
		if(splitted.length > 1)
			var val = splitted[1];
		else
			var val = "";
		if (/^[0-9.]+$/.test(val)) val = parseFloat(val); 	// convert floats
		if (typeof val == 'number' || val.length > 0) r[key] = val; // ignore empty values
	});
	return r;
};
String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g,"");
}
