//------------------------------------------------------------
// collection of convinience
// js function
//
// last changed : Sun Mar  9 22:35:12 CET 2003
//------------------------------------------------------------

//------------------------------------------------------------
// function : openSmallWindow
// purpose  : opens a new window with parameter URL,
//            Windowname, width and height
// params   : String url, String windowname, Integer width,
//            Integer height, Integer x position,
//            Integer y position
// return   : Object window
//
//------------------------------------------------------------

function openSmallWindow(url, name, w, h, posx, posy)
{
  var smallwindow=window.open(url, name, 'toolbar=no,location=no,directories=no,status=no,menubar=0' + ',scrollbars=no,resizable=no,copyhistory=no,top='+posy+',left='+posx+',width='+w+',height='+h);
  /*
  if(smallwindow != null)
  {
    if (smallwindow.opener == null)
    {
       smallwindow.opener = self;
    }
  }
  */

  return smallwindow;
}


//------------------------------------------------------------
// function : openPopUp
// purpose  : caller for openSmallWin
// params   : String url, Integer width,
//            Integer height
// return   : nothing
//
//------------------------------------------------------------

function openPopUp(url, w, h)
{
  var posx = 10;
  var posy = 10;
  name = getRandomNum();
  day = new Date();
  id = day.getTime();
  // var sw=window.open(url, name, 'toolbar=no,location=no,directories=no,status=no,menubar=0' + ',scrollbars=no,resizable=no,copyhistory=no,top='+posy+',left='+posx+',width='+w+',height='+h);
  eval("page" + id + " = window.open(url, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,top='+posy+',left='+posx+',width='+w+',height='+h);");
}

//------------------------------------------------------------
// function : getRandomNum
// purpose  : get a random number a s string
// params   : none
// return   : String randomnumber
//
//------------------------------------------------------------

function getRandomNum ()
{
    var rnd = Math.random().toString();
    var crnd = rnd.replace(/\./, "");
    return crnd;
}


//------------------------------------------------------------
// function : getNoCacheUrl
// purpose  : get a randomnumber decorated url
// params   : url to decorate
// return   : randomnumber decorated url
//
//------------------------------------------------------------

function getNoCacheUrl(url)
{
    var rnd = getRandomNum();
    var cmpdurl=url+"&nd="+rnd;

    return cmpdurl;
}

//------------------------------------------------------------
// function : goNoCacheUrl
// purpose  : get a randomnumber decorated url
// params   : url to decorate
// return   : randomnumber decorated url
//
//------------------------------------------------------------

function goNoCacheUrl(url)
{
    var nocacheurl = getNoCacheUrl(url);

    location.href=nocacheurl;
}

//------------------------------------------------------------
// Language changer function
//------------------------------------------------------------

function changeLang(target)
{
var oldURL=document.URL;
var sitePart=window.location.hostname;
var pathPart=window.location.pathname;
var newPath = pathPart.substr(4,pathPart.length-4)
newPath = "/"+ target + "/"+ newPath;
window.location.href="http://" + sitePart + newPath;
}

