	
	function fjsAddToList(prodId)
		{
		    var strList = "";
		    strList = getCookie("JuvelenListe");
		  
		    if (strList.length > 0) 
		    {
		       var strValue = "";
		       strValue = strList.valueOf();
		       if (strValue.toString().match(',' + prodId + ','))
		       {
		        alert("Produktet finnes alt i ønskelisten.");
		       }
		       else
		       { 
		           strValue += prodId + ",";
		          setCookie( 'JuvelenListe', strValue, '', '/', '', '' );
		       }
		    }
		    else
		    {
		        setCookie( 'JuvelenListe', ',' + prodId + ",", '', '/', '', '' );
		    }
		    fjsLoadWishListBasket();
		}
		
		function fjsRemoveFromList(prodId)
		{
		    var strList = "";
		    strList = getCookie("JuvelenListe");
		    
		    if (strList.length > 0) 
		    {
		       var strValue = "";
		       strValue = strList.valueOf();
		       var temp = strValue;
		       if (strValue.toString().match(',' + prodId + ','))
		       {
		            strValue = strValue.toString().replace(',' + prodId + ',',',');
		            setCookie( 'JuvelenListe', strValue, '', '/', '', '' );
		            document.getElementById('Item_' + prodId).style.display = 'none';
		       }
		    }
		    fjsLoadWishListBasket();
		}
		

        function setCookie( name, value, expires, path, domain, secure )
        {
            // set time, it's in milliseconds
            var today = new Date();
            today.setTime( today.getTime() );

            /*
            if the expires variable is set, make the correct
            expires time, the current script below will set
            it for x number of days, to make it for hours,
            delete * 24, for minutes, delete * 60 * 24
            */
            if ( expires )
            {
            expires = expires * 1000 * 60 * 60 * 24;
            }
            var expires_date = new Date( today.getTime() + (expires) );

            document.cookie = name + "=" +escape( value ) +
            ( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
            ( ( path ) ? ";path=" + path : "" ) +
            ( ( domain ) ? ";domain=" + domain : "" ) +
            ( ( secure ) ? ";secure" : "" );
        }



		
		function getCookie(c_name)
        {
            if (document.cookie.length>0)
              {
              c_start=document.cookie.indexOf(c_name + "=");
              if (c_start!=-1)
                {
                c_start=c_start + c_name.length+1;
                c_end=document.cookie.indexOf(";",c_start);
                if (c_end==-1) c_end=document.cookie.length;
                return unescape(document.cookie.substring(c_start,c_end));
                }
              }
            return "";
        }
        
        function fjsLoadWishListBasket()
        {
            var strList = getCookie("JuvelenListe");
            var numbersOfWishes = strList.toString().split(',').length;
            numbersOfWishes = numbersOfWishes - 2;
            if (numbersOfWishes<=0)
            {
                numbersOfWishes = 0;
                //document.getElementById("WishListBasket").style.display = 'none';
            }
           /* else
            {
               document.getElementById("WishListBasket").style.display = 'block';
            }*/
            document.getElementById("numberOfWishes").innerHTML = numbersOfWishes;
        }
        
        function fjsSubmitWishForm()
        {
          var ok;
			var msg = "Fyll ut følgende felt: \n";
			ok = true;
			if (document.getElementById("strEpost").value.length == 0)
			{
				ok = false;
				msg += "Til e-post:" + "\n";
			}
			if (document.getElementById("strName").value.length == 0)
			{
				ok = false;
				msg += "Navn:" + "\n";
			}
			if (document.getElementById("strYourMail").value == 0)
			{
				ok = false;
				msg += "Din e-post:" + "\n";
			}
			
			if (ok == true)
			{
				document.getElementById("frmWishList").submit();
			}
			else
			{
				alert(msg);
			}
        }