<!-- 

function klistra(textEl) {
	if (textEl.createTextRange)
	textEl.caretPos = document.selection.createRange().duplicate();
	textE1 = (document.all) ? document.selection.createRange().text : window.getSelection();
}

function textCounter(field, maxlimit) {
if (field.value.length > maxlimit) {
field.value = field.value.substring(0, maxlimit);
alert("Du får tyvärr inte skriva mer än " + maxlimit + " tecken!");
}
}

var newWin = null;

function closeWin(){
	if (newWin != null){
		if(!newWin.closed)
			newWin.close();
	}
}

function popUp(strURL,strType,strHeight,strWidth) {
closeWin();
var strOptions="";
if (strType=="console") strOptions="scrollbars,resizable,height="+strHeight+",width="+strWidth;
if (strType=="fixed") strOptions="height="+strHeight+",width="+strWidth;
if (strType=="elastic") strOptions="toolbar,menubar,scrollbars,resizable,location,height="+strHeight+",width="+strWidth;
newWin = window.open(strURL, 'newWin', strOptions);
newWin.focus();
}

var ie = true;

function hL(E){
	while (E.tagName!="TR")	{
		E = E.parentNode;
		E.style.backgroundColor = '';
	}
	E.className = "H";
}

function dL(E){
	var anyChecked = false;
	for (var i=0;i<frm.elements.length;i++)	{
		var e = frm.elements[i];
		if (e.checked) anyChecked = true;
	}

	// If no row is selected, disable buttons...
	if ( anyChecked == false ) {

	}

	while (E.tagName!="TR")	{
		E = E.parentElement;
		E.style.backgroundColor = '';
	}

	E.className = "";
}

function CA( ){
	for ( var i=0; i < frm.elements.length; i++ )
	{
		var e = frm.elements[i];
		if ( ( e.name != 'allbox' ) && ( e.type=='checkbox' ) && ( e.disabled == false ) )
		{
			e.checked = frm.allbox.checked;
			if ( frm.allbox.checked ) hL(e);
			else dL(e);
		}
	}
}

function CCA( CB ){
	if (CB.checked) hL(CB);
	else dL(CB);
	
	var TB=TO=0;
	
	for (var i=0;i<frm.elements.length;i++)
	{
		var e = frm.elements[i];
		if ( ( e.name != 'allbox' ) )
		{
			TB++;
			if (e.checked) TO++;
		}
	}
}

function sok() {
count = count+1;
document.getElementById(whichElement).innerHTML = "<br><div align=center><b>Söker i databasen...</b><br><br><img src='bilder/progress.gif'><br><br></div>"
setTimeout("showData("+count+")",500);
}
//-->