/******************************************************

  H&H WebSoccer 2

  Copyright (c) 2004-2006 by

  H&H Solutions GbR
  Seyboldstr. 3
  D-74336 Brackenheim

  EMail: info@hh-solutions.de
  Homepage: http://www.hh-solutions.de

  Dateiname: /jfunctions.js
  Autor: Ingo Hofmann (ingo.hofmann@hh-solutions.de)
  Datum: 27.5.2004
  Beschreibung: JavaScript Funktionen

******************************************************/


/*
Öffnet Fenster mit Großansicht der News-Bilder
*/
function winPic(id) {
  window.open("newspic.php?id="+ id,"Newsbild","width=750,height=550,scrollbars=yes,status=yes,resizable=yes");
} // -winPic

/*
"Gesamtsuche" leeren wenn Feld aktiviert wird
*/
function clearText(thefield){
	if (thefield.defaultValue==thefield.value)
	thefield.value = "";
} 

/*
"Gesamtsuche"-Feld
*/
function gesamtsuche(thefield){
	var value_suche = thefield.value.replace(" ", "");
	if (thefield.defaultValue==value_suche)	thefield.value = "";
	else if (!value_suche)									thefield.value = "Gesamtsuche...";
} 


/*
"Notizfeld" leeren wenn Feld aktiviert wird
*/
function clearText_notiz(thefield){
	if (thefield.value=="Hier kannst du dir Notizen machen...\n\nDeine Eingabe wird automatisch abgespeichert!")
	thefield.value = ""
} 

/*
UHR
*/

function writeclock() {
	i_clock++
	if (document.all || document.getElementById || document.layers) {
		clockid[i_clock]="clock"+i_clock
		document.write("<span id='"+clockid[i_clock]+"' style='position:relative;	font-size:1.0em; font-family:Verdana;'>"+thistime+"</span>")
	}
}

function clockon() {
	
	thistime= new Date()
	seconds=seconds*1 + 1*1
	minutes=minutes*1
	hours=hours*1
	if(seconds == 60) {
		seconds=0*1
		minutes=minutes*1+1*1
	}
	if(minutes == 60) {
		minutes=0*1
		hours=hours*1+1*1
	}
	if(hours == 24) {
		hours=0*1
	}
	if (hours <10) {hours="0"+hours}
	if (minutes < 10) {minutes="0"+minutes}
	if (seconds < 10) {seconds="0"+seconds}
	thistime = hours+":"+minutes+":"+seconds
		
	if (document.all) {
		for (i=0;i<=clockid.length-1;i++) {
			var thisclock=eval(clockid[i])
			thisclock.innerHTML=thistime
		}
	}
	
	if (document.getElementById) {
		for (i=0;i<=clockid.length-1;i++) {
			document.getElementById(clockid[i]).innerHTML=thistime
		}
	}
	var timer=setTimeout("clockon()",1000)
}


/*
Öffnet Fenster mit Großansicht der Statistiken
*/
function poipic(id) {
  window.open("poipic.php?id="+ id,"Statbild","status=yes,resizable=yes");
}
function sunpic(id) {
  window.open("sunpic.php?id="+ id,"Statbild","status=yes,resizable=yes");
}
function tabpic(id) {
  window.open("tabpic.php?id="+ id,"Statbild","status=yes,resizable=yes");
}



/*
Öffnet Fenster mit Großansicht der News-Bilder
*/
function Delete(bForm, id, strFile, strArea) {

  if (bForm == 1) chk = confirm("Wollen Sie die markierten Einträge wirklich löschen?");
  else chk = confirm("Wollen Sie den ausgewählten Eintrag wirklich löschen?");

  if (chk == true) {
    if (bForm == 1) document.frmMain.submit();
    else window.location = strFile + '?action=loeschen&area=' + strArea + '&del_id[]=' + id;
  }

} // -Delete

function showWMTT(id) {
	wmtt = document.getElementById(id);
	wmtt.style.display = "block";
}

function hideWMTT() {
	wmtt.style.display = "none";
}


document.onmousemove = updateWMTT;

function updateWMTT(e) {
	x = (document.all) ? window.event.x + document.body.scrollLeft : e.pageX;
	y = (document.all) ? window.event.y + document.body.scrollTop  : e.pageY;
	if (!wmtt) {
		wmtt.style.left = (x + 20) + "px";
		wmtt.style.top 	= (y + 20) + "px";
	}
}
