/*************************************
 *
 *  Code By Attenzione
 *  Started at 21.04.2008
 *
 *************************************/

var lastAjaxUrl = "";
var allowAutoHide = true; //system! do not change!

function _$( id ) {
	return document.getElementById( id );
}

String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g,"");
}

function in_array(myValue,myArray) {
    function equals(a,b) {
        return (a == b);
    }

    for (var i in myArray) {
        if (equals(myArray[i],myValue))
            return true;
    }

    return false;
}

function _noBubbling( e ) {
	e = _fixE( e );
	if (!e.cancelBubble) e.cancelBubble = true;
	if (e.stopPropagation) e.stopPropagation();
    return false;
}

function _fixE( e ) {
	if (!e) e = window.event;
	return e;
}

function viewport() {
    this.windowX = (document.documentElement && document.documentElement.clientWidth) || window.innerWidth || self.innerWidth || document.body.clientWidth;
    this.windowY = (document.documentElement && document.documentElement.clientHeight) || window.innerHeight || self.innerHeight || document.body.clientHeight;
    this.scrollX = (document.documentElement && document.documentElement.scrollLeft) || window.pageXOffset || self.pageXOffset || document.body.scrollLeft;
    this.scrollY = (document.documentElement && document.documentElement.scrollTop) || window.pageYOffset || self.pageYOffset || document.body.scrollTop;
    this.pageX = (document.documentElement && document.documentElement.scrollWidth) ? document.documentElement.scrollWidth : (document.body.scrollWidth > document.body.offsetWidth) ? document.body.scrollWidth : document.body.offsetWidth;
    this.pageY = (document.documentElement && document.documentElement.scrollHeight) ? document.documentElement.scrollHeight : (document.body.scrollHeight > document.body.offsetHeight) ? document.body.scrollHeight : document.body.offsetHeight;
}

function getSelectionPositions( element ) {
	if( document.selection ){
		// The current selection
		var range = document.selection.createRange();
		// We'll use this as a 'dummy'
		var stored_range = range.duplicate();
		// Select all text
		stored_range.moveToElementText( element );
		// Now move 'dummy' end point to end point of original range
		stored_range.setEndPoint( 'EndToEnd', range );
		// Now we can calculate start and end points
		element.selectionStart = stored_range.text.length - range.text.length;
		element.selectionEnd = element.selectionStart + range.text.length;
	}
	return { start: element.selectionStart, end: element.selectionEnd };
}
function setSelectionPositions( element, start, end ) {

	if (!end) end = start;
	// IE Support
	if (document.selection) {

		// Set focus on the element
		element.focus ();

		// Create empty selection range
		var oSel = document.selection.createRange ();

		// Move selection start and end to 0 position
		oSel.moveStart ('character', -element.value.length);

		// Move selection start and end to desired position
		oSel.moveStart ('character', start);
		oSel.moveEnd ('character', -element.value.length + end);
		oSel.select ();
	} else if (element.selectionStart || element.selectionStart == '0') {
		element.selectionStart = start;
		element.selectionEnd = end;
		element.focus ();
	}

}


function formSubmit( actionObj ) {

	actionObj = $( actionObj );

	if ( actionObj.get(0).tagName.toLowerCase() == 'form') {
		var parentForm = actionObj;
	} else {
		var parentForm = actionObj.parents('form:first');
	}

	var url = fixUrl(parentForm.get(0).action);

	var options = {
		beforeSubmit: function() {
			document.body.style.cursor = 'wait';
		},
		url : url,
		type: "POST",
		complete: function() {
			document.body.style.cursor = 'default';
		},
		success: function( responseText, statusText ) {

			allowAutoHide = false;

			var bodyStart = responseText.toLowerCase().indexOf("<body>");
			var bodyEnd = responseText.toLowerCase().indexOf("</body>");

			if (bodyStart > -1 && bodyEnd > -1)	{
				responseText = responseText.substring( bodyStart + 6, bodyEnd );
			}

			//alert( responseText );
			evalScriptsOnResponse( responseText );

			allowAutoHide = true;

		}
	};
	parentForm.ajaxSubmit(options);

	return false;

}

function setAction( action, force ) {

	if (typeof action == 'object' && action.tagName.toLowerCase() == 'a') {
		action.blur();
		var actionObj = action;
		action = action.href;
	}
	var url = fixUrl(action);
	if (lastAjaxUrl == url && !force ) return false;

	autoHide( null, 1 );
	allowAutoHide = false;
	if (typeof actionObj == 'object' && !force ) {
		$( actionObj ).addClass('disabled');
	}

	//lastAjaxUrl = url;

	var options = {
		beforeSend: function() {
			document.body.style.cursor = 'wait';
		},
		url : url,
		type  : "GET",
		dataType: "text",
		complete: function() {
			top.document.body.style.cursor = 'default';
		},
		success: function( responseText, statusText ) {

			var bodyStart = responseText.toLowerCase().indexOf("<body>");
			var bodyEnd = responseText.toLowerCase().indexOf("</body>");

			if (bodyStart > -1 && bodyEnd > -1)	{
				responseText = responseText.substring( bodyStart + 6, bodyEnd );
			}

			evalScriptsOnResponse( responseText );

			allowAutoHide = true;

		}
	};
	$.ajax( options );
	return false;

}

function fixUrl( url ) {
	url = url.replace(/ajax\.php$/, '');
	//var host = document.location.protocol + '//' + document.location.host + settings.url;
	//url = url.replace(host, '');
	urls = url.split("?");
	url = urls[0];
	if (typeof urls[1] != 'undefined' && urls[1].length) {
		urls[1] = '?'+urls[1];
	} else {
		urls[1] = "";
	}
	url = url.replace(/\/$/, '');
	url += '/ajax.php' + urls[1];
	return url;
}

function evalScriptsOnResponse( text ) {

	//var aObj = $("<div>"+text+"</div>");
	var scriptIndex = 0;
	var IWScripts = new Array();
	document.onIWRun = null;
	document.IWLoaded = true;

	/* It's Toooooo LONG! */
	/*aObj.find("script").each( function() {
		document.onIWComplete = null;
		eval( this.innerHTML );
		if (document.onIWComplete) {
			IWScripts[scriptIndex] = document.onIWComplete;
			scriptIndex++;
		}
	});*/

	/* remove all scripts */
	text = text.replace(/<(\/?)script/gi, "<$1script");
	var scriptStart = text.indexOf("<script");
	var scriptEnd = -1;
	var scriptBody = "";

	while(scriptStart > -1) {
		scriptEnd = text.indexOf("</script>")+9;
		scriptBody = text.substring(text.indexOf(">", scriptStart)+1, scriptEnd - 9);

		//reset collection function
		document.onIWComplete = null;
		try {
			eval( scriptBody );
		} catch (e) {
			/*window.console.log( e );*/
		}
		if (document.onIWComplete) {
			IWScripts[scriptIndex] = document.onIWComplete;
			scriptIndex++;
		}

		//new html without executed script;
		text = text.substring(0,scriptStart)+text.substring(scriptEnd, text.length);
		scriptStart = text.indexOf("<script");
	}

	if (typeof document.onIWRun == 'function') {
		document.onIWRun( text );
	}

	if (IWScripts.length) {
		for (var i = 0; i < IWScripts.length; i++) {
			try {
				IWScripts[i]( );
			} catch (e) {
				/*window.console.log( e );*/
			}
		}
	}

}

function moveContent( to, content ) {
	$('#'+to).html( content );
	//attachSubmit( to );
}

function floatContent( content ) {
	floatLayerInit();
	$('#float-layer-inner').html( content );
	//attachSubmit( 'float-layer-inner' );
	showFloatLayer();
}

function floatLayerInit() {
	if ($('#float-layer').attr('init')) return true;
	$('#float-layer-inner')
		.bind('click', function(e) {
			e.stopPropagation();
		}).bind('click', function(e) {
			e.stopPropagation();
		});
	$(document).click(function( e ) {
		if (e.button > 1 || e.witch > 1) return true;
		hideFloatLayer( e );
	});
	$(window).scroll(function( e ) {
		resizeFloatLayer( e );
	});
	$(window).resize(function( e ) {
		resizeFloatLayer( e );
	});
	$('#float-layer').attr('init', true);
}

function showFloatLayer() {
	var view = new viewport();
	if (view.pageY > view.windowY) {
		var height = view.pageY;
	} else {
		var height = view.windowY;
	}

	$('#float-layer').css('visibility', 'hidden').show();
	var contentHeight = $('#float-layer-inner').height();
	var top = Math.abs(Math.round((view.windowY - contentHeight) / 2));
	top += view.scrollY;
	$('#float-layer').css('top', top);
	if (true || $.browser.msie) {
		$('#float-layer-bg:hidden').show();
	} else {
		var rect = 'rect('+(Math.round(view.windowY/2)-20)+'px '+(Math.round(view.windowX/2)+20)+'px '+(Math.round(view.windowY/2)+20)+'px '+(Math.round(view.windowX/2)-20)+'px)';
		//alert('rect(0px '+view.windowX+'px '+view.windowY+'px 0px)');1230
		$('#float-layer-bg:hidden').css({'display': 'block', 'clip': rect}).stop().animate({'clip':'rect(0px '+view.windowX+'px '+view.windowY+'px 0px)'});
	}
	$('#float-layer').css('visibility', 'visible');
}

function hideFloatLayer() {
	$('#float-layer').fadeOut('fast', function() {
		if (true || $.browser.msie) {
			$('#float-layer-bg').hide();
		} else {
			$('#float-layer-bg').slideUp();
		}
		lastAjaxUrl = '';
		$("a.disabled").removeClass('disabled');
	});
}

function resizeFloatLayer() {

	var view = new viewport();
	if (view.pageY > view.windowY) {
		var height = view.pageY;
	} else {
		var height = view.windowY;
	}

	//$('#float-layer-bg').height( height );
	$('#float-layer-bg:visible').css({'clip': 'rect(auto auto auto auto)'});

	var contentHeight = $('#float-layer-inner').height();
	var top = Math.abs(Math.round((view.windowY - contentHeight) / 2));
	top += view.scrollY;
	$('#float-layer').css('top', top);

}

function refreshPage( url ) {

	if (typeof url == 'undefined' || !url) {
		/*
		setTimeout(function() {
			window.location.reload();
		}, 100);
		*/
		//alert(window.location.href);
		url = window.location.href;
	}
	
	window.location.href = url;

}

/* ALIAS: refreshPage */
function pageRefresh( url ) {
	refreshPage( url );
}

function resizeTextarea( element ) {

	if (typeof element.constantHeight == 'undefined') {
		element.constantHeight = element.offsetHeight;
	}
	
	if (element.scrollHeight > element.offsetHeight) {
		element.style.height = element.scrollHeight + 'px';
	}

}

function attachSubmit( parent ) {

	if (typeof parent == 'undefined') {
		var selector = 'input';
	} else {
		var selector = '#' + parent + ' input';
	}

	$( selector ).keydown(function( e ) {
		if (e.keyCode == 13) {
			formSubmit( this );
		}
	});

}

function taskAction( url, td ) {
	$(td).addClass('task-loading');
	setAction( url, true );
}

function toggleSlide( watchNode, activeNodeID ) {

	var watchNode = $( watchNode );
	var activeNode = $( '#'+activeNodeID );
	if (watchNode.hasClass('opened')) {
		watchNode.removeClass('opened');
		activeNode.slideUp();
	} else {
		watchNode.addClass('opened');
		activeNode.slideDown();
	}

}

function toggleRows( watchNode, rowsClass ) {

	var watchNode = $( watchNode );
	var activeRows = $( 'tr.'+rowsClass );
	if (watchNode.hasClass('opened')) {
		watchNode.removeClass('opened');
		activeRows.css('display', 'none');
	} else {
		watchNode.addClass('opened');
		activeRows.css('display', '');
	}

}

var selectFunction = new Array();
function toggleSelect( watchNode, activeNodeID, force ) {

	watchNode = $( watchNode );
	var link = watchNode.find('div.link');
	activeNode = $( '#'+activeNodeID );
	if (typeof selectFunction[activeNodeID] != 'function') {
		selectFunction[activeNodeID] = function() {
			toggleSelect( watchNode, activeNodeID, 'close' );
		}
	}

	if (watchNode.hasClass('opened')) {

		if (typeof link.get(0).defaultValue == 'undefined') {
			link.get(0).defaultValue = link.get(0).innerHTML;
			//link.css('width', link.width() + 'px');
			link.get(0).style.width = link.width() + 'px';
		}
		var newValue = new Array();
		activeNode.find('label').each(function() {
			var _this = $(this);
			if (_this.find('input').get(0).checked) {
				newValue[newValue.length] = _this.find('span').html();
			}
		});
		if (newValue.length) {
			if (newValue.length > 1) {
				link.html(newValue[0] + ', ...');
			} else {
				link.html(newValue[0]);
			}
		} else {
			link.html(link.get(0).defaultValue);
		}
		watchNode.removeClass('opened');
		activeNode.slideUp('fast');
		$('#float-layer-inner').unbind('click', selectFunction[activeNodeID] );
		$(document).unbind('click', selectFunction[activeNodeID] );
	} else if (force != 'close') {
		if (activeNode.width() <= link.width() + 7) {
			activeNode.css('width', link.width() + 7 + 'px'); //calculate also padding & borders differences
		} else {
			activeNode.css('width', 'auto');
		}
		watchNode.addClass('opened');
		activeNode.slideDown('fast', function() {
			$('#float-layer-inner').bind('click', selectFunction[activeNodeID] );
			$(document).bind('click', selectFunction[activeNodeID] );
		});
	}

}

function toggleTaskType( element ) {

	element.blur();
	setAction( element.href );
	$(element).parent().find('a').removeClass('checked');
	$(element).addClass('checked');

	return false;
}

function toggleCheckboxes ( parent, searcher ) {

	if ( !parent.checked ) {
		var newValue = '';
		$( '#'+searcher ).find('.check-row').removeClass('checked');
	} else {
		var newValue = 'checked';
		$( '#'+searcher ).find('.check-row').addClass('checked');
	}

	$( '#'+searcher ).find('input[type=checkbox]').attr( 'checked', newValue );
	updateUserChecked();
	updateFeedbackChecked( searcher );

}

function checkUser( id, searcher, e ) {

	e = _fixE( e );
	var target = e.target || e.srcElement;
	var tagName = target.tagName.toLowerCase();
	if ( tagName != 'td' && tagName != 'div' ) {
		if (tagName == 'input' && target.type.toLowerCase() == 'checkbox') {
			$(target).parents('.check-row').toggleClass('checked');
			updateUserChecked();
		}
		return;
	}
	var userRow = $('#user-row-'+id);
	var checkbox = userRow.find('input[type=checkbox]');
	if (checkbox.length) {
		userRow.toggleClass('checked');
		if (checkbox.get(0).checked) {
			checkbox.attr('checked', '');
		} else {
			checkbox.attr('checked', 'checked');
		}
		updateUserChecked();
	}

}

function updateUserChecked() {

	var text = $('#user-checked span.text');
	var count = $('#user-list-table input[type=checkbox]:checked').length;
	if (count) {
		text.find('span').html( count ).parent().show();
	} else {
		text.hide();
	}

	return count;

}

function updateFeedbackChecked( id ) {

	var text = $('#feedback-checked span.text');
	var count = $('#'+id+' div.item input[type=checkbox]:checked').length;
	if (count) {
		text.find('span:first').html( count ).parent().show();
	} else {
		text.hide();
	}

	return count;

}

var matrixScroller = {

	maxX : 200,
	minX : 0,
	contentWidth : 0,
	visibleContent : 200,
	scrollerWidth : 1,
	inited : false,
	scrolled : false,
	lastPercent : 1,

	init : function() {

		var scroller = _$('matrix-scroller');
		//this.contentWidth = _$('matrix-table').offsetWidth;
		this.contentWidth = _$('matrix-container').scrollWidth;
		this.scrollerWidth = scroller.offsetWidth;
		this.maxX = _$('matrix-scrollbar').offsetWidth - this.scrollerWidth;
		this.visibleContent = _$('matrix-container').offsetWidth;

	},

	startScroll: function ( e ) {

		if (typeof e == 'undefined') e = window.event;
		this.init();
		this.inited = true;
		this.scrolled = true;

		var scroller = _$('matrix-scroller');
		scroller.startX = e.clientX;
		scroller.ownStartX = parseInt(scroller.style.left.replace('px', ''));
		if (!scroller.ownStartX && scroller.ownStartX != 0) scroller.ownStartX = this.minX;
		scroller.active = true;

		document.onmouseup = matrixScroller.stopScroll;
		document.onmousemove = function( e ) {
			if (typeof e == 'undefined') e = window.event;
			var scroller = _$('matrix-scroller');
			if (scroller.active) {
				var newX = e.clientX;
				var diff = newX - scroller.startX;
				var newMoverX = scroller.ownStartX + diff;
				if (newMoverX < matrixScroller.minX) newMoverX = matrixScroller.minX;
				else if (newMoverX > matrixScroller.maxX) newMoverX = matrixScroller.maxX;
				var procent = newMoverX / matrixScroller.maxX;
				if (procent > 1) procent = 1;
				else if (procent < 0) procent = 0;
				matrixScroller.scrollTo( procent );
			}
		}

		/* Disable Selection */
		/* ... */

		return false;

	},

	stopScroll: function ( e ) {
		_$('matrix-scroller').active = false;
		document.onmousemove = null;
		document.onmouseup = null;
		this.inited = false;
		/* Enable Selection */
		/* ... */

	},

	scrollTo: function( procent ) {

		if (!this.scrolled) this.init();
		this.lastPercent = procent;

		var scroller = _$('matrix-scroller');
		scroller.style.left = Math.round(procent * this.maxX) + 'px';

		//var newContentRight = (matrixScroller.contentWidth - matrixScroller.visibleContent) * ( 1 - procent );
		var newContentLeft = (this.contentWidth - this.visibleContent) * ( procent );
		//_$('matrix-table').style.right = -1 * Math.round(newContentRight) + 'px';
		_$('matrix-container').scrollLeft = Math.round( newContentLeft );

		/*document.getElementById('scroll-data').innerHTML = "" +
			"<br />Percent: " + procent +
			"<br />Left Content: "+newContentLeft +
			"<br />Content: "+matrixScroller.contentWidth +
			"<br />Visible Width: "+matrixScroller.visibleContent +
			"<br />Max X: "+matrixScroller.maxX;*/

	},

	jumpTo: function( scrollbar , e ) {

		if (this.scrolled) {
			this.scrolled = false;
			return;
		}
		this.init();
		var newX = e.clientX - $( scrollbar ).offset().left - this.scrollerWidth / 2;
		if (newX < 0) newX = 0;
		else if (newX > this.maxX) newX = this.maxX;
		var procent = newX / this.maxX;
		this.scrollTo( procent );

	}

}

var userScroller = {

	maxY : 200,
	minY : 0,
	contentHeight : 0,
	visibleContent : 200,
	scrollerHeight : 1,
	inited : false,
	scrolled : false,
	lastPercent : 1,

	init : function() {

		var scroller = _$('user-scroller');
		this.contentHeight = _$('user-container').scrollHeight;
		this.scrollerHeight = scroller.offsetHeight;
		this.maxY = _$('user-scrollbar').offsetHeight - this.scrollerHeight;
		this.visibleContent = _$('user-container').offsetHeight;

	},

	startScroll: function ( e ) {

		if (typeof e == 'undefined') e = window.event;
		this.init();
		this.inited = true;
		this.scrolled = true;

		var scroller = _$('user-scroller');
		scroller.startY = e.clientY;
		scroller.ownStartY = parseInt(scroller.style.top.replace('px', ''));
		if (!scroller.ownStartY && scroller.ownStartY != 0) scroller.ownStartY = this.minY;
		scroller.active = true;

		document.onmouseup = userScroller.stopScroll;
		document.onmousemove = function( e ) {
			if (typeof e == 'undefined') e = window.event;
			var scroller = _$('user-scroller');
			if (scroller.active) {
				var newY = e.clientY;
				var diff = newY - scroller.startY;
				var newMoverY = scroller.ownStartY + diff;
				if (newMoverY < userScroller.minY) newMoverY = userScroller.minY;
				else if (newMoverY > userScroller.maxY) newMoverY = userScroller.maxY;
				var procent = newMoverY / userScroller.maxY;
				if (procent > 1) procent = 1;
				else if (procent < 0) procent = 0;
				userScroller.scrollTo( procent );
			}
		}

		/* Disable Selection */
		/* ... */

		return false;

	},

	stopScroll: function ( e ) {
		_$('user-scroller').active = false;
		document.onmousemove = null;
		document.onmouseup = null;
		this.inited = false;
		/* Enable Selection */
		/* ... */

	},

	scrollTo: function( procent ) {

		if (!this.scrolled) this.init();
		this.lastPercent = procent;

		var scroller = _$('user-scroller');
		scroller.style.top = Math.round(procent * this.maxY) + 'px';

		var newContentTop = (this.contentHeight - this.visibleContent) * ( procent );
		_$('user-container').scrollTop = Math.round( newContentTop );

	},

	jumpTo: function( scrollbar , e ) {

		if (this.scrolled) {
			this.scrolled = false;
			return;
		}
		this.init();
		var newY = window.scrollY + e.clientY - $( scrollbar ).offset().top - this.scrollerHeight / 2;
		if (newY < 0) newY = 0;
		else if (newY > this.maxY) newY = this.maxY;
		var procent = newY / this.maxY;
		this.scrollTo( procent );

	}

}

var groupScroller = {

	maxY : 200,
	minY : 0,
	contentHeight : 0,
	visibleContent : 200,
	scrollerHeight : 1,
	inited : false,
	scrolled : false,
	lastPercent : 1,

	init : function() {

		var scroller = _$('group-scroller');
		this.contentHeight = _$('group-container').scrollHeight;
		this.scrollerHeight = scroller.offsetHeight;
		this.maxY = _$('group-scrollbar').offsetHeight - this.scrollerHeight;
		this.visibleContent = _$('group-container').offsetHeight;

	},

	startScroll: function ( e ) {

		if (typeof e == 'undefined') e = window.event;
		this.init();
		this.inited = true;
		this.scrolled = true;

		var scroller = _$('group-scroller');
		scroller.startY = e.clientY;
		scroller.ownStartY = parseInt(scroller.style.top.replace('px', ''));
		if (!scroller.ownStartY && scroller.ownStartY != 0) scroller.ownStartY = this.minY;
		scroller.active = true;

		document.onmouseup = groupScroller.stopScroll;
		document.onmousemove = function( e ) {
			if (typeof e == 'undefined') e = window.event;
			var scroller = _$('group-scroller');
			if (scroller.active) {
				var newY = e.clientY;
				var diff = newY - scroller.startY;
				var newMoverY = scroller.ownStartY + diff;
				if (newMoverY < groupScroller.minY) newMoverY = groupScroller.minY;
				else if (newMoverY > groupScroller.maxY) newMoverY = groupScroller.maxY;
				var procent = newMoverY / groupScroller.maxY;
				if (procent > 1) procent = 1;
				else if (procent < 0) procent = 0;
				groupScroller.scrollTo( procent );
			}
		}

		/* Disable Selection */
		/* ... */

		return false;

	},

	stopScroll: function ( e ) {
		_$('group-scroller').active = false;
		document.onmousemove = null;
		document.onmouseup = null;
		this.inited = false;
		/* Enable Selection */
		/* ... */

	},

	scrollTo: function( procent ) {

		if (!this.scrolled) this.init();
		this.lastPercent = procent;

		var scroller = _$('group-scroller');
		scroller.style.top = Math.round(procent * this.maxY) + 'px';

		var newContentTop = (this.contentHeight - this.visibleContent) * ( procent );
		_$('group-container').scrollTop = Math.round( newContentTop );

	},

	jumpTo: function( scrollbar , e ) {

		if (this.scrolled) {
			this.scrolled = false;
			return;
		}
		this.init();
		var newY = window.scrollY + e.clientY - $( scrollbar ).offset().top - this.scrollerHeight / 2;
		if (newY < 0) newY = 0;
		else if (newY > this.maxY) newY = this.maxY;
		var procent = newY / this.maxY;
		this.scrollTo( procent );

	}

}

function autoHide( e , force ) {

	if (!allowAutoHide) {
		allowAutoHide = true;
		return;
	}
	
	if (!force) {
		e = _fixE( e );
		var srcElement = e.target || window.event.srcElement;;
		//srcElement.tagName;
		var $srcElement = $(srcElement);
		if ($srcElement.hasClass('auto-hide') || $srcElement.parents(".auto-hide").length) {
			return;
		}
	}
	$("a.disabled").removeClass('disabled');
	$(".auto-hide").fadeOut("fast");
	lastAjaxUrl = "";
}

/*
$(document).ready(function( e ){
	$(document).click(function(e){
		autoHide( e );
	});
	//attachSubmit();
});
*/

/*
var statsX = 0;
function showStats() {
	if (!statsX) {
		$('div[id=stats-date-bubble]').fadeIn();
		statsX = setTimeout("$('div[id=stats-date-bubble]').fadeOut(); statsX = 0;", 5000);
	}
}
*/

function checkFirebug(m1, m2) {

	/*
	if (typeof window.console == 'object' && typeof window.console.firebug != 'undefined') {
		var out = '<table style="border: 1px solid #BC0041; background: url('+settings.url+'/images/i/icons/i.gif) #FFD4D4 10px 10px no-repeat; margin: 0 auto 10px; font-size: 0.85em;"><tr>';
		out += '<td style="padding: 10px 10px 10px 37px;">';
		out += '<div style="background: url('+settings.url+'/images/i/icons/x.gif) no-repeat; margin: -5px -5px 0 10px; width: 11px; height: 11px; float:right; cursor: pointer;" onclick="this.parentNode.parentNode.parentNode.style.display = \'none\';"></div>'
		out += '<h2 style="margin: 0;">'+m1+'</h2>';
		out += '<p style="margin:0; font-size: 0.92em;">'+m2+'</p>';
		out += '</td>';
		out += '</tr></table>';
		document.write( out );
	}
	*/
	
}