﻿
function ShowRssInfo()
{
    document.getElementById("rssInfoPanel").style.visibility = "visible";
}

function HideRssInfo()
{
    document.getElementById("rssInfoPanel").style.visibility = "hidden";
}


function OpenPrintWindow(id)
{
    var url = "SkrivutArtikel.aspx?id=" + id;
	window.open(url, 'print','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=1,width=700,height=400');
}

function OpenMailWindow(id)
{
    var url = "TipsaArtikel.aspx?id=" + id;
	window.open(url, 'mail','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=1,width=380,height=400');
}

function DeleteArticle()
{
	document.form1.onsubmit=function(){
        document.form1.onsubmit = ""; //clears the "onsubmit" method - so the "spara" button works later on.

        if (confirm("Är du säker på att du vill ta bort den här nyheten/produktnyheten??"))
            return true;
        else
            return false;
    }        
  
}


function getParameter ( queryString, parameterName ) {
   // Add "=" to the parameter name (i.e. parameterName=value)
   var parameterName = parameterName + "=";

   if ( queryString.length > 0 ) {
      // Find the beginning of the string
      begin = queryString.indexOf ( parameterName );
      // If the parameter name is not found, skip it, otherwise return the value
      if ( begin != -1 ) {
         // Add the length (integer) to the beginning
         begin += parameterName.length;
         // Multiple parameters are separated by the "&" sign
         end = queryString.indexOf ( "&" , begin );
      if ( end == -1 ) {
         end = queryString.length
      }
      // Return the string
      return unescape ( queryString.substring ( begin, end ) );
   }
   // Return "null" if no parameter has been found
   return "null";
   }
}
