function VisEsaksgang(kontraktsid) { 
  var Hoyde = screen.availHeight - 100; 
  if (Hoyde > 800) {Hoyde = 700;}
  var setup = 'toolbar = no, location = no, status = no, scrollbars = yes, resizable = yes, copyhistory = no, width = 781, top = 10, height = ' + Hoyde; 
  window.open('https://www.legalis.no/ecase/contractwelcome.asp?KontraktId=' + kontraktsid + '&PartnerId=17', 'Saksgang', setup); 
} 

function getCookie(c_name) {
  if (document.cookie.length>0) {
    c_start=document.cookie.indexOf(c_name + "=");
    if (c_start!=-1) { 
      c_start=c_start + c_name.length+1; 
      c_end=document.cookie.indexOf(";",c_start);
      if (c_end==-1) {
        c_end=document.cookie.length;
      }
      return unescape(document.cookie.substring(c_start,c_end));
    }
  }
return "";
}


function checkCookie() {
  fontsize = getCookie('nff_fontsize');
  document.getElementById('main').style.fontSize = fontsize + 'em';
}

function setCookie(c_name,value) {
  createCookie(c_name, value);
  checkCookie();
}


function submitIt(frm) {
	  if (frm.title.value == "" ) {
	    alert("Innlegget trenger en tittel.     ");
	    frm.title.focus();
	    return false;
	  }
	  else if (frm.comment.value == "" ) {
	    alert("Skriv en kommentar, det er jo hele poenget her!     ");
	    frm.comment.focus();
	    return false;
	  }
	  else if (frm.signature.value == "" ) {
	    alert("Din kommentar trenger en signatur.     ");
	    frm.signature.focus();
	    return false;
	  }
	  return true;
	}

function check(){
        validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
        strEmail = document.getElementById('newuser_email').value;

        if (strEmail.search(validRegExp) == -1)
        {
            alert('Skriv inn en gyldig epostadresse.');
            return false;
        }
        return true;
    }

function goFigure(url) {
  /*  psfile://    */
  if (url.indexOf('psfile://') != -1) {
    url = url.replace('psfile://','./?module=Files;action=File.getFile;ID=');
  }

  /*  psm://    */
  if (url.indexOf('psm://') != -1) {
    url = url.replace('psm://','mailto:');
  }

  /*  psf://    */
  if (url.indexOf('psf://') != -1) {
    url = url.replace('psf://','./?module=Articles;action=ArticleFolder.publicOpenFolder;ID=');
  }

  /*  ps://    */
  if (url.indexOf('ps://') != -1) {
    url = url.replace('ps://','');
    if (url.indexOf(';')) {
      url = url.substring(url.indexOf(';')+1,url.length);
    }
    url = './?module=Articles;action=Article.publicShow;ID=' + url;
  }

  /*  psff://    */
  if (url.indexOf('psff://') != -1) {
    url = url.replace('psff://','./?module=Files;action=FileFolder.publicDisplay;ID=');
  }
  window.open(url);
}
function goTarget(url) {
  window.open(url);
}
function popUp(URL) {
 day = new Date();
 id = day.getTime();
 eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,location=0,statusbar=0,menubar=0,resizable=1,scrollbars=yes,width=760,height=800,left = 242.5,top = 112');");
 setTimeout("checkPop('"+id+"', '"+URL+"')", 2000);
}
function checkPop(id, URL) {
 eval("obj = page"+id+";");
 if (obj===undefined) {
  document.location = URL;
 }
}

function tellafriend(url) {
newwindow = window.open(url + ';template=tellafriend', '_blank', 'width=400,height=400,status=no,location=no,toolbar=no');
}
