﻿// JScript File
        function search()
        {
           ElemValue = document.getElementById("ctl00_txtSearch").value;
           if (ElemValue =="")
           {
                alert("Indtast Keyword");
                return false;
           }
           else
           {
            return true;
           }
        }
        var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};
BrowserDetect.init();
    function getres()
{
    try
    {
		var browser_name = navigator.appName;
		var system_name = navigator.userAgent;
		var winWidth = document.body.offsetWidth;
     if(BrowserDetect.browser=="Firefox")
        {
        
	        if(winWidth<=800) 
               { 
                    document.getElementById('masterSubMenuDiv').style.left = -14; 
                    
               } 
               else if(winWidth>801 ) 
               { 
                    var vTestVar = winWidth     - 800 ; 
                    document.getElementById('masterSubMenuDiv').style.left = -14+(vTestVar/2); 
               } 
	    }
		else if (browser_name.toLowerCase().indexOf("microsoft internet explorer") != -1 && system_name.toLowerCase().indexOf("mac") == -1)
		{
			// Style sheet for PC Internet Explorer
			if(winWidth<=800)
			{
				document.getElementById('masterSubMenuDiv').style.left = -33;
			}
			else if(winWidth>801 )
			{
			
				var vTestVar = winWidth	- 800 ;
				//alert(vTestVar);
				document.getElementById('masterSubMenuDiv').style.left = -33+(vTestVar/2);
			}
		}
		else if (browser_name.toLowerCase().indexOf("netscape") != -1 && system_name.toLowerCase().indexOf("mac") == -1)
		{
			// Style sheet for PC Netscape Navigator
			if(winWidth<=800)
			{
				document.getElementById('masterSubMenuDiv').style.left = -33;
			}
			else if(winWidth>801 )
			{
				var vTestVar = winWidth	- 800 ;
				document.getElementById('masterSubMenuDiv').style.left = -24+(vTestVar/2);
			}
		}
		else if (browser_name.toLowerCase().indexOf("microsoft internet explorer") != -1 && system_name.toLowerCase().indexOf("mac") != -1)
		{
			// Style sheet for MAC Internet Explorer
			if(winWidth<=800)
			{
				document.getElementById('masterSubMenuDiv').style.left = -33;
			}
			else if(winWidth>801 )
			{
				var vTestVar = winWidth	- 800 ;
				document.getElementById('masterSubMenuDiv').style.left = -25+(vTestVar/2);
			}
		}
		else if (browser_name.toLowerCase().indexOf("netscape") != -1 && system_name.toLowerCase().indexOf("mac") != -1)
		{
			// Style sheet for MAC Netscape Navigator
			if(winWidth<=800)
			{
				document.getElementById('masterSubMenuDiv').style.left = -33;
			}
			else if(winWidth>801 )
			{
				var vTestVar = winWidth	- 800 ;
				document.getElementById('masterSubMenuDiv').style.left = -34+(vTestVar/2);
			}
		}
		else if (browser_name.toLowerCase().indexOf("safari") != -1 && system_name.toLowerCase().indexOf("mac") != -1)
		{
			// Style sheet for MAC Safari
			if(winWidth<=800)
			{
				document.getElementById('masterSubMenuDiv').style.left = -33;
			}
			else if(winWidth>801 )
			{
				var vTestVar = winWidth	- 800 ;
				document.getElementById('masterSubMenuDiv').style.left = -33+(vTestVar/2);
			}
		}
		
		
}
catch(e)
{

}
}
	  window.onload = function() {
	      settings = {
	          tl: { radius: 10 },
	          tr: { radius: 10 },
	          bl: { radius: 10 },
	          br: { radius: 10 },
	          antiAlias: true,
	          autoPad: true
	      }
	      var myBoxObject = new curvyCorners(settings, "rounded");
	      myBoxObject.applyCornersToAll();
	      getres();
	  }
   window.onresize = function()
   {
  
    getres();
   }
   window.onfocus = function()
   {
    getres();
   }
    function closeWindow()
    {
        var top=self.screenTop;
        window.event('Logout.aspx?value=1');
    
    }
    buildWeeklyCalendar(0); 
    
         function showDiv()
            {
                var winWidth = document.body.offsetWidth;
			    // Style sheet for PC Internet Explorer
    			
//			    if(winWidth<=800)
//			    {
//				    document.getElementById('masterSubMenuDiv').style.left = 30;
//			    }
//			    else if(winWidth <=1024)
//			    {
//				    document.getElementById('masterSubMenuDiv').style.left = 40;
//			    }
//			    else if(winWidth <=1152)
//			    {
//				    document.getElementById('masterSubMenuDiv').style.left = 105;
//			    }
//			    else if(winWidth>1152)
//			    {
//				    document.getElementById('masterSubMenuDiv').style.left = 170;
//			    }
//    			
//			    if(winWidth>1280)
//			    {
//				    document.getElementById('masterSubMenuDiv').style.left = 330;
//			    }
//    			    if(winWidth>1280 && winWidth<=1400)
//			    {
//				    document.getElementById('masterSubMenuDiv').style.left = 230;
//			    }
//			    if(winWidth>1600)
//			    {
//				    document.getElementById('masterSubMenuDiv').style.left = 370;
//			    }
//			    
//                if(BrowserDetect.browser=="Firefox")
//                {
//                        if(winWidth<=800)
//			            {
//				            document.getElementById('masterSubMenuDiv').style.left = 30;
//			            }
//			            else if(winWidth <=1024)
//			            {
//				            document.getElementById('masterSubMenuDiv').style.left = 45;
//			            }
//			            else if(winWidth <=1152)
//			            {
//				            document.getElementById('masterSubMenuDiv').style.left = 108;
//			            }
//			            else if(winWidth>1152)
//			            {
//				            document.getElementById('masterSubMenuDiv').style.left = 173;
//			            }
//            			
//			            if(winWidth>1280)
//			            {
//				            document.getElementById('masterSubMenuDiv').style.left = 333;
//			            }
//    			            if(winWidth>1280 && winWidth<=1400)
//			            {
//				            document.getElementById('masterSubMenuDiv').style.left = 233;
//			            }
//			            if(winWidth>1600)
//			            {
//				            document.getElementById('masterSubMenuDiv').style.left = 373;
//			            }       
//                }
    
                if(winWidth<=800)
			    {
				    document.getElementById('masterSubMenuDiv').style.left = 772;
			    }
			    else if(winWidth <=1024)
			    {
				    document.getElementById('masterSubMenuDiv').style.left = 785;
			    }
			    else if(winWidth <=1152)
			    {
				    document.getElementById('masterSubMenuDiv').style.left = 847;
			    }
			    else if(winWidth>1152)
			    {
				    document.getElementById('masterSubMenuDiv').style.left = 912;
			    }
    			
			    if(winWidth>1280)
			    {
				    document.getElementById('masterSubMenuDiv').style.left = 1075;
			    }
    			if(winWidth>1280 && winWidth<=1400)
			    {
				    document.getElementById('masterSubMenuDiv').style.left = 975;
			    }

			    if(winWidth>1600 && winWidth<=1920)
			    {
				    document.getElementById('masterSubMenuDiv').style.left = 1230;
			    }
			    
            document.getElementById("masterSubMenuDiv").style.visibility='visible';
            
            }
        function hideDiv()
        {
         document.getElementById("masterSubMenuDiv").style.visibility='hidden';
         
        }

    



/*
  function emarketWindow()
 {
    window.open('http://www.e-maerket.dk/sw146.asp?URL=www.svalevinduet.dk');
 } 
    function FormValidation()
     {
        valUseName();
        valPassword();
         var Username=document.getElementById("ctl00_siteContentPlaceHolder_usernameSpan").innerHTML;
         var password=document.getElementById("ctl00_siteContentPlaceHolder_passwordSpan").innerHTML;
         if(document.getElementById("ctl00_siteContentPlaceHolder_usernameSpan").innerHTML== "" && password=="")
         {
               
                return true;
            }
            else
            {    
                return false;
            }
     }
   function valUseName()
        {
            document.getElementById("ctl00_siteContentPlaceHolder_usernameSpan").innerHTML="";
            ElemValue = document.getElementById("ctl00_siteContentPlaceHolder_txtUserName").value;
           if (ElemValue =="")
           {
                document.getElementById("ctl00_siteContentPlaceHolder_usernameSpan").innerHTML = "Indtast  Email";
               
           }
           if (ElemValue ==null)
           {
                document.getElementById("ctl00_siteContentPlaceHolder_usernameSpan").innerHTML = "Indtast  Email";
               
           }
           
             if(ElemValue!="")
        {
            var splitted = ElemValue.match("^(.+)@(.+)$");
            if(splitted == null) 
                document.getElementById("ctl00_siteContentPlaceHolder_usernameSpan").innerHTML = "Invalid Email";
            else
            {
                if(splitted[1] != null )
                {
                    var regexp_user=/^\"?[\w-_\.]*\"?$/;
                    if(splitted[1].match(regexp_user) == null)
                        document.getElementById("ctl00_siteContentPlaceHolder_usernameSpan").innerHTML = "Invalid Email";
                }
                if(splitted[2] != null)
                {
                    var regexp_domain=/^[\w-\.]*\.[A-Za-z]{2,4}$/;
                    if(splitted[2].match(regexp_domain) == null) 
                    {
                        var regexp_ip =/^\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]$/;
                        if(splitted[2].match(regexp_ip) == null) 
                            document.getElementById("ctl00_siteContentPlaceHolder_usernameSpan").innerHTML = "Invalid Email";
                    }
                }
            }
           }
        }  
       function valPassword()
        {
            document.getElementById("ctl00_siteContentPlaceHolder_passwordSpan").innerHTML="";
            ElemValue = document.getElementById("ctl00_siteContentPlaceHolder_txtPassword").value;
           if (ElemValue =="")
           {
                document.getElementById("ctl00_siteContentPlaceHolder_passwordSpan").innerHTML = "Indtast  Kodeord";
               
           }
           if (ElemValue ==null)
           {
                document.getElementById("ctl00_siteContentPlaceHolder_passwordSpan").innerHTML = "Indtast  Kodeord";
               
           }
           
        }  
        function buttonsubmit()
        {
            if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) 
            {
                document.getElementById('" + submitBtn.UniqueID + "').click();return false;
            }
            } 
            else 
            {
                return true;
            } 
          
        }  
    function frmValidation()
{
     valUseName();
     valPassword();
     if(document.getElementById("ctl00_siteContentPlaceHolder_usernameSpan").innerHTML== "" && document.getElementById("ctl00_siteContentPlaceHolder_passwordSpan").innerHTML=="")
     {      
        return true;
     }
     else
     {    
        return false;
     }
}

//svaleinline

  function changeMouseOver(ImgName)
{   
    document.getElementById("imgId").src = ImgName;
}
function load_detailImage1(ImgName)
{
	Imagespanfirst = document.getElementById("imageFirst");
	Imagespansecond = document.getElementById("imageSecond");
	Imagespanthird = document.getElementById("imageThird");
	Imagespanfourth = document.getElementById("imageFourth");
	Imagespanfirst.innerHTML ="<img src='"+ImgName+"'  border='0' style='margin-bottom: 0px;'>";		
	Imagespansecond.innerHTML  = "";
	Imagespanthird.innerHTML  = "";
	Imagespanfourth.innerHTML  = "";
}
function load_detailImage2(ImgName)
{   Imagespanfirst = document.getElementById("imageFirst");
    Imagespansecond = document.getElementById("imageSecond");
	Imagespanthird = document.getElementById("imageThird");
	Imagespanfourth = document.getElementById("imageFourth");
	
    Imagespanfirst.innerHTML  = "";
	Imagespanthird.innerHTML  = "";
	Imagespanfourth.innerHTML  = "";
	Imagespansecond.innerHTML ="<img src='"+ImgName+"'  border='0' style='margin-bottom: 0px;'>";		
}    
function load_detailImage3(ImgName)
{
	Imagespanfirst = document.getElementById("imageFirst");
    Imagespansecond = document.getElementById("imageSecond");
	Imagespanthird = document.getElementById("imageThird");
	Imagespanfourth = document.getElementById("imageFourth");
	
	Imagespanthird.innerHTML ="<img src='"+ImgName+"'  border='0' style='margin-bottom: 0px;'>";
	Imagespanfirst.innerHTML  = "";
	Imagespansecond.innerHTML  = "";
	Imagespanfourth.innerHTML  = "";	
}    
function load_detailImage4(ImgName)
{
    Imagespanfirst = document.getElementById("imageFirst");
    Imagespansecond = document.getElementById("imageSecond");
	Imagespanthird = document.getElementById("imageThird");
	Imagespanfourth = document.getElementById("imageFourth");
	Imagespanfirst.innerHTML  = "";
	Imagespansecond.innerHTML  = "";
	Imagespanthird.innerHTML  = "";
	Imagespanfourth.innerHTML ="<img src='"+ImgName+"'  border='0' style='margin-bottom: 0px;'>";
		
}  
  
  //CustomizeProduct.aspx
  
  function searchProduct()
        {
           ElemValue = document.getElementById("txtSearch").value;
           if (ElemValue =="")
           {
                alert("Indtast Keyword");
                return false;
           }
           else
           {
            return true;
           }
        }
        function showHideCart(param)
        {
           
       
           var temp="<img src='images/icon_cartfilled1.gif' border='0'/>";
            document.getElementById("emptySpan").innerHTML=temp;
                     
         }
         
         
 // FrequentlyAskedQuestions.aspx
function showdetailsFaq(d,e)
{			
    for(j=1;j<=e;j++)
    {
	        if(d==j)
		    {
			        if(eval(document.getElementById("divfaq"+j)).style.display=='none')
				    {
				        eval(document.getElementById("divfaq"+j)).style.display=''
				        eval(document.getElementById("imgfaq"+j)).src='images/icon_minus.gif'
				    }
			        else
				    {		
				        eval(document.getElementById("divfaq"+j)).style.display='none'
				        eval(document.getElementById("imgfaq"+j)).src='images/icon_plus.gif'
				    }
		    }
	        else
		    {
    				
		    }
    }
}
   		
window.onload=showdetailsFaq	

function displayFeedBack(selectedValue)
{
    var optionValue = selectedValue;
    if (optionValue != "Vælg")
    {
        window.open('UserFeedBack.aspx?option='+ optionValue, null,'height=300, width=330,status= no, resizable= no, scrollbars=no, toolbar=no,location=no,menubar=no ');    
    }
    else
    {
        alert("Vælg venligst fra listen");
    }		
}	
         
function showdetailsFaq1(d,e)
{			
    for(j=1;j<=e;j++)
    {
	        if(d==j)
		    {
			        if(eval(document.getElementById("divfaq1"+j)).style.display=='none')
				    {
				        eval(document.getElementById("divfaq1"+j)).style.display=''
				        eval(document.getElementById("imgfaq1"+j)).src='images/icon_minus.gif'
				    }
			        else
				    {				
				        eval(document.getElementById("divfaq1"+j)).style.display='none'
				        eval(document.getElementById("imgfaq1"+j)).src='images/icon_plus.gif'
				    }
		    }
	        else
		    {
    		
		    }
    }
}    		
window.onload=showdetailsFaq1
*/