function Go2($link){
location.replace($link);    
}


function catSearch($query,$offset) {
    var xmlHttp;
    try{  
        // Firefox, Opera 8.0+, Safari  
        xmlHttp=new XMLHttpRequest();  
    }
    catch (e){  
        // Internet Explorer  
        try{   
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");    
        }
          catch (e){    
              try{      
                  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");      
              }
            catch (e){
                return false;
            }    
          }  
    }
    
    var randomnumber=Math.floor(Math.random()*100);
    var gotourl = "catalogsearch.php?q=" + escape($query) + "&offset="+ $offset +"&rand="+randomnumber;
    xmlHttp.open("GET", gotourl, true);          
    xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlHttp.setRequestHeader("Accept-Charset", "iso-8859-1");
    
      xmlHttp.onreadystatechange = function(){
        var status1=200;
        try{
            status1=xmlHttp.status;}
        catch(e){
            status1=200;
        }
         
        if (xmlHttp.readyState == 4 && status1 == 200) {
           document.getElementById("catalogcontent").innerHTML=xmlHttp.responseText;       
          }
    }
      xmlHttp.send(null);
}   


function revealQuizAnswer($query) {
    var xmlHttp;
    try{  
        // Firefox, Opera 8.0+, Safari  
        xmlHttp=new XMLHttpRequest();  
    }
    catch (e){  
        // Internet Explorer  
        try{   
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");    
        }
          catch (e){    
              try{      
                  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");      
              }
            catch (e){
                return false;
            }    
          }  
    }
    
    var randomnumber=Math.floor(Math.random()*100);
    var gotourl = "ajax/revealQuiz.php?quiz_id=" + escape($query) + "&rand="+randomnumber;
    xmlHttp.open("GET", gotourl, true);          
    xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlHttp.setRequestHeader("Accept-Charset", "iso-8859-1");
    
      xmlHttp.onreadystatechange = function(){
        var status1=200;
        try{
            status1=xmlHttp.status;}
        catch(e){
            status1=200;
        }
         
        if (xmlHttp.readyState == 4 && status1 == 200) {
           document.getElementById("quizAnswer").innerHTML=xmlHttp.responseText;       
          }
    }
      xmlHttp.send(null);
}   



function revealFaqAnswer($query) {
    var xmlHttp;
    try{  
        // Firefox, Opera 8.0+, Safari  
        xmlHttp=new XMLHttpRequest();  
    }
    catch (e){  
        // Internet Explorer  
        try{   
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");    
        }
          catch (e){    
              try{      
                  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");      
              }
            catch (e){
                return false;
            }    
          }  
    }
    
    var randomnumber=Math.floor(Math.random()*100);
    var gotourl = "ajax/revealFaq.php?id=" + escape($query) + "&rand="+randomnumber;
    xmlHttp.open("GET", gotourl, true);          
    xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlHttp.setRequestHeader("Accept-Charset", "iso-8859-1");
    
      xmlHttp.onreadystatechange = function(){
        var status1=200;
        try{
            status1=xmlHttp.status;}
        catch(e){
            status1=200;
        }
         
        if (xmlHttp.readyState == 4 && status1 == 200) {
            document.getElementById("faqAnswer").style.backgroundColor="#f5f5f5";
            document.getElementById("faqAnswer").style.width="490px";
            document.getElementById("faqAnswer").style.marginTop="10px";
            
            document.getElementById("faqAnswer").style.border="1px solid #489aa5";
            
            document.getElementById("faqAnswer").innerHTML=xmlHttp.responseText;       
          }
    }
      xmlHttp.send(null);
}   



function submitFaqAnswer($query) {
    var xmlHttp;
    try{  
        // Firefox, Opera 8.0+, Safari  
        xmlHttp=new XMLHttpRequest();  
    }
    catch (e){  
        // Internet Explorer  
        try{   
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");    
        }
          catch (e){    
              try{      
                  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");      
              }
            catch (e){
                return false;
            }    
          }  
    }
    
    var randomnumber=Math.floor(Math.random()*100);
    var gotourl = "ajax/submitFaq.php?id=" + escape($query) + "&rand="+randomnumber;
    xmlHttp.open("GET", gotourl, true);          
    xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlHttp.setRequestHeader("Accept-Charset", "iso-8859-1");
    
      xmlHttp.onreadystatechange = function(){
        var status1=200;
        try{
            status1=xmlHttp.status;}
        catch(e){
            status1=200;
        }
         
        if (xmlHttp.readyState == 4 && status1 == 200) {
            document.getElementById("faqAnswer").style.backgroundColor="#f5f5f5";
            document.getElementById("faqAnswer").style.width="490px";                
            document.getElementById("faqAnswer").style.marginTop="10px";
            
            document.getElementById("faqAnswer").style.border="1px solid #489aa5";
            
            document.getElementById("faqAnswer").innerHTML=xmlHttp.responseText;       
          }
    }
      xmlHttp.send(null);
}   




function oppslagListeside($kategori,$offset,$pages) {
    var xmlHttp;
    try{  
        // Firefox, Opera 8.0+, Safari  
        xmlHttp=new XMLHttpRequest();  
    }
    catch (e){  
        // Internet Explorer  
        try{   
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");    
        }
          catch (e){    
              try{      
                  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");      
              }
            catch (e){
                return false;
            }    
          }  
    }
    
    var randomnumber=Math.floor(Math.random()*100);
    var gotourl = "ajax/kategoriside.php?kategori=" + escape($kategori) + "&offset=" + $offset + "&pages=" + $pages + "&rand="+randomnumber;
    xmlHttp.open("GET", gotourl, true);          
    xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlHttp.setRequestHeader("Accept-Charset", "iso-8859-1");
    
      xmlHttp.onreadystatechange = function(){
        var status1=200;
        try{
            status1=xmlHttp.status;}
        catch(e){
            status1=200;
        }
         
        if (xmlHttp.readyState == 4 && status1 == 200) {
            document.getElementById("ArticleList").innerHTML=xmlHttp.responseText;       
          }
    }
      xmlHttp.send(null);
}   



function tagListeside($tagChoice,$offset,$pages) {
    var xmlHttp;
    try{  
        // Firefox, Opera 8.0+, Safari  
        xmlHttp=new XMLHttpRequest();  
    }
    catch (e){  
        // Internet Explorer  
        try{   
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");    
        }
          catch (e){    
              try{      
                  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");      
              }
            catch (e){
                return false;
            }    
          }  
    }
    
    var randomnumber=Math.floor(Math.random()*100);
    var gotourl = "ajax/tag_sider.php?tag=" + escape($tagChoice) + "&offset=" + $offset + "&pages=" + $pages + "&rand="+randomnumber;
    xmlHttp.open("GET", gotourl, true);          
    xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlHttp.setRequestHeader("Accept-Charset", "iso-8859-1");
    
      xmlHttp.onreadystatechange = function(){
        var status1=200;
        try{
            status1=xmlHttp.status;}
        catch(e){
            status1=200;
        }
         
        if (xmlHttp.readyState == 4 && status1 == 200) {
            document.getElementById("ArticleList").innerHTML=xmlHttp.responseText;       
          }
    }
      xmlHttp.send(null);
}   
