$(document).ready(function() {
	$("#events").smartupdater({
		url : '../data/'+GET('match')+'_events_html.txt',
		httpCache: true, 
		dataType: 'text',
		minTimeout: 6000 // 6 seconds
		}, function (data) {
			if(data) $("#events").html(data);
		}
	);
	
	$("#team-home").smartupdater({
		url : '../data/'+GET('match')+'_team_home_html.txt',
		httpCache: true, 
		dataType: 'text',
		minTimeout: 6000 // 6 seconds
		}, function (data) {
			if(data) $("#team-home").html(data);
		}
	);	
	
	$("#team-away").smartupdater({
		url : '../data/'+GET('match')+'_team_away_html.txt',
		httpCache: true, 
		dataType: 'text',
		minTimeout: 6000 // 6 seconds
		}, function (data) {
			if(data) $("#team-away").html(data);
		}
	);
	
	$("#team-home-result").smartupdater({
		url : '../data/'+GET('match')+'_static_home_html.txt',
		httpCache: true, 
		dataType: 'text',
		minTimeout: 60000 // 60 seconds
		}, function (data) {
			if(data) $("#team-home-result").html(data);
		}
	);		

	$("#team-away-result").smartupdater({
		url : '../data/'+GET('match')+'_static_away_html.txt',
		httpCache: true, 
		dataType: 'text',
		minTimeout: 60000 // 60 seconds
		}, function (data) {
			if(data) $("#team-away-result").html(data);
		}
	);	

	$("#result").smartupdater({
		url : '../data/'+GET('match')+'_result_html.txt',
		httpCache: true, 
		dataType: 'text',
		minTimeout: 6000 // 6 seconds
		}, function (data) {
			if(data) $("#result").html(data);
		}
	);

	$(document).ready(function() { 
	    timeoutID = setTimeout(updater, 10000);
	});

	function updater() {
		$('#updater').load('http://www.hsgnordhorn-lingen.de/verwaltung/liveticker/updater.php?match='+GET('match'));
		timeoutID = setTimeout(updater, 15000);
	}
	
	/*$("#updater").ajax({
		url : 'http://www.hsgnordhorn-lingen.de/verwaltung/liveticker/updater.php?match='+GET('match'),
		dataType: 'json',
		type: 'GET',
		}, function (data) {	}
	);*/
		
});




HTTP_GET_VARS=new Array();strGET=document.location.search.substr(1,document.location.search.length);if(strGET!=''){gArr=strGET.split('&');for(i=0;i<gArr.length;++i){v='';vArr=gArr[i].split('=');if(vArr.length>1){v=vArr[1]}HTTP_GET_VARS[unescape(vArr[0])]=unescape(v)}}function GET(v){if(!HTTP_GET_VARS[v]){return'undefined'}return HTTP_GET_VARS[v]}
