function show_clock(id_name) {
   var now = new Date();
   var hours = now.getHours();
   var minutes = now.getMinutes();
   var hours0  = ((hours < 10) ? " 0" : " ");
   var minutes0  = ((minutes < 10) ? ":0" : ":");
   var output = hours0 + hours + minutes0 +
                minutes;
   $('#'+id_name).html(output);
   window.setTimeout("show_clock('" + id_name + "')", 15000);
	var Tag = new Array("Sonntag", "Montag", "Dienstag", "Mittwoch",
                    "Donnerstag", "Freitag", "Samstag");
	var Monat = new Array("Januar", "Februar", "M&auml;rz", "April", "Mai", "Juni",
                    "Juli", "August", "September", "Oktober", "November", "Dezember");
	var jetztTag = now.getDay();
	var jetztMonat = now.getMonth();
	var jetztDatum = now.getDate();
	var Jahr = now.getYear();
	if (Jahr < 999)
		Jahr += 1900;
	var datum = Tag[jetztTag] + ",<br />" + jetztDatum + ". " + Monat[jetztMonat] + " " + Jahr;
	$('#uhroverlay').html(datum);
}
 
 function show_tooltip(div){
	tt = document.getElementById(div);
	bottom = 30 - window.pageYOffset;
	tt.style.bottom = bottom + "px";
	$('#'+div).fadeIn();
 }
 
 function hide_tooltip(div){
	tt = document.getElementById(div);
	$('#'+div).fadeOut();
 }
 
function checkPic(){
	if ($('#pic').val() != ''){
		$('#loader').slideDown();
		bUploaded.start('fileprogress');
		return true;
	} 
	else {
		alert('Du musst ein Bild auswaehlen');
		return false;
	}
}
			
function checkType(){
	file = $('#pic').val();
	splits = file.split(".");
	last = splits.length - 1;
	type = splits[last];
	if (type == "zip" || type == "ZIP" || type == "png" || type == "PNG" || type == "jpg" || type == "JPG" || type == "gif" || type == "GIF" || type == "jpeg" || type == "JPEG"){
		if (type == "zip" || type == "ZIP"){
			$('#zip').val('1');
		}
		else {
			$('#zip').val('0');
		}
		return true;
	}
	else {
		alert("Dieses Dateiformat wird nicht unterstuetzt. Bitte waehle eine andere Datei!");
		$('#pic').val('');
		$('#zip').val('0');
		return false;
	}
}

function checkQuickType(){
	file = $('#pic').val();
	splits = file.split(".");
	last = splits.length - 1;
	type = splits[last];
	if (type == "png" || type == "PNG" || type == "jpg" || type == "JPG" || type == "gif" || type == "GIF" || type == "jpeg" || type == "JPEG"){
		return true;
	}
	else {
		alert("Dieses Dateiformat wird nicht unterstuetzt. Bitte waehle eine andere Datei!");
		$('#pic').val('');
		return false;
	}
}

function ajax_loadMore(i, mode) {
	oldhtml = $('#picview').html();
	$('#loader'+i).show();
	$.ajax({
		type: "POST",
		url: "ajax.pics.php",
		data: "page="+i+"&mode="+mode,
		success: function(html){
			newhtml = oldhtml + html;
			$('#picview').html(newhtml);
			$('#link'+i).hide();
			$('#loader'+i).hide();
			$(function() {
				$('a.lb').lightBox();
			});
		}
	});
}

function ajax_makeStats() {
	$.ajax({
		type: "POST",
		url: "ajax.makestats.php",
	});
}
