var pop = null;

function popdown() { 
	if (pop && !pop.closed) pop.close(); 
} 

function popup(obj,w,h) { 
	var url = (obj.getAttribute) ? obj.getAttribute('href') : obj.href; 
	if (!url) return true; w = (w) ? w += 20 : 150;
	h = (h) ? h += 25 : 150; 
	var args = 'width='+w+',height='+h+',resizable,scrollbars,'; 
	popdown(); 
	pop = window.open(url,'',args); return (pop) ? false : true; 
} 
window.onunload = popdown; 
window.onfocus = popdown; 

function showNewssystemForm(val) {
	if (val == "author") {
		document.getElementById("loginNewssystemId").style.display='inline';
	} else {
		document.getElementById("loginNewssystemId").style.display='none';
	}
}



function addsmilie(id,code) {
		formname = document.getElementById(id);
		formname.value = formname.value + code;
}

function openwindow(field,url,size) {
  var newwin = window.open(url,'colors',size,true);
  newwin.focus();
  newwin.sendto = field;
 }
