// WINDOW ON LOAD -----------------------------------
var top5spr;

window.onload = function() {
	top5spr = setInterval (getTopSrpueche, 7000);
}

function popup_show (timestamp)
{
	clearInterval (top5spr);
	
	var ts = 0;

	if (timestamp == undefined)
	{
		var now = new Date ();
		ts = parseInt (now.getTime () / 1000);
	}
	else
	{
		ts = timestamp;
	}

	var fo2 = new SWFObject ("swf/home/bang_01.swf", "bang_01", "520", "520", "9", "#ffffff");
	fo2.addParam ("wmode", "transparent");
	fo2.addParam ("menu", "false");
	fo2.addVariable ("timestamp", Number (ts));

	$('popup').innerHTML = '';
	$('popup').style.display = 'block';
	fo2.write ("popup");		
}
function popup_close ()
{
	top5spr = setInterval (getTopSrpueche, 7000);
	$('popup').innerHTML = '';	
	$('popup').style.display = 'none';
}




// --------------------------------------------------
// WINDOW ON LOAD -----------------------------------
var topCounter = 0;

function getTopSrpueche () {
	if (!isOverlay) {
		topCounter = ++topCounter > 4 ? 0 : topCounter;
	
		var ajaxx = 'ajax=true';
		var topX = '&topX=' + topCounter;		
		var vars = ajaxx + topX;
	
		new Effect.Fade ('top_spruch', {to:0.1});
		var setInt_home = setInterval (function () {
				clearInterval (setInt_home);
				gExecuteAJAX_home ("includes/get_top_spruch.php", vars)
			}, 1050);
	}
}// --------------------------------------------------
// AJAX EXECUTE/LOADING/COMPLETE/ETC ----------------
var ajax_home = new sack ();

function gExecuteAJAX_home (file, vars) {
	ajax_home.setVar ("var", "data");
	ajax_home.requestFile = file;
	ajax_home.method = "POST";
	ajax_home.element = 'top_spruch';
	ajax_home.onLoading = whenLoading_home;
	ajax_home.onLoaded = whenLoaded_home;
	ajax_home.onInteractive = whenInteractive_home;
	ajax_home.onCompletion = whenCompleted_home;
	ajax_home.runAJAX (vars);
}

function whenLoading_home () { }
function whenLoaded_home () { }		// data sent
function whenInteractive_home () { }	// getting data
function whenCompleted_home () {
	new Effect.Appear ('top_spruch', {duration:0.7});
}















