var ImgArray = new Array();
ImgArray[1] = new Image; ImgArray[1].src = 'pic/ikon_pil_op.gif';
ImgArray[2] = new Image; ImgArray[2].src = 'pic/ikon_pil_ned.gif';
ImgArray[3] = new Image; ImgArray[3].src = 'pic/ikon_kryds_neg.gif';
ImgArray[4] = new Image; ImgArray[4].src = 'pic/ikon_kryds.gif';

function doThis(menu){
  obj_img = eval("document."+menu+"_img")
  obj     = document.getElementById(menu).style
  if (obj.position  == 'absolute'){
      obj.position   = 'relative';
      obj.visibility = 'visible';
      obj_img.src    = ImgArray[1].src
  } else {
      obj.position   = 'absolute';
      obj.visibility = 'hidden';
      obj_img.src    = ImgArray[2].src
  }
}


function vis(menu){

  obj     = document.getElementById(menu).style

      obj.position   = 'relative';

      obj.visibility = 'visible';} 



function gem(menu){

  obj     = document.getElementById(menu).style

      obj.position   = 'absolute';

      obj.visibility = 'hidden';}


function Dropd(menu){
  obj_img = eval("document."+menu+"_img")
  obj     = document.getElementById(menu).style
  if (obj.position  == 'absolute'){
      obj.position   = 'relative';
      obj.visibility = 'visible';
      obj_img.src    = ImgArray[3].src
  } else {
      obj.position   = 'absolute';
      obj.visibility = 'hidden';
      obj_img.src    = ImgArray[4].src
  }
}

function tael(felt,disp,dig) {
tekst = document.Form.elements[felt].value.length;
if (tekst >= dig) {
document.Form.elements[felt].value = document.Form.elements[felt].value.substring(0, dig);
tekst = dig; }
document.Form.elements[disp].value = dig - (tekst) ;
 }


function Check(strMsg){

if (confirm(strMsg) == true){return true}	

else{	return false}

}


function PopWin(url,h,w) { 

popupWin = window.open(url, 'user', 'scrollbars,height=' + h + ',width=' + w + ',top=10,left=10');

popupWin.focus();

}



function deleteOption(object,index) {

    object.options[index] = null;

}



function addOption(object,text,value) {

    var defaultSelected = true;

    var selected = true;

    var optionName = new Option(text, value, defaultSelected, selected)

    object.options[object.length] = optionName;

}



function copySelected(fromObject,toObject) {

    for (var i=0, l=fromObject.options.length;i<l;i++) {

        if (fromObject.options[i].selected)

            addOption(toObject,fromObject.options[i].text,fromObject.options[i].value);

    }

    for (var i=fromObject.options.length-1;i>-1;i--) {

        if (fromObject.options[i].selected)

            deleteOption(fromObject,i);

    }

}



function SelectAll(fromObject) {

    for (var i=0, l=fromObject.options.length;i<l;i++) {

        fromObject.options[i].text,fromObject.options[i].selected = true;

    }

}
var xmlHttp
var cont
function visDiv(str,fil,container){
cont=container;
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null) {
  alert ("Your browser does not support AJAX!");
  return;
 } 
var url=fil;
url=url+"?q="+str;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function stateChanged() { 
if (xmlHttp.readyState==4) { 
document.getElementById(cont).innerHTML= (xmlHttp.responseText);
}}
function GetXmlHttpObject(){
var xmlHttp=null;
try  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();  }
catch (e)
  {  // Internet Explorer
  try
    {   xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); }
  catch (e)
    { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); }
 }
return xmlHttp; }

