function openWin(url, name, w, h) {
	launchTop = eval(screen.availHeight/2-h/2);
	launchLeft = eval(screen.availWidth/2-w/2);
	window.open(url ,name,'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=' + w + ',height=' + h + ',top=' + launchTop + ',left=' + launchLeft);
}

function articlePrint() {
	if(confirm('Sidan utformas automatiskt till ett utskriftsv\344nligt format. Du beh\366ver inte g\345 till en speciell sida. Vill du forts\344tta?')) window.print();


//  result = confirm('Sidan utformas automatiskt till ett utskriftsv\344nligt format. Du beh\366ver inte g\345 till en speciell sida. Vill du forts\344tta?');
//  if (result) window.print();
}




// omarbeta..

function grin(tag) {
	var myField;
	if (document.getElementById('content') && document.getElementById('content').type == 'textarea') {
		myField = document.getElementById('content');
	}
	else if (document.getElementById('comment') && document.getElementById('comment').type == 'textarea') {
		myField = document.getElementById('comment');
	}
	else {
		return false;
	}
	if (document.selection) {
		myField.focus();
		sel = document.selection.createRange();
		sel.text = tag;
		myField.focus();
	}
	else if (myField.selectionStart || myField.selectionStart == '0') {
		var startPos = myField.selectionStart;
		var endPos = myField.selectionEnd;
		var cursorPos = endPos;
		myField.value = myField.value.substring(0, startPos)
					  + tag
					  + myField.value.substring(endPos, myField.value.length);
		cursorPos += tag.length;
		myField.focus();
		myField.selectionStart = cursorPos;
		myField.selectionEnd = cursorPos;
	}
	else {
		myField.value += tag;
		myField.focus();
	}
}


