﻿

/*****************************************
  JS-kod för aktuell sida
/*****************************************/

function ShowHide(ID) 
{
    if($(ID).className=='SMContainerShow')
    {
        $(ID).className='SMContainerHide';
    }
    else
    {
        $(ID).className='SMContainerShow';
    }

}

/******************************************************************* 
  Månadens doft
/*******************************************************************/

function ShowFaktura() 
{
    hideDocumentElement('tblCart');
    showDocumentElement('tblFaktura');
}

function ShowCart() 
{
    hideDocumentElement('tblFaktura');
    showDocumentElement('tblCart');
}

/******************************************************************* 
  CARTFLASH
/*******************************************************************/

var secs
var timerID = null
var timerRunning = false
var delay = 1000

function InitializeTimer(ID)
{
    // Set the length of the timer, in seconds
    secs = 1
    StopTheClock()
    StartTheTimer()

    document.getElementById('QtyBox').className='QtyBoxHighlight';
    //document.aspnetForm.dvcart.style.color="Red";
}

function StopTheClock()
{
    if(timerRunning)
    clearTimeout(timerID)
    timerRunning = false
}

function StartTheTimer()
{
    if (secs==0)
    {
        StopTheClock()
        
        document.getElementById('QtyBox').className='QtyBoxNorm';

    }
    else
    {
        secs = secs - 1
        timerRunning = true
        timerID = self.setTimeout("StartTheTimer()", delay)
    }
   
}
