/*
General JS Scripts
*/

// select all checkboxes by name
function change_checkbox(cb_name,cbx_value) {
  	for (var i = 0; i < document.kp.elements.length; i++) {
		if (document.kp.elements[i].name == cb_name) {
    		document.kp.elements[i].checked = cbx_value;
    	}
  	}
}

// opening new window WITHOUT menubar and locationbar
function openWindow(URL,windowname,width_px,height_px) { //v2.0
	if(width_px < 10) { 
		var width_px = screen.width;
		if(width_px < 100) { width_px = 450; }
	}
	if(height_px < 10) { 
		var height_px = screen.height;
		if(height_px < 100) { height_px = 400; }
	}
	if(windowname == 'Media' || windowname == 'Bildergalerie') var toolbar_sett = 'no';  else var toolbar_sett = 'yes';
 Fenster = window.open(URL,windowname,"locationbar=no,menubar=no,status=no,toolbar="+toolbar_sett+",resizable=yes,width="+width_px+",height="+height_px+",scrollbars=yes,top=0");
	Fenster.focus();
}

// add event to box for further actions
function actionbox(tid,cmd) {
	if(0 == cmd) { document.getElementById('rfb').value = tid; }
	else { document.getElementById('a2b').value = tid; }
	document.kp.submit();
}

function input_prv(status,text) {
	if(status == 'onblur') { 
	 	if(document.kp.person.value=='') { 
			document.kp.person.style.color='#EEEEEE'; 
			document.kp.person.value= text ; 
		}
	} 
	if(status == 'onfocus') { 
		if(document.kp.person.value== text) { 
			document.kp.person.value=''; 
			document.kp.person.style.color='#FFFFFF'; 
		}
	} 
}

