function bookmark() {
 url='http://www.sexpert.ro';
 title='Totul despre sex';

 if (document.all) window.external.AddFavorite(url,title);
  else alert ('Apasa CTRL+D pentru a adauga acest site la Bookmarks');
}

function selectall (form) {
 val=form.elements['selall'].checked;
 for (i=0; i<form.elements.length; i++)
  if ((form.elements[i].type=='checkbox')&&(form.elements[i].type!='selall')) form.elements[i].checked=val;
}

function winopen (nm, fx, fy, mdl) {
 sw=screen.width-8; sh=screen.height-55;
 s='no';
 if (fx>sw) { x=0; s='yes'; fx=sw; } else x=Math.round((sw-fx)/2);
 if (fy>sh) { y=0; s='yes'; fy=sh; } else y=Math.round((sh-fy)/2);
 abc=window.open('/_popup.php?mdl='+mdl+'&nm='+nm,'ViewPic','top='+y+',left='+x+',width='+fx+',height='+fy+',scrollbars='+s);
}

// devcode

function insertTag(field,to,tc,ic,l1) {
 if (ic) {
  x=prompt(l1,'');
  if (x)
   insertAtCursor(field,to+x+tc);
 } else insertAtCursor(field,to);
 field.focus();
}

function insertEmoticon(field,x) {
 insertAtCursor(field,x);
 field.focus();
}

function insertAtCursor(field,value) {
 if (document.selection) {
// IE & Opera
  field.focus();
  sel=document.selection.createRange();
  sel.text=value;
 } else
    if (field.selectionStart||field.selectionStart=='0') {
// Mozilla
     var startPos=field.selectionStart;
     var endPos=field.selectionEnd;
     field.value=field.value.substring(0, startPos)+value+field.value.substring(endPos, field.value.length);
    } else
       field.value+=value;
}