//  EN: Images preloading

function imgLoad() { count++; }

var count = 0, total=16;
var pictures = new Array();

pictures[0] = new Image(78,44); pictures[0].onload = imgLoad; pictures[0].src = "images/buttons/annonsera_norm.gif";
pictures[1] = new Image(78,44); pictures[1].onload = imgLoad; pictures[1].src = "images/buttons/annonsera_hover.gif";

pictures[2] = new Image(75,44); pictures[2].onload = imgLoad; pictures[2].src = "images/buttons/atthandla_norm.gif";
pictures[3] = new Image(75,44); pictures[3].onload = imgLoad; pictures[3].src = "images/buttons/atthandla_hover.gif";

pictures[4] = new Image(137,44); pictures[4].onload = imgLoad; pictures[4].src = "images/buttons/betalning_norm.gif";
pictures[5] = new Image(137,44); pictures[5].onload = imgLoad; pictures[5].src = "images/buttons/betalning_hover.gif";

pictures[6] = new Image(82,44); pictures[6].onload = imgLoad; pictures[6].src = "images/buttons/butikera-o_norm.gif";
pictures[7] = new Image(82,44); pictures[7].onload = imgLoad; pictures[7].src = "images/buttons/butikera-o_hover.gif";

pictures[8] = new Image(128,44); pictures[8].onload = imgLoad; pictures[8].src = "images/buttons/handlaviainternet_norm.gif";
pictures[9] = new Image(128,44); pictures[9].onload = imgLoad; pictures[9].src = "images/buttons/handlaviainternet_hover.gif";

pictures[10] = new Image(62,44); pictures[10].onload = imgLoad; pictures[10].src = "images/buttons/kontakt_norm.gif";
pictures[11] = new Image(62,44); pictures[11].onload = imgLoad; pictures[11].src = "images/buttons/kontakt_hover.gif";

pictures[12] = new Image(84,44); pictures[12].onload = imgLoad; pictures[12].src = "images/buttons/nyhetsbrev_norm.gif";
pictures[13] = new Image(84,44); pictures[13].onload = imgLoad; pictures[13].src = "images/buttons/nyhetsbrev_hover.gif";

pictures[14] = new Image(161,27); pictures[14].onload = imgLoad; pictures[14].src = "images/buttons/menuitem.gif";
pictures[15] = new Image(161,27); pictures[15].onload = imgLoad; pictures[15].src = "images/buttons/menuitem_hover.gif";


// EN: Rollovers events handlers

var btnFolder = "images/buttons/";

function vMenuNorm (e) {
    if (count != total) return;

    e.style.backgroundImage="url("+btnFolder+"menuitem.gif)";
    e.style.color="#606060";
}
function vMenuHover (e) {
    if (count != total) return;

    e.style.backgroundImage="url("+btnFolder+"menuitem_hover.gif)";
    e.style.color="#ffffff";
}

function chStyle (e, filename, color) {
    if (count != total) return;
    
    
    e.style.backgroundImage="url("+btnFolder+filename+")";
    e.style.color=color;	
}           

function chImage (e, filename) {
    if (count != total) return;
    
    e.src = btnFolder+filename;    
}


// EN: Resize image below left menu 

function resizeImg ()
{
    var hDifferense = 420;
    var ires = document.images["resizable"];
    var cont = document.getElementById("content");
    ires.height = parseInt(cont.clientHeight)-hDifferense;
}
