var hash	= '';
var hnow = new Date();
hash = hnow.getHours();
hash += hnow.getMinutes();
hash += hnow.getSeconds();

function ajaxBlock( url, values, onEmpty, onNonEmpty ) {
		$.ajax({type: "GET",
				url: url,
				data: hnow+'&'+values,
				success: function( html ){
					$(id).html( html );
				}
		});
}


function ajaxAction( url, values, onEmpty, onNonEmpty ) {
		$.ajax({type: "POST",
				url: url,
				data: hnow+'&'+values,
				success: function( html ){
					if ( html == '' ) {
						eval( onEmpty );
					} else {
						eval( onNonEmpty );
					}
				}
		});
}


function goToUrl( url ) {
	location.href = url;
}


function urlencode( urlstring ) {
	var string 			= escape( urlstring );
	var encoded_string  = string.replace("+","%2B");
	for (i=0;i < string.length; i++) {
		encoded_string  = encoded_string.replace("+","%2B");
		encoded_string  = encoded_string.replace("/","%2F");
		encoded_string  = encoded_string.replace("$","%24");
		encoded_string  = encoded_string.replace("&","%26");
		encoded_string  = encoded_string.replace(",","%2C");
		encoded_string  = encoded_string.replace(":","%3A");
		encoded_string  = encoded_string.replace(";","%3B");
		encoded_string  = encoded_string.replace("=","%3D");
		encoded_string  = encoded_string.replace("?","%3F");
		encoded_string  = encoded_string.replace("@","%40");
	}
	return encoded_string;
}

function urlencodeDouble( urlstring ) {
	var encoded_string  = urlencode( urlstring );
	var newString		= "";
	for (i=0;i < encoded_string.length; i++) {
		if ( encoded_string[i] == "%" ) {
			newString += "%25";
		} else {
			newString += encoded_string[i];
		}
	}
	return newString;
}
