
// --------------------------------------------------- SRC scroll stuff --------------------------------------------------- //
function f_Scroll(v_step, v_contentid, v_num)
{
	var v_Content = document.getElementById(v_contentid);
	if(v_Content == null || v_num >= 49)
		return;
		
	if(parseInt(v_step)<0 && v_Content.style.top != "" && parseInt(v_Content.style.top) <= -5910)
		return;

	if(parseInt(v_step)>0 && (v_Content.style.top == "" || parseInt(v_Content.style.top) >= -33))
		return;

	if(v_Content.style.top != "")
		v_Content.style.top = parseInt(v_Content.style.top) + parseInt(v_step) + "px";
	else
		v_Content.style.top = parseInt(v_step) + "px";
		
	setTimeout("f_Scroll('" + v_step + "', '" + v_contentid + "', '" + (1 + parseInt(v_num)) + "')", parseInt(v_num) < 37 ? 2 : (parseInt(v_num) - 37)*3 + 2);
}

function f_ScrollUp(v_contentid)
{
	f_Scroll("-6", v_contentid, 0);
}

function f_ScrollDown(v_contentid)
{
	f_Scroll("6", v_contentid, 0);
}


// --------------------------------------------------- Price stuff --------------------------------------------------- //
function sum() 
{
    var s = 0;
    for (var i = 1; i <= 26; i++) 
    {
        var ch = document.getElementById("prItem" + i);
        if(ch == null || !ch.checked) continue;
        s += 1 * document.getElementById("prItem" + i).value;
    }
    document.getElementById("PriceSum").value = s;
}


// --------------------------------------------------- Funct stuff --------------------------------------------------- //
function InitFunct()
{
    for(var i = 1; ShowFunct(i, false); i++){}
}

function ShowFunct(index, show)
{
    var ex = document.getElementById("f_ex_" + index);
    var lb1 = document.getElementById("f_lb1_" + index);
    var lb2 = document.getElementById("f_lb2_" + index);
    if(ex == null || lb1 == null || lb2 == null) return false;
    
    if(show == null) show = ex.style.display == "none";
    
    if(show) for(var i = 1; ShowFunct(i, false); i++){}

    ex.style.display  = ( show ? "inline" : "none");
    lb1.style.display = (!show ? "inline" : "none");
    lb2.style.display = ( show ? "inline" : "none");
    return true;
}
