﻿//Written because of Microsoft patch KB912812
function WriteUncommentedObject(objectId)
{
  var obj = document.getElementById(objectId);
  WriteObject(obj.innerHTML);
}

function WriteObject(objectHTML)
{
  document.write(objectHTML);
}

function WriteObjectToDocument(document, objectHTML)
{
  document.write(objectHTML);
}

function UncommentObject(document, objectId)
{
  document.getElementById(objectId).outerHTML = document.getElementById(objectId).innerHTML;
}

function AddConfigurationLink()
{
  var i = document.scripts.length - 1;
  if (i < 0) return;

  var ThisScript = document.scripts[i];
  if (!ThisScript) return;

  var BaseUrl;
  var flag = true;
  if (top.aras && top.aras.getBaseURL)
  {
    try
    {
      BaseUrl = top.aras.getBaseURL();
      flag = false;
    }
    catch (e) { }
  }
  if (flag)
  {
    var rex = new RegExp('.*/Client', 'i');
    BaseUrl =  rex.exec(location.href)[0];
  }
  if (!BaseUrl) return;

  document.write("<link rel=\"Configuration\" href=\"" + BaseUrl + "/cbin/AllAssemblies.config.xml\">");
}

AddConfigurationLink();
