Hey All,

I know some basic automation batch scripts, shell scripts
but I have no experience in web development.

At my work we use salesforce to handle tickets
and we have internal Knowledgebase inside
with solutions, documentation and such.

My manger at work has asked me the following:

We need BALink to change the js function below.


pay attention that it was without password and we do not want them to get the password from javascript. now link should be:
here's more information:
Below are the functions to be embedded in the KB button. There is a different logic for each website.
As we agreed, the partner portal will be tested (and added) in a later phase.

Function to put on AeroScount.com/Support:

function gotoTalisma2() {
var username = document.getElementById('un').value
var url = 'https://kb.aeroscout.com/display/Integration/SalesForcev2/sfdcmain.aspx?SFSID=1&SFURL=http://www.aeroscout.com/support&SFCID=&SFSearch=&SFUN='
+ username
if(username.indexOf('aeroscout.com') != -1 || username.indexOf('sbdinc.com') != -1){
url += '&cid=36&c=12&cpc=fW5Id08wSb14p83b4eq5DdxX0IeMQglCnFRq3KY2b3M';
if(navigator.userAgent.toLocaleLowerCase().indexOf('chrome') != -1 ){

var a = document.createElement("a");
a.href = url;
var evt = document.createEvent("MouseEvents");
//the tenth parameter of initMouseEvent sets ctrl key
evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0,
true, false, false, false, 0, null);
else {

Function to put on Stanleyhealthcare.com/Support:

can someone please advise from where do I start?
I remind you that I'm not familiar with java script or web development at all.

Any comment would be highly appriciated!