


function div_open(div_id) { 
 document.getElementById(div_id).style.visibility = 'visible'; 
 document.getElementById(div_id).style.display ='';
 
 //document.getElementById('f'+divId+'').setAttribute('src' , '../images/expanded.gif'); 
 
 document.getElementById('f_on'+div_id+'').style.visibility = 'hidden'; 
 document.getElementById('f_on'+div_id+'').style.display ='none';
 
 document.getElementById('f_off'+div_id+'').style.visibility = 'visible'; 
 document.getElementById('f_off'+div_id+'').style.display = '';
 
}

function div_close(div_id) { 
 document.getElementById(div_id).style.visibility = 'hidden'; 
 document.getElementById(div_id).style.display = 'none'; 
 
 document.getElementById('f_off'+div_id+'').style.visibility = 'hidden'; 
 document.getElementById('f_off'+div_id+'').style.display = 'none';
 
 document.getElementById('f_on'+div_id+'').style.visibility = 'visible'; 
 document.getElementById('f_on'+div_id+'').style.display ='';
 
}





function setCheckboxes(the_form, do_check,idname) {
 var elts      = (typeof(document.forms[the_form].elements[''+idname+'']) 
!= 'undefined') ? document.forms[the_form].elements[''+idname+''] : 
(typeof(document.forms[the_form].elements[''+idname+'']) != 'undefined') ? 
document.forms[the_form].elements[''+idname+''] : 
document.forms[the_form].elements[''+idname+''];
 
 var elts_cnt  = (typeof(elts.length) != 'undefined') ? elts.length : 0;
 if (elts_cnt) { for (var i = 0; i < elts_cnt; i++) { elts[i].checked = 
do_check; }  } 
 else { elts.checked        = do_check; } 
 return true;

}



// functionen fuer calendar
function calBox(URL) {
 attribute=" width=220, height=130,top=150,left=430,scrollbars=no ";
 fenster=window.open(URL,"calbox", attribute);
}

var calReq;

function navigate(month,year,formfeld) {
 var url = "./calret.php?month="+month+"&year="+year+"&formfeld="+formfeld+""; 
 if(window.XMLHttpRequest) {
  calReq = new XMLHttpRequest();
 }
 else if(window.ActiveXObject) {
  calReq = new ActiveXObject("Microsoft.XMLHTTP");
 }
  calReq.open("GET", url, true);
  calReq.onreadystatechange = callback;
  calReq.send(null);
}

function callback() {
 if(calReq.readyState == 4) {
  if(calReq.status == 200) {
   response = calReq.responseText;
   document.getElementById("div_cal").innerHTML = response;
  }
   else {
    alert("requesterror:\n" + calReq.statusText);
   }
 }
}

//function setDatum(nameform,namefeld,datum) {
function setDatum(feldid,datum) {
  //var formfeld="opener.document."+nameform+"."+namefeld+"";
  var formfeld="opener.document.getElementById('"+feldid+"')";  
  eval(formfeld+".value=datum");  
  window.close(); 
}
// ende functionen fuer calendar


function setRadioChk(sId) {
 obj = document.getElementById(sId);
 if(null!=obj)
  obj.click();
}


function divClose(divId) {
	
	document.getElementById(divId).style.visibility = 'hidden'; 
	document.getElementById(divId).style.display = 'none'; 
	
}

function divOpen(div_id) { 
 document.getElementById(div_id).style.visibility = 'visible'; 
 document.getElementById(div_id).style.display ='';
 }

function checkCB(id,click_type) {
 	if(!document.getElementById(id).checked) {
 		//document.getElementById('tr'+id).style.backgroundColor = '#ffffff';
 		document.getElementById(id).checked = true;
 	}
 	 else {
 	 	//document.getElementById('tr'+id).style.backgroundColor = '#ffffff';
 	 	document.getElementById(id).checked = false;
 	 }
}
 
function checkAll(obj) {
 	var obj=document.getElementsByName(obj);
 	
 	for (i=0; i<obj.length; i++) {
 	
 		if(!obj[i].checked) {
 			obj[i].checked=true;
 		}
 		 else {
 		 	obj[i].checked=false;
 		 }
 	}
 	
}

function formGo(form_name, step_no) {

	eval("document."+form_name+".step.value="+step_no+";");
	eval("document."+form_name+".submit()");
}

function formDelGo(form_name, del_ins_id) {
	
	del_go = confirmSubmit();
	

	if(del_go == 1){
		eval("document."+form_name+".del_ins_id.value="+del_ins_id+";");
		eval("document."+form_name+".submit()");
	}

	
}

function formUpdateGo(form_name, ins_update_id) {
	
	eval("document."+form_name+".ins_update_id.value="+ins_update_id+";");
	eval("document."+form_name+".submit()");
}

function setStatus(form_name, status_id, status) {
	
	status_go = confirmSubmit();
	

	if(status_go == 1){
		eval("document."+form_name+".set_status_id.value="+status_id+";");
		eval("document."+form_name+".status.value="+status+";");
		eval("document."+form_name+".submit()");
	}

	
}

function formGo2(form_name) {
	eval("document."+form_name+".submit()");
}

function changePic(picName,picURL) {
	document.images[picName].src = picURL;
}


var xmlhttp=false;
 
 function init() {
 	try  {
 		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	}
	 catch (e) {
	 	try {
	 		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
		 catch (E)  {
		 	xmlhttp = false;
		}
	}

	if (!xmlhttp && typeof XMLHttpRequest!='undefined')  {
		xmlhttp = new XMLHttpRequest();
	}
 }
 
 function showPreviewBox(link) {
 	if(xmlhttp) {
 		xmlhttp.open("GET", link,true);
 		xmlhttp.onreadystatechange= function() {
 			
 			if (xmlhttp.readyState==4)  {
 				var tooltiptext = xmlhttp.responseText;
 				if(tooltiptext != "") { 					
 					return Tip(tooltiptext,WIDTH, 625, SHADOW, true, FADEIN, 300, FADEOUT, 300, STICKY, true, FIX, [174, 170], EXCLUSIVE, true );  						
 					
 					
 				}
			}
		}
		xmlhttp.send(null);
	}
	 
 }
 
 function showPicBox(link) {
 	if(xmlhttp) {
 		xmlhttp.open("GET", link,true);
 		xmlhttp.onreadystatechange= function() {
 			
 			if (xmlhttp.readyState==4)  {
 				var tooltiptext = xmlhttp.responseText;
 				if(tooltiptext != "") { 					
 					return Tip(tooltiptext,WIDTH, 270, SHADOW, true, FADEIN, 300, FADEOUT, 300, STICKY, true, FIX, [525, 80] ); 					
 					
 					
 				}
			}
		}
		xmlhttp.send(null);
	}
	 
 }
 
  function showtooltip(link) {
 	if(xmlhttp) {
 		xmlhttp.open("GET", link,true);
 		xmlhttp.onreadystatechange= function() {
 			
 			if (xmlhttp.readyState==4)  {
 				var tooltiptext = xmlhttp.responseText;
 				if(tooltiptext != "") { 					
 					return Tip(tooltiptext,WIDTH, 400, SHADOW, true, FADEIN, 300, FADEOUT, 300, STICKY, true, OFFSETX, -200 ); 					
 					
 					
 				}
			}
		}
		xmlhttp.send(null);
	}
	 
 }
 
 function showMsgBox(link) {
 	if(xmlhttp) {
 		xmlhttp.open("GET", link,true);
 		xmlhttp.onreadystatechange= function() {
 			
 			if (xmlhttp.readyState==4)  {
 				var tooltiptext = xmlhttp.responseText;
 				if(tooltiptext != "") { 					
 					return Tip(tooltiptext,WIDTH, 285, SHADOW, true, FADEIN, 300, FADEOUT, 300, STICKY, true, OFFSETX, -200 );  						
 					
 					
 				}
			}
		}
		xmlhttp.send(null);
	}
	 
 }
 
 
 init();
 
 
