function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function unset(array, valueToUnset, valueOrIndex, isHash){
var output=new Array(0);
for(var i in array){
  if(!valueOrIndex){//search value
    if(array[i]==valueToUnset){continue};
    if(!isHash){
    output[++output.length-1]=array[i];
    }
    else{
    output[i]=array[i];
    }
  }
  else{//search index (or key)
    if(i==valueToUnset){continue};
    if(!isHash){
    output[++output.length-1]=array[i];
    }
    else{
    output[i]=array[i];
    }
  }
}
return output
}

function reset_style(actualId,siteURL,isOnOrOff)
{
 id11=actualId+'11';
 id12=actualId+'12';
 id13=actualId+'13';
 id21=actualId+'21';
 id22=actualId+'22';
 id23=actualId+'23';
 id31=actualId+'31';
 id32=actualId+'32';
 id33=actualId+'33';
 document.getElementById(id12).style.backgroundColor=isOnOrOff?'#FF9700':'#D0E6FC';
 document.getElementById(id32).style.backgroundColor=isOnOrOff?'#FF9700':'#D0E6FC';
 document.getElementById(actualId).style.backgroundColor=isOnOrOff?'#FF9700':'#D0E6FC';


 document.getElementById(id21).style.backgroundColor=isOnOrOff?'#FF9700':'#D0E6FC';
 document.getElementById(id22).style.background=isOnOrOff?'rgb(255,151,0)':'rgb(208,230,252)';
 document.getElementById(id22).style.color=isOnOrOff?'rgb(255,255,255)':'rgb(71,21,109)';
 document.getElementById(id23).style.backgroundColor=isOnOrOff?'#FF9700':'#D0E6FC';
}
function shw(what)   //what=document.getElementById('name').style
{
 a='';
 aa=0;
 for(var i in what)
 {
  a+=i+'::'+what[i]+'<br>';
  aa++;
 }
  document.write(a);
}
function collapseAll(what,what2)               // collapse all questions and answers but not the selected one
{
   j='';
   j2=0;
   for(var i2 in what2)
   {
    if (isNaN(i2))
    {
     if (i2.substr(0,2)=='qa')                                        // question/answer
     {
      if (what!=i2)
      {
//      j+=document.getElementById(i2).style.display+'\n';
       if (document.getElementById(i2).style.display=='block')
       {
        document.getElementById(i2).style.display='none';
        document.getElementById('qa'+i2.substr(2,(i2.indexOf("_a"))*1-2)+'_q').style.backgroundColor='#FFFFFF';
//        alert(i2.substr(2,(i2.indexOf("_"))*1-2));
        document.getElementById(i2).style.backgroundColor='#FFFFFF';
//       document.getElementById(i2).style.fontStyle='normal';
       }
      }
      else document.getElementById(i2).style.backgroundColor='#FFFFFF';
     }
//     alert(what2);
     if (i2.substr(0,3)=='qgr')                      // question group
     {
      if (((what.substr(0,2)=='qa') && ('qgr'+what.substr(2,(what.indexOf("_"))*1-2)!=i2)) || ((what.substr(0,3)=='qgr') && (what!=i2)))
      {
//      j+=document.getElementById(i2).style.display+'\n';
       if (document.getElementById(i2).style.display=='block')
       {
        document.getElementById(i2).style.display='none';
//        document.getElementById(i2).style.backgroundColor='#FFFFFF';
//        document.write(i2);
       }
      }
      else document.getElementById(i2).style.backgroundColor='#FFFFFF';
     }
    }
    j2++;
   }
   //document.write(j);
}
function expandIt1(what)              // expand questions
{
    collapseAll(what,document.all);
   elm_a=document.getElementById(what);
   if (elm_a.style.display=='none')
   {
    elm_a.style.display='block';
   }
   else
   {
    elm_a.style.display='none';
   }
}
function expandIt1a(what)             // autoexpand questions (search)
{
   elm_a=document.getElementById(what);
   if (elm_a.style.display=='none')
   {
    elm_a.style.display='block';
   }
}
function expandIt2(what,what2)           //expand answers
{
    collapseAll('qa'+what+'_'+what2+'_a',document.all);
   elm_a=document.getElementById('qa'+what+'_'+what2+'_a');
   elm_q=document.getElementById('qa'+what+'_'+what2+'_q');
   if (elm_a.style.display=='none')
   {
    elm_a.style.display='block';
    elm_a.style.backgroundColor='#FFF8D1';
    elm_q.style.backgroundColor='#FFF8D1';
//    elm_q.style.fontStyle='italic';
   }
   else
   {
    elm_a.style.display='none';
    elm_q.style.backgroundColor='#FFFFFF';
    elm_q.style.fontStyle='normal';
   }
}
function expandIt2a(what,what2)            //autoexpand questions (search)
{
   elm_a=document.getElementById('qa'+what+'_'+what2+'_a');
   elm_q=document.getElementById('qa'+what+'_'+what2+'_q');
   if (elm_a.style.display=='none')
   {
    elm_a.style.display='block';
    elm_a.style.backgroundColor='#FFF8D1';
    elm_q.style.backgroundColor='#FFF8D1';
//    elm_q.style.fontStyle='italic';
   }
}
function checksearch(what)                 // search minimal string length
{
 if (what.searchfield.value.length>=3)
 {
    return true;
 }
 else
 {
    alert("Search term too short \n(minimum 3 characters)");
    return false;
 }
}