﻿// JScript File
function getLogin(){        
        var loggedValue = document.form1.test1.value;
        var loggedLink = document.form1.test2.value;                    
            if(loggedValue == null){logged=" ";}
        var elLogin = document.getElementById("registerYourProfile");    
            elLogin.innerHTML=loggedValue;
            elLogin.href=doSpecificLink(loggedLink);
            elLogin.title=loggedValue;
}
function init(){
    //getLogin();
}
if(window.attachEvent){
    window.attachEvent("onload", init);
}else if(document.addEventListener){
    document.addEventListener("DOMContentLoaded", init, null);
}
else{
    window.onload = init;
    init();
}
     
function doSpecificLink(link) 
{
    if(location.href.indexOf('https://') >= 0) 
    {
        var directories = location.pathname.split('/');
        var pathName = '/' + directories[1] + '/' + directories[2] + '/' + directories[3] + '/' + directories[4];
   
        var href = link.toLowerCase();
        if(href.indexOf( pathName.toLowerCase() ) < 0 ) 
        {
            var newPath = pathName + '/' + link;
            var result = newPath.replace('//','/');
            return result;       
        }
    }
    return link;

}
