function pfv(napisId){
	mywindow = window.open('', '','toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes,width=640,height=480,top=0,left=0');
	mywindow.location.href = './pfv?nid=' + napisId;
	mywindow.focus();
}

function s2f(napisId){
	var x, y; x = (screen.width/2) - 220; y = (screen.height/2) - 160;
	mywindow = window.open('', '','width=440,height=320,top='+y+',left='+x+'');
	mywindow.location.href = './index?comp=send2friend&htmlfile=blank&napisid=' + napisId;
	mywindow.focus();
}

function addToList(){
	if (document.frmS2F.recipient.value != ''){
		newOption = new Option(document.frmS2F.recipient.value,document.frmS2F.recipient.value, false, false);
		cmb = document.frmS2F.recipientsX;
		cmb.options[cmb.length] = newOption;
		document.frmS2F.recipient.value = '';
	}
}

function send(){
	if (document.frmS2F.sender.value != ''){
		if (document.frmS2F.recipientsX.length > 0){
			document.getElementById("wait").style.display = '';
			document.getElementById("input").style.display = 'none';
			hhf = document.getElementById("recipients");
			hhf.value = '';
			cmb = document.getElementById("recipientsX");
			for (i=0; i<cmb.length; i++){
				hhf.value = hhf.value + cmb.options[i].value;
				if (i < cmb.length-1){
					hhf.value = hhf.value+ ',';
				}
			}
			document.frmS2F.submit();
		} else {
			alert('Морате да внесете барем еден примач');
			document.frmS2F.recipient.focus();	
		}
	} else {
		alert('Морате да внесете вредност во полето: Испраќа');
		document.frmS2F.sender.focus();
	}
}
