
 function openTAC(catid, itemid, pid, catname, lang, sitename, domainName) 
		            {
            		
		            window.open(sitename + "/" + domainName + '/Termsandcondition/' + catid + "/" + itemid + "/" + pid + "/" + catname + "/" + lang + "/", 'popupTIPS', 'width=800,height=340,scrollbars=yes');
				            //var newwin = window.open("termsandconditions.aspx","Leveringsbetingelser","height=340,width=800")
				            //return false;
		            }
		            
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 openWindow(catid,itemid)
{
   var curlink=window.document.location.toString();
                   
   window.open('Referlink.aspx?catid=' + catid + "&itemid=" + itemid + '&link=' + curlink , 'popupTIPS', 'width=570,height=670,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);
    }
}
     
function clickclear(thisfield, defaulttext)
{
  if (thisfield.value == defaulttext) 
   {
      thisfield.value = "";
   }
}
             
function clickrecall(thisfield, defaulttext) 
{
   if (thisfield.value == "") 
   {
      thisfield.value = defaulttext;
    }
 }
 
 function clickclear1(thisfield, defaulttext,id)
{
  if (thisfield.value == defaulttext) 
   {
      thisfield.value = "";
      if (document.getElementById(id) !=null)
      {
      document.getElementById(id).style.display="none";
      }
   }
}
             
function clickrecall1(thisfield, defaulttext,id) 
{
   if (thisfield.value == "") 
   {
      thisfield.value = defaulttext;
       if (document.getElementById(id) !=null)
      {
        document.getElementById(id).style.display="block";
        }
    }
 }
             
 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 Menuover1(lid,rid,txtid)
//        {
//        document.getElementById(lid).style.backgroundImage="url(../media/bg_mnuleft_mo.png)";
//        document.getElementById(lid).style.backgroundRepeat ="no-repeat";
//        document.getElementById(lid).style.backgroundPosition="right center"
//         document.getElementById(rid).style.backgroundImage="url(../media/bg_mnuover.png)";
//        document.getElementById(rid).style.backgroundRepeat ="no-repeat";
//        document.getElementById(rid).style.backgroundPosition="100% 50%"
//        }
//        
//         function Menuout1(lid,rid,txtid)
//        {
//        document.getElementById(lid).style.backgroundImage="url(media/bg_mnuleft_sel.png)";
//        document.getElementById(lid).style.backgroundRepeat ="no-repeat";
//        document.getElementById(lid).style.backgroundPosition="right center"
//         document.getElementById(rid).style.backgroundImage="url(media/bg_mnuover_sel.png)";
//        document.getElementById(rid).style.backgroundRepeat ="no-repeat";
//          document.getElementById(txtid).style.color="#333333";
//         
//        }
          
//        function menuOver1(id)        
//        {
//          document.getElementById(id).style.backgroundColor="#ffffff";
//        }
//        
//          function menuOut1(id)        
//        {
//          document.getElementById(id).style.backgroundColor="Transparent";
//        }
//        
//            
//        
//       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 ;
        }
        
         function changeDivImage1(catid) {
//            alert("midsel"+catid);
            document.getElementById("topsel" + catid).style.background = "url(media/bglevel1top.jpg)";
            document.getElementById("midsel" + catid).style.background = "url(media/bglevel1mid.jpg)";
            document.getElementById("botsel" + catid).style.background = "url(media/bglevel1bot.jpg)";
           }

           function changeDivImage2(catid) {
//               alert(catid);
               document.getElementById("topsel" + catid).style.background = "url(media/bglevel1top_sel.jpg)";
               document.getElementById("midsel" + catid).style.background = "url(media/bglevel1mid_Sel.jpg)";
               document.getElementById("botsel" + catid).style.background = "url(media/bglevel1bot_Sel.jpg)";

           }


           function changeDivImagelm1(catid) {
           
               document.getElementById("lml" + catid).style.background = "url(media/left_sel.png)";
               document.getElementById("lmm" + catid).style.background = "url(media/mid_sel.png)";
               document.getElementById("lmr" + catid).style.background = "url(media/right_sel.png)";
           }

           function changeDivImagelm2(catid) {
              
               document.getElementById("lml" + catid).style.background = "url(media/left.png)";
               document.getElementById("lmm" + catid).style.background = "url(media/mid.png)";
               document.getElementById("lmr" + catid).style.background = "url(media/right.png)";

           }
           
             function changeDivImagesuppover() {
           
               document.getElementById("left").style.background = "url(media/left_sel.png)";
               document.getElementById("mid").style.background = "url(media/mid_sel.png)";
               document.getElementById("right").style.background = "url(media/right_sel.png)";
           }

           function changeDivImagesupout() {
              
               document.getElementById("left").style.background = "url(media/left.png)";
               document.getElementById("mid").style.background = "url(media/mid.png)";
               document.getElementById("right").style.background = "url(media/right.png)";

           }


           function changeDivImageartlm1(catid) {
              
               document.getElementById("lesmer" + catid).src = "media/artlesmer_mo.jpg";
               
           }

           function changeDivImageartlm2(catid) {
             
               document.getElementById("lesmer" + catid).src = "media/artlesmer.jpg";
          }
        
        
  //Gallary //
      
      
           var currentImgCount=0;
        var nextImgCount=1;
        var prevImgCount=-1;
        var prevnum=0;
        var i=0;
        var timeDelay;
         var IsSlideShow = 0;
         var htmlresult;
       
	     
    function FetchMediumImage(img_name,imgextn,imgcount,imgdescr,obj,txtid) // onclick Thumb rotator img
    {
        //  window.location.hash="#deta";    
        // alert("medium");
     
        var  p_para=img_name +  imgextn;
        
        //GetMediumImage.GetImage_Medium(p_para,imgcount,imagepath,imgdescr,OnWSRequestComplete, OnWSRequestFailed);
        nextImgCount = imgcount + 1;
        currentImgCount =  imgcount;
        prevImgCount =imgcount-1;
       
        IsSlideShow=0;
	    i=currentImgCount;
	    var tid="txt_"+currentImgCount;
//alert(document.getElementById(tid));

        document.getElementById("txt_"+prevnum).style.textDecoration="none";

	    document.getElementById("txt_"+currentImgCount).style.textDecoration="underline";

	  

	    prevnum=currentImgCount
	       var str_GalleryImg="";
	       
	         var prevGal="";


	         // this is code for the zoom button 

	         if (document.getElementById("zoom") != null) {
	             document.getElementById("zoom").innerHTML = limage1[imgcount];
             }



	          for(var i=0;i<=imgcount-1;i++)
	           {
	               prevGal += " " + limage[i];
	               
               
                }
	          
	            //alert(limage.length);
	          
	           for(var i=imgcount+1;i<limage.length;i++)
	           {
                str_GalleryImg+=" "+limage[i];
                
                //alert(str_GalleryImg[i]);
                }
                
                var currentHtml=imgstr[currentImgCount].replace(',','');
                
               htmlresult=prevGal+imgstr[currentImgCount]+str_GalleryImg;
              // alert(htmlresult);
	 	       var hashValue = "#deta"; 
	      window.location.hash = hashValue;
	  // alert(htmlresult);
	           if (document.getElementById("Image_Container_1") !=null)
                {
                
                
                
                document.getElementById("Image_Container_1").innerHTML=htmlresult;
                
                fadeTargetId='photo1' + currentImgCount;
                            
//                       if (hashValue == window.location.hash)
//                 {
//                    window.location.hash = new String((new Date().getMilliseconds()));
//                 }


                f1(currentImgCount);
                     //fadeInit();
                }
                
//        document.getElementById("imgtop").style.width = parseInt(width[currentImgCount])+"px";
//         document.getElementById("imgtopmid").style.width = parseInt(width[currentImgCount])-22+"px";
//          document.getElementById("imgbotmid").style.width = parseInt(width[currentImgCount])-22+"px";
//        document.getElementById("imgbot").style.width = parseInt(width[currentImgCount])+"px";

            if (document.getElementById("ctl00_ctl10_Image_Ingress1") != null)
	      {
	          document.getElementById("ctl00_ctl10_Image_Ingress1").innerHTML = imageIngress[currentImgCount];
	   //       alert(imageIngress[currentImgCount]);
	         
	      }
	      else
	      {


	          if (imageIngress[currentImgCount] != "") {

	              if (document.getElementById("ctl00_middleSection_ctl00_Image_Ingress1") != null) {
	              document.getElementById("ctl00_middleSection_ctl00_Image_Ingress1").innerHTML = imageIngress[currentImgCount];
	              document.getElementById("thumbbotContainer").style.display = "";
	             }
	          }
//	          else {

//	              document.getElementById("thumbbotContainer").style.display = "none";
//	          }



	      }
	      
	       if (document.getElementById("ctl00_middleSection_ctl00_imgTitle") !=null)
	      {
	        document.getElementById("ctl00_middleSection_ctl00_imgTitle").innerHTML=imagetitle[currentImgCount];
	      }
	    jQuery(document).ready(function ($) {
            $('#Image_Container_1 a img.imgcls').load(function () {
            var ic1wt = $('#Image_Container_1 a img.imgcls').width();
	          var ic1ht = $('#Image_Container_1 a img.imgcls').height();
	          $('#Image_Container_1').width(ic1wt);
	          $('#Image_Container_1').height(ic1ht);
	      });
	      });
	   } 
   
    
    function GetNextImage()     //Function To Show Next Image
    {
        if (nextImgCount < imagepath.length )
        {     
                        
           //GetMediumImage.GetImage_Next(currentImgCount,imagepath,imageIngress,OnWSRequestComplete, OnWSRequestFailed);
                        
           nextImgCount +=1;
           currentImgCount +=1;
           prevImgCount +=1;
          
           IsSlideShow=0;
           i=currentImgCount;
           
            var str_GalleryImg="";
	       
	         var prevGal="";

	         // this is code for the zoom button 

	         if (document.getElementById("zoom") != null) {
	             document.getElementById("zoom").innerHTML = limage1[imgcount];
	         }

           for(var i=0;i<=currentImgCount-1;i++)
	           {
                prevGal+=" " +limage[i];
                //alert(prevGal[i]);
                }
	          
	            //alert(limage.length);
	          
	           for(var i=currentImgCount+1;i<limage.length;i++)
	           {
                str_GalleryImg+=" "+limage[i];
                
                //alert(str_GalleryImg[i]);
                }
            //alert(width[nextImgCount]);
               htmlresult=prevGal+imgstr[currentImgCount]+str_GalleryImg
	        var hashValue = "#deta"; 
	      window.location.hash = hashValue;
	    
	    //alert(htmlresult);
	           if (document.getElementById("Image_Container_1") !=null)
                {
                
                   
                   
                   //alert(currentImgCount);
                   
                document.getElementById("Image_Container_1").innerHTML=htmlresult;
       
                  fadeTargetId='photo1' + currentImgCount;
                            
//                       if (hashValue == window.location.hash)
//                 {
//                    window.location.hash = new String((new Date().getMilliseconds()));
//                 }
                  //

                  var temp = currentImgCount;
                  //alert($('photo1' + currentImgCount));
                  //$('photo1' + currentImgCount).show("slow");
                  f1(currentImgCount);

                  

                     //fadeInit();
                }

           
           
           
//          if (document.getElementById("ctl00_ctl10_Image_Ingress") !=null)
//	      {
//	        document.getElementById("ctl00_ctl10_Image_Ingress").innerHTML=imageIngress[currentImgCount];
//	      }
//	      else
//	      {
//	        document.getElementById("ctl00_ctl10_Image_Ingress").innerHTML=imageIngress[currentImgCount];
              //	      }
              
//           var temp = new String(imageIngress[currentImgCount]);  
// alert(temp);  
// temp = temp.replace(/[^a-zA-Z 0-9]+/g,'<br>');  
// alert(temp);    
//              
           //  alert(imageIngress[currentImgCount]);
              if (document.getElementById("ctl00_ctl10_Image_Ingress1") != null) {
                  document.getElementById("ctl00_ctl10_Image_Ingress1").innerHTML = imageIngress[currentImgCount];
                 
                 }
                 else {

                     if (imageIngress[currentImgCount] != "") {
                       
                         document.getElementById("ctl00_middleSection_ctl00_Image_Ingress1").innerHTML = imageIngress[currentImgCount];
                         document.getElementById("thumbbotContainer").style.display = "";
                        
                     }
                     else {
                         
                         document.getElementById("thumbbotContainer").style.display = "none";
                     }
                 }



                 if (document.getElementById("ctl00_middleSection_ctl00_imgTitle") != null) {
                     document.getElementById("ctl00_middleSection_ctl00_imgTitle").innerHTML = imagetitle[currentImgCount];
                 }
                    
       }
    }
        
    function GetPrevImage()    //Function To Show Previous Image
    {
        if (prevImgCount != -1 )
       {
          //GetMediumImage.GetImage_Previous(currentImgCount,imagepath,imageIngress,OnWSRequestComplete, OnWSRequestFailed);
            
           nextImgCount -=1;      
           prevImgCount -=1;
           currentImgCount -=1; 
           IsSlideShow=0;
	       i=currentImgCount;
	       
	          var str_GalleryImg ="";

	          var prevGal = "";
	          // this is code for the zoom button 

	          if (document.getElementById("zoom") != null) {
	              document.getElementById("zoom").innerHTML = limage1[imgcount];
	          }
	         
	         	         
	      for(var i=0;i<=currentImgCount-1;i++)
	           {
                prevGal+=" "+limage[i];
                //alert(prevGal[i]);
                }
	          
	            //alert(limage.length);
	          
	           for(var i=currentImgCount+1;i<limage.length;i++)
	           {
                str_GalleryImg+=" "+limage[i];
                
                //alert(str_GalleryImg[i]);
                }
               
               htmlresult=prevGal+imgstr[currentImgCount]+str_GalleryImg
	     var hashValue = "#deta"; 
	     window.location.hash = hashValue;

	    //alert(htmlresult);
	           if (document.getElementById("Image_Container_1") !=null)
                {
                
                  
                   
                   //alert(currentImgCount);
                   
                document.getElementById("Image_Container_1").innerHTML=htmlresult;
       
                  fadeTargetId='photo1' + currentImgCount;
                            
//                       if (hashValue == window.location.hash)
//                 {
//                    window.location.hash = new String((new Date().getMilliseconds()));
//                 }

                  f1(currentImgCount);
                     //fadeInit();
                }
	       
//	        if (document.getElementById("ctl00_ctl10_Image_Ingress") !=null)
//	      {
//	        document.getElementById("ctl00_ctl10_Image_Ingress").innerHTML=imageIngress[currentImgCount];
//	      }
//	      else
//	      {
//	        document.getElementById("ctl00_ctl10_Image_Ingress").innerHTML=imageIngress[currentImgCount];
                 //	      }
                 if (document.getElementById("ctl00_ctl10_Image_Ingress1") != null) {
                     document.getElementById("ctl00_ctl10_Image_Ingress1").innerHTML = imageIngress[currentImgCount];
                 }
                 else {
                     
                     if (imageIngress[currentImgCount] != "") {

                         document.getElementById("ctl00_middleSection_ctl00_Image_Ingress1").innerHTML = imageIngress[currentImgCount];
                         document.getElementById("thumbbotContainer").style.display = "";

                     }
                     else {

                         document.getElementById("thumbbotContainer").style.display = "none";
                     }

                 }

                 if (document.getElementById("ctl00_middleSection_ctl00_imgTitle") != null) {
                     document.getElementById("ctl00_middleSection_ctl00_imgTitle").innerHTML = imagetitle[currentImgCount];
                 }
        }
    }
    
   function SlideShow(para)      //Function To Show Slideshow
    { 
       if (para == undefined) 
       {
          IsSlideShow = (IsSlideShow == 0) ? 1 : 0;
       }

       if (IsSlideShow == 1)
       {
       
         var str_GalleryImg ="";
	       
	         var prevGal = "";
	         
              for(var j=0;j<=currentImgCount;j++)
	           {
                prevGal+=" "+limage[j];
                //alert(prevGal[i]);
                }
	          
	            //alert(limage.length);
	          
          for(var k=currentImgCount+2;k<limage.length;k++)
	           {
                str_GalleryImg+=" "+limage[k];
                
                //alert(str_GalleryImg[i]);
                }
                
            
            if (i <= imagepath.length-1)
             {
                //GetMediumImage.GetImage_slideshow(i,imagepath,imageIngress, OnWSRequestComplete,OnWSRequestFailed);  
                
     
                currentImgCount=i ;
                prevImgCount = i-1;
                nextImgCount = i+1;
                i++;
                
                //prevGal1[i]=limage[i];
                
                //str_GalleryImg1[i]=limage[i];
//alert(i);
                
                htmlresult=prevGal+imgstr[currentImgCount]+str_GalleryImg
               
	      var hashValue = "#deta"; 
	     window.location.hash = hashValue;
	   //alert(htmlresult);
	           if (document.getElementById("Image_Container_1") !=null)
                {
                
                 
                   
                   //alert(currentImgCount);
                   
                document.getElementById("Image_Container_1").innerHTML=htmlresult;
       
                  fadeTargetId='photo1' + currentImgCount;
                            
//                       if (hashValue == window.location.hash)
//                 {
//                    window.location.hash = new String((new Date().getMilliseconds()));
//                 }


                  f1(currentImgCount);
                     //fadeInit();
                }

                
                timeDelay=setTimeout("SlideShow(0)",4000);
                
//          if (document.getElementById("ctl00_ctl10_Image_Ingress") !=null)
//	      {
//	        document.getElementById("ctl00_ctl10_Image_Ingress").innerHTML=imageIngress[currentImgCount];
//	      }
//	      else
//	      {
//	        document.getElementById("ctl00_ctl10_Image_Ingress").innerHTML=imageIngress[currentImgCount];
                //	      }
                if (document.getElementById("ctl00_ctl10_Image_Ingress1") != null) {
                    document.getElementById("ctl00_ctl10_Image_Ingress1").innerHTML = imageIngress[currentImgCount];
                }
                else {
                   
                    if (imageIngress[currentImgCount] != "") {

                        document.getElementById("ctl00_middleSection_ctl00_Image_Ingress1").innerHTML = imageIngress[currentImgCount];
                        document.getElementById("thumbbotContainer").style.display = "";

                    }
                    else {

                        document.getElementById("thumbbotContainer").style.display = "none";
                    }
                }

                if (document.getElementById("ctl00_middleSection_ctl00_imgTitle") != null) {
                    document.getElementById("ctl00_middleSection_ctl00_imgTitle").innerHTML = imagetitle[currentImgCount];
                }

             }
         
             if (i==imagepath.length)
             { 
               i=0;       
               clearTimeout(timeDelay);
             }
         }
         else
         {
             IsSlideShow=0;
             clearTimeout(timeDelay);
         }
      }        
      
