﻿// JScript File

    // AJAX objekt
    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;
    }
    
    function JStest(lng)
    {
        xmlHttp=GetXmlHttpObject()
        if (xmlHttp==null)
        {
          alert ("Browser does not support HTTP Request")
          return
        } 
        alert("språk " + lng.toString())
    }
    
    function JSsetCookie(c_name,value,expiredays)
    {
        var exdate=new Date()
        exdate.setDate(exdate.getDate()+expiredays)
        document.cookie = c_name+ "=" + value + ((expiredays==null) ? "" : ";expires=" + exdate.toGMTString())
        window.location.reload()
    }
