﻿function newWin(file,name,win_width,win_height) {
	pos_x = screen.availWidth - win_width - 20;
	pos_y=10;
	resizeflag="yes";
	if(navigator.appName.substring(0,8)=="Netscape" && parseInt(navigator.appVersion)==4) resizeflag="no";
	win_options = "height=" + win_height;
	win_options += ",width=" + win_width;
	win_options += ",left=" + pos_x;
	win_options += ",top=" + pos_y;
	win_options += ",toolbar=no";       
	win_options += ",location=no";    
	win_options += ",directories=no"; 
  win_options += ",status=no";    
  win_options += ",menubar=no";     
  win_options += ",scrollbars=yes";
  win_options += ",resizable=" + resizeflag;  
  win_options += ",dependent";      
  window.open(file,name,win_options);
}

function newPictureWin(file,win_width,win_height) {
	pos_x = 10;
	pos_y = 10;
	resizeflag="yes";
	if(navigator.appName.substring(0,8)=="Netscape" && parseInt(navigator.appVersion)==4) resizeflag="no";
	win_options = "height=" + win_height + 100;
	win_options += ",width=" + win_width + 10;
	win_options += ",left=" + pos_x;
	win_options += ",top=" + pos_y;
	win_options += ",toolbar=no";       
	win_options += ",location=no";    
	win_options += ",directories=no"; 
  win_options += ",status=no";    
  win_options += ",menubar=no";     
  win_options += ",scrollbars=no";
  win_options += ",resizable=" + resizeflag;  
  win_options += ",dependent";      
  window.open(file,"Zoom",win_options);
}

function dlWin(file,name) {
	pos_x = 2 * screen.availWidth;
	pos_y = 2 * screen.availHeight;
	win_width = 1;
	win_height = 1;
	resizeflag="no";
	if(navigator.appName.substring(0,8)=="Netscape" && parseInt(navigator.appVersion)==4) resizeflag="no";
	win_options = "height=" + win_height;
	win_options += ",width=" + win_width;
	win_options += ",left=" + pos_x;
	win_options += ",top=" + pos_y;
	win_options += ",toolbar=no";       
	win_options += ",location=no";    
	win_options += ",directories=no"; 
  win_options += ",status=no";    
  win_options += ",menubar=no";     
  win_options += ",scrollbars=no";
  win_options += ",resizable=" + resizeflag;  
  win_options += ",dependent";      
  window.open(file,name,win_options);
}

function TextKopieren(FeldID) { 
	document.getElementById(FeldID).focus(); 	
	document.getElementById(FeldID).select();  
	if(document.all) 	{ 	
		Bereich=document.getElementById(FeldID).createTextRange();	
		Bereich.execCommand("Copy"); 	
	}  
}


function toggleSection(section) {

	if(document.getElementById(section).style.display=="block") {
		document.getElementById(section).style.visibility="hidden";
		document.getElementById(section).style.display = "none"; 
		document.getElementById('control_'+section).innerHTML = 'anzeigen &raquo;';
	}
	else {
		document.getElementById(section).style.visibility="visible";
		document.getElementById(section).style.display = "block"; 
		document.getElementById('control_'+section).innerHTML = 'ausblenden &laquo;';
	}
	
	return false;

}

function toggleCategory(section) {

	// alert('collapse table section ' + section);
	if(document.getElementById(section).style.visibility=="visible") {
		document.getElementById(section).style.visibility="hidden";
		document.getElementById(section).style.display = "none"; 
		document.getElementById('head'+section).innerHTML = '<img src="gfx/pfeil_expand.gif" alt="" height="15" width="15" border="0">';
	}
	else {
		document.getElementById(section).style.visibility="visible";
		document.getElementById(section).style.display = "block"; 
		document.getElementById('head'+section).innerHTML = '<img src="gfx/pfeil_collapse.gif" alt="" height="15" width="15" border="0">';
	}
	
	return false;

}

function togglePreviewPicture(section) {
	// alert('togglePreviewPicture: ' + section);
	
	if(document.getElementById(section).style.visibility=="visible") {
		hidePreviewPicture(section);
		// document.getElementById(section).style.visibility="hidden";
		// document.getElementById(section).style.display = "none"; 
	}
	else {
		showPreviewPicture(section);
		// document.getElementById(section).style.visibility="visible";
		// document.getElementById(section).style.display = "block"; 
	}	
}

function showPreviewPicture(section) {
		document.getElementById(section).style.visibility="visible";
		document.getElementById(section).style.display = "block"; 
}

function hidePreviewPicture(section) {
		document.getElementById(section).style.visibility="hidden";
		document.getElementById(section).style.display = "none"; 
}

function showToolhint(section, hint) {

	document.getElementById(section).innerHTML = hint;
	
	return false;
}

function toggleCaption(section) {
	// alert('toggleCaption ' + section);

	// overflow
	if(document.getElementById(section).style.visibility=="visible") {
		document.getElementById(section).style.visibility="hidden";
	}
	else {
		document.getElementById(section).style.visibility="visible";
		// document.getElementById(section).style.display = "block";
	}

	return false;
}




function mouse(e) {
	if(MouseOverObjekt) {
		var x = e.pageX;
		var y = e.pageY;
	}
	else {
		var x = event.x+document.body.scrollLeft;
		var y = event.y+document.body.scrollTop;
	}
	
	MouseOverGrafik.left=x+XPosition;
	MouseOverGrafik.top=y+Anzeige;
}

function confirmDeletion(theLink, theQuestion) {
	// alert('link ' + theLink + ', conf ' + theQuestion);
	// No confirmation if browser is Opera (crappy js implementation)
	if (typeof(window.opera) != 'undefined') {
		return true;
	}
	var is_confirmed = confirm(theQuestion);
	if(is_confirmed) {
		theLink.href += '&iscfd=1';
	}

	return is_confirmed;
} // END: 'confirmDeletion()' function

var checkflag = "false";
function check(form) {
	
	var field = form.elements;
	
	if (checkflag == "false") {
	  for (i = 0; i < field.length; i++) {
	  field[i].checked = true;}
	  checkflag = "true";
	  return " keine "; 
	}
	  
	else {
	  for (i = 0; i < field.length; i++) {
	  field[i].checked = false; }
	  checkflag = "false";
	  return " alle "; }
	  
}



