/*
resolves the url with the base url to an absolute path
for ie it takes the base url and strips of the page.
then it adds the original url because ie ignores the basetag in javascript
(tested in IE en FF)
This is intended for javascript links 
*/
function resolveUrl(url)
{
  var path = '';
  
  if (url.indexOf('http://') == -1)
  {
    //ie other browsers dont have the document.all element
    if(document.all)
    {
      var elements;
      elements = document.getElementsByTagName('BASE');
      
      if (elements != null && elements.length > 0)
      {
        path = elements[0].href;
        path = path.substr(0,path.lastIndexOf('/')+1);
      }
    }
    path += url;
    return path;
  }
  else
  {
    return url;
  }
}


/*
Redirect to page 'url'
for ie it takes the base url and strips of the page.
then it adds the original url because ie ignores the basetag in javascript
(tested in IE en FF)
*/
function redirect(url)
{
  var path = '';
  
  if (url.indexOf('http://') == -1)
  {
    //ie other browsers dont have the document.all element
    if(document.all)
    {
      var elements;
      elements = document.getElementsByTagName('BASE');
      
      if (elements != null && elements.length > 0)
      {
        path = elements[0].href;
        path = path.substr(0,path.lastIndexOf('/')+1);
      }
    }
    path += url;
    window.location.href = path;
  }
  else
  {
    window.location.href = url;
  }
}

