// JavaScript Document

function ExpandDiv(a) {

	if(a.parentNode && a.parentNode.className) {

		if(a.parentNode.className == "divopened") a.parentNode.className = "divclosed";

		else a.parentNode.className = "divopened"

	}

}

function swapMenuImage(imId, newSrc){
	var i = document.getElementById(imId);
	i.src = newSrc;
}

function preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.p) d.p=new Array();
    var i,j=d.p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}}
}

function switchLanguage(langId){
	setCookie('LangId', langId);
	window.location.href = window.location.href;
}

function getClientWidth()
{
  return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;
}

function getClientHeight()
{
  return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight;
}

function addOption (oListbox, text, value, isDefaultSelected, isSelected)
{

  var oOption = document.createElement("option");
  oOption.appendChild(document.createTextNode(text));
  oOption.setAttribute("value", value);

  if (isDefaultSelected) oOption.defaultSelected = true;
  else if (isSelected) oOption.selected = true;

  oListbox.appendChild(oOption);
}

