
function CallMe(callid, phoneInput)
{
    pageTracker._trackPageview('/outgoing/ringmeg.aspx');
    var id = callid;
    var phoneNumber;
    if(id == '' || id == undefined)
        id = document.getElementById('callid').value;
    if(phoneInput == '' || phoneInput == undefined)
        phoneNumber = document.getElementById('callnumber').value;
    else
        phoneNumber = document.getElementById(phoneInput).value;
        
    window.open('http://dispatch.netconnect.no/mlcall.exe?id=' + id + '&cn=' + phoneNumber, 'callme','left=300,top=300,toolbar=false,status=yes,directories=false,menubar=false,scrollbars=false,resizable=false,copyhistory=false,width=500,height=300');
    //window.open('http://www.itum.no?id=' + id + '&cn=' + phoneNumber, 'callme','left=300,top=300,toolbar=false,status=yes,directories=false,menubar=false,scrollbars=false,resizable=false,copyhistory=false,width=500,height=300');
    return false;
}

function swapImage(theImage, ImageToShow)
{
    theImage.src = '/images/spv/' + ImageToShow;
}
function swapClass(theObject, ClassToShow)
{
    theObject.className = ClassToShow;
}

function linkToNetbankPrivat()
{
    pageTracker._trackPageview('/outgoing/nettbank-privat.aspx');
    window.open('https://nettbank.edb.com/Logon/index.jsp?domain=3625&to_page=https://nettbank.edb.com/payment/transigo/logon/done&from_page=http://www.spv.no');
}

function linkToNetbankBedrift()
{
    pageTracker._trackPageview('/outgoing/nettbank-bedrift.aspx');
    window.open('https://nettbedriften.edb.com/cpsnbg2/index.jsp?bankid=3601&grp=all&lang=no/logon/done&from_page=http://www.spv.no');
}
function linkToKundeservice()
{
    location.href='/kontakt-oss/ring-meg.aspx';
}

function renderFlash(teaserId)
{
	var flashvars = {};
	flashvars.myXMLPath = "/webforms/flashxml.aspx?id=" + teaserId;
	var params = {};
	var attributes = {};
	swfobject.embedSWF("/flash/SparebankenVest01.swf", "myAlternativeContent", "490", "236", "9.0.0", false, flashvars, params, attributes);
}

function dropdownboxlink(box)
{   
    location.href = box.value;
}

function submitOnEnter(textbox, buttonId)
{
    if(textbox.value != '')
    {
        if(event.which || event.keyCode)
        {
            if ((event.which == 13) || (event.keyCode == 13)) 
            {
                document.getElementById(buttonId).focus();
                return false;
            }
        }
        else 
        {
            return true;
        }
    }
    return false;
}

function printMe() {
    pageTracker._trackPageview('/outgoing/print.aspx');
    window.print();
}

function checkMaxLength(control, len) {
    if (window.event.keyCode != 9) {
        if (control.value.length > len) {
            alert('Du kan ikke ha mer enn ' + len + ' tegn i dette feltet');
            control.value = control.value.substring(0, len);
            
        }
    }
    
}