/***************************************************
*
* Script: formdesign.js
*
* (c) 2003 achivo networks, http://www.achivo.de
*
***************************************************/

// configuration
showfirstentry = false;

// functions
var w = ((is_ie4up && is_win)) ? true : false;
if(w) document.write('<link rel="stylesheet" type="text/css" href="../styles/formdesign.css">');
function CreateList(el){
  if(document.getElementById){
    if(document.getElementById(el+'_o').style.display=='none'){
      document.getElementById(el+'_o').style.display = 'block';
    } else if(document.getElementById(el+'_o').style.display=='block'){
      document.getElementById(el+'_o').style.display = 'none';
    }
  } else if(document.all){
    if(document.all[el+'_o'].style.display=='none'){
      document.all[el+'_o'].style.display = 'block';
    } else if(document.all[el+'_o'].style.display=='block'){
      document.all[el+'_o'].style.display = 'none';
    }
  }
}
function SelectOption(o,el,de,va){
  if(document.getElementById){
    document.getElementById(el+'_c').innerHTML = '&nbsp;'+de+'<input type="hidden" name="'+el+'" value="'+va+'">';
    o.style.backgroundColor = '#ffffff';
    document.getElementById(el+'_o').style.display = 'none';
  } else if(document.all){
    document.all[el+'_c'].innerHTML = '&nbsp;'+de+'<input type="hidden" name="'+el+'" value="'+va+'">';
    o.style.backgroundColor = '#ffffff';
    document.all[el+'_o'].style.display = 'none';
  }
}
function OptionOver(o){ o.style.backgroundColor = '#eeeeee';}
function OptionOut(o){ o.style.backgroundColor = '#ffffff';}
function CreateSelect(){
  var a = CreateSelect.arguments;
  var s = (showfirstentry) ? 3 : 5;
  if(w){
    var h1,h2,h3,h4,h5;
    h1 = '<table cellpadding="0" cellspacing="0" border="0" width="100%" onClick="CreateList(\''+a[1]+'\')"><tr><td><div class="listcont" style="width:'+a[0]+'px;"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td valign="top"><div id="'+a[1]+'_c" class="listval">';
    h2 = '&nbsp;'+a[4]+'<input type="hidden" name="'+a[3]+'" value="">';
    h3 = '</div></td><td align="right"><a href="javascript:void(0)"><img src="../i/icon_open.gif" width="17" height="18" border="0"></a></td></tr></table></div></td></tr></table><span id="'+a[1]+'_o" class="listoptions';
    if(a.length>15) h3 += 'b';
    h3 += '" style="width:'+a[0]+'px;display:none;">';
    h4 = '';
    for(i=s;i<a.length;i=i+2){
      h4 += '<div id="listb_o_'+a[i]+'" class="listoption" onMouseover="OptionOver(this)" onMouseout="OptionOut(this)" onClick="SelectOption(this,\''+a[1]+'\',\''+a[i+1]+'\',\''+a[i]+'\')">'+a[i+1]+'</div>';
      if(a[i]==a[2]) h2 = '&nbsp;'+a[i+1]+'<input type="hidden" name="'+a[1]+'" value="'+a[i]+'">';
    }
    h5 = '</span>';
    document.write(h1+h2+h3+h4+h5);
  } else {
    document.write('<select name="'+a[1]+'" class="select"');
    if(!document.layers) document.write(' style="width:'+a[0]+'px;"');
    document.write('>');
    for(i=s;i<a.length;i=i+2){
      document.write('<option value="'+a[i]+'"');
      if(a[i]==a[2]) document.write(' selected');
      document.write('>'+a[i+1]+'</option>');
    }
    document.write('</select>');
  }
}

