X++:
var randomnumber = 100000000 + Math.floor(Math.random() * 900000000);
window.open(getServerUrl('/main.aspx?etn='+type.toLowerCase()+'&id=%7b'+id.replace("{","").replace("}","")+'%7d&newWindow=true&pagetype=entityrecord&extraqs=&histKey='+randomnumber),'','menubar=0,toolbar=0,resizable=1,status=1');