function initJS () {
	refreshClock ();
	}

function unserializeURLquery (query, seperator) {
	var unserialized = {};
	if (typeof(query)=='string') {
		var index;
		query = query.split('+').join(' ').split(seperator && typeof(seperator)=='string' ? seperator[0] : '&');
		for (index in query) {
			query[index] = query[index].split('=');
			unserialized[decodeURIComponent(query[index].shift())] = decodeURIComponent(query[index].join('='));
			}
		}
	return unserialized;
	}

function serializeURLquery (unserialized, seperator) {
	if (typeof(unserialized)=='object') {
		var query = [], index;
		for (index in unserialized)
			query.push([encodeURIComponent(index),encodeURIComponent(unserialized[index])].join('='));
		return query.join(seperator && typeof(seperator)=='string' ? seperator[0] : '&');
		}
	return typeof(unserialized)=='string' ? unserialized : '';
	}

String.prototype.repeat = function(num) {
    return new Array(isNaN(num)? 1 : num*1 + 1).join(this);
    }
function strRecObj (variable, recursiveness, level) {
	var retnStr = '', index;
	recursiveness = isNaN(recursiveness)? 5 : recursiveness*1;
	level = isNaN(level)? 0 : level*1;
	for (index in variable) {
		retnStr += '    '.repeat(level) + index + ' : ' + variable[index] + '\n';
		if (typeof(variable[index])=='object' && level+1 < recursiveness) { 
			retnStr += arguments.callee (variable[index], recursiveness, level+1);
			}
		}
	return retnStr;
	}

/*var xhr = new XMLHttpRequest;
xhr.onreadystatechange = function () {
	if(xhr.readyState==4) {
		alert(xhr.responseText);
		}
	}
function XHRequest (URL, XHRObject, args) {
	if (!args) args = new String();
	XHRObject.open('POST', URL, true);
  XHRObject.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
//  XHRObject.setRequestHeader("Content-length", args.length);
//  XHRObject.setRequestHeader("Connection", "close");
	XHRObject.send(args);
	}
*/

function refreshClock () {
	var date = new Date();
	date = date.toLocaleString();
	var GMTindex = date.indexOf(' GMT+');
	date = '<p>' + date.slice(0, GMTindex) + '</p><p>' + date.slice(GMTindex+1) + '</p>';
	document.getElementById('site_header_clock').innerHTML = date;
	setTimeout('refreshClock ()',1000);
	}

function scrollTitle (timeout) {
	document.title = document.title.substr(1) + document.title.substr(0,1);
	setTimeout('scrollTitle (' + timeout + ')', timeout);
	}

