function searchresult()
 {
	document.frmSearch.action='search.aspx';
	document.frmSearch.submit();
	return false;
 }

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 submitmypage(link)
        {
            //alert(tablelink);
            self.location="" + link + "";   
         }
         
  function MM_swapImage1(id,img)
  {
//alert(document.getElementById(id).classname);
     document.getElementById(id).style.background = "url(" + img + ") repeat-y";
     //document.getElementById(id).style.backgroundRepeat="repeat-y";
     document.getElementById(id).classname="fistlevel_sel";
  }
  
  function MM_swapImgRestore1(id,img)
  { 
  //alert(document.getElementById(id).classname);
     document.getElementById(id).style.background  = "#FFFFFF url(" + img + ") bottom repeat-x";
     document.getElementById(id).classname="fistlevel";
     // document.getElementById(id).style.backgroundRepeat="repeat-x";
 }

 function fnChangeText(DivId, VismerDiv) {
//     if (document.getElementById(DivId).style.visibility == 'visible') {
//         document.getElementById(VismerDiv).innerHTML = 'vis flere -';
//     }
//     else {
//         document.getElementById(VismerDiv).innerHTML = 'vis flere +';
//     }

if (document.getElementById(DivId).style.display == 'block') {
         document.getElementById(VismerDiv).innerHTML = 'vis flere -';
     }
     else {
         document.getElementById(VismerDiv).innerHTML = 'vis flere +';
     }  
 
 }
        
        function fnToggleExpannsion(DivId)
        {
//           if(document.getElementById(DivId).style.visibility =='visible')
//           {
//               document.getElementById(DivId).style.visibility = 'hidden';
//            }
//           else
//           { 
//            document.getElementById(DivId).style.visibility='visible';
//        } 

                if(document.getElementById(DivId).style.display =='block')
           {
               document.getElementById(DivId).style.display = 'none';
            }
           else
           { 
            document.getElementById(DivId).style.display='block';
        } 
     }    
function openWindow(catid,itemid)
{
   var curlink=window.document.location.toString();
                   
   window.open('Referlink.aspx?catid=' + catid + "&itemid=" + itemid + '&link=' + curlink , 'popupTIPS', 'width=570,height=650,scrollbars=no');
}
          
       function fnOpen(link)
       {
       //alert(link);
       window.open(link,'popupTIPS','width=570,height=700,scrollbars=no');
       }
                           
function addToFavorite(favTitle)
{ 
  var title=favTitle; 
  var url=location.href; 

  if(window.sidebar)
   { 
      window.sidebar.addPanel(title, url,""); 
   }
   else if( window.opera && window.print )
   { 
     var mbm = document.createElement('a'); 
     mbm.setAttribute('rel','sidebar'); 
     mbm.setAttribute('href',url); 
     mbm.setAttribute('title',title); 
     mbm.click(); 
   }
   else if(document.all)
   { 
     window.external.AddFavorite( url, unescape(favTitle)); 
   } 
} 
                        
function MCount(text,len)
 {
    var maxlength = new Number(len); // Change number to your max length.

    if(document.getElementById("ctl00_middleSection_Melding").value.length > maxlength)
    {
      text.value = text.value.substring(0,maxlength);
    }
}
     
     //For seach clearance 
     
        function clearfield(fieldName) {
            document.getElementById(fieldName).value = '';
        }

        function getOriginaltext(fieldName, lang) {
            if (fieldName == 'ctl00_skeyword') {
                if (document.getElementById(fieldName).value == '') {
                    if (lang == 1) {
                        document.getElementById(fieldName).value = 'Søk..';
                    }
                    else {
                        document.getElementById(fieldName).value = 'Search here ..';
                    }

                }

            }
        }

//For seach clearance
     function fnObeyLink(url)
     {
     window.location= url;
     }
     
     function clickclear(thisfield, defaulttext) 
                 {
                      if (thisfield.value == defaulttext) 
                      {
                            thisfield.value = "";
                      }
                 }
                         
                 function clickrecall(thisfield, defaulttext)
                 {
                      if (thisfield.value == "") 
                      {
                           thisfield.value = defaulttext;
                      }
                 }
                      
                      
             
 function changeBox() 
 {   
   document.getElementById('div123').style.display='none';  
   document.getElementById('div234').style.display=''; 
   document.getElementById('ctl00_txtPwd').focus(); 
 }
          
 function restoreBox()
 { 
    if(document.getElementById('ctl00_txtPwd').value=='')  
    {    
       document.getElementById('div123').style.display=''; 
       document.getElementById('div234').style.display='none';  
    }
 }
    
    
    function loadImages () 
         { 
           // for (j in imgname) 
           // {
            //    imgPreload = new Image();

            //    imgPreload.src =imgname[j];
                //alert(imgname[i]);
           // }
  
        }
        
        
       function menuOver(id,txtid) {
        //alert(langid);
        document.getElementById(id).style.backgroundImage="url(../media/bg_level3_sel.jpg)";
         document.getElementById(id).style.backgroundPosition ="bottom";
        document.getElementById(id).style.backgroundRepeat ="no-repeat";
        document.getElementById(id).style.backgroundColor = "#27298E" ;
        document.getElementById(id).style.borderTop = "#27298E 2px solid" ;
        document.getElementById(id).style.borderLeft = "#27298E 1px solid" ;
        document.getElementById(id).style.borderRight = "#27298E 1px solid" ;
        document.getElementById(id).style.borderBottom = "#27298E 1px solid" ;
         document.getElementById(txtid).style.color="#ffffff";
        }  
        
          function menuOut(id,txtid) {
        //alert(langid);
            document.getElementById(id).style.backgroundColor = "#ffffff" ;
            document.getElementById(id).style.borderTop = "#ffffff 2px solid" ;
            document.getElementById(id).style.borderLeft = "#ffffff 1px solid" ;
            document.getElementById(id).style.borderRight = "#ffffff 1px solid" ;
            document.getElementById(id).style.borderBottom = "#ffffff 1px solid" ;
             document.getElementById(txtid).style.color="#545454";
          }         
          
          
       
          function onmousechgbullet(id,img,id1,color)
        {
        
           document.getElementById(id).src=img
            document.getElementById(id1).style.backgroundColor = color ;
        }
        
        function onmouseoutchgbullet(id,img,id1,color)
        {
          document.getElementById(id).src=img
          
            document.getElementById(id1).style.backgroundColor = color ;
        }
