<!--

function hideShow(number){

	var check = document.getElementsByName("delete"+number)[0];
	var title = document.getElementsByName("newstitle"+number)[0];
	var content = document.getElementsByName("newscontent"+number)[0];
		
	if(check.checked == true){
		title.setAttribute('style','display:none;');
		content.setAttribute('style','display:none;');
	}else{
		title.setAttribute('style','display:inline;');
		content.setAttribute('style','display:inline;');
	}
}

function insertLink(sampleText,target) {
	//var txtarea = document.edit.uOpis;
	var txtarea = document.getElementsByName(target)[0];
	// IE
	if(document.selection) {
		var theSelection = document.selection.createRange().text;
		var tagLink = prompt("podaj link:","http://")
		if(!theSelection) { theSelection=sampleText;}
		txtarea.focus();
		if(theSelection.charAt(theSelection.length - 1) == " "){// exclude ending space char, if any
			theSelection = theSelection.substring(0, theSelection.length - 1);
			document.selection.createRange().text = '<a href="' + tagLink + '" target="_blank">' + theSelection + '</a> ';
		} else {
			document.selection.createRange().text = '<a href="' + tagLink + '" target="_blank">' + theSelection + '</a> ';
		}
	// Mozilla
	} else if(txtarea.selectionStart || txtarea.selectionStart == '0') {
 		var startPos = txtarea.selectionStart;
		var endPos = txtarea.selectionEnd;
		var tagLink = prompt("podaj link:","http://")
		var myText = (txtarea.value).substring(startPos, endPos);
		if(!myText) { myText=sampleText;}
		if(myText.charAt(myText.length - 1) == " "){ // exclude ending space char, if any
			subst = '<a href="' + tagLink + '" target="_blank">' + myText.substring(0, (myText.length - 1)) + tagClose + '</a> '; 
		} else {
			subst = '<a href="' + tagLink + '" target="_blank">' + myText + '</a>'; 
		}
		txtarea.value = txtarea.value.substring(0, startPos) + subst + txtarea.value.substring(endPos, txtarea.value.length);
		txtarea.focus();
		var cPos=startPos+(29+myText.length);
		txtarea.selectionStart=cPos;
		txtarea.selectionEnd=cPos;
	// All others
	} else {
		// Append at the end: Some people find that annoying
		var tagLink = prompt("podaj link:","http://")
		txtarea.value += '<a href="' + tagLink + '" target="_blank">' + sampleText + '</a>';
		txtarea.focus();
		//var re=new RegExp("\\n","g");
		//tagOpen=tagOpen.replace(re,"");
		//tagClose=tagClose.replace(re,"");
		//document.infoform.infobox.value=tagOpen+sampleText+tagClose;
		txtarea.focus();
	}
	// reposition cursor if possible
	if (txtarea.createTextRange) txtarea.caretPos = document.selection.createRange().duplicate();
}

function popMeUp(address){
	txt="scrollbars=yes";
  okienko=window.open(address,"okienko",txt);
  okienko.resizeTo("600","600");
  okienko.focus();
}

//-->

