﻿
function showImage() {
    var theImages = new Array();
    theImages[0] = 'header_contact.jpg';
    theImages[1] = 'header_assortimentsoverzicht.jpg';
    theImages[2] = 'header_internationaal.jpg';
    theImages[3] = 'header_klant worden.jpg';
    theImages[4] = 'header_nieuws.jpg';
    theImages[5] = 'header_over cef.jpg';
    theImages[6] = 'header_samenwerken met cef.jpg';
    theImages[7] = 'header_service.jpg';
    theImages[8] = 'header_vacatures.jpg';
    theImages[9] = 'header_verkoopvoorwaarden.jpg';
    theImages[10] = 'header_vestigingen.jpg';
    theImages[11] = 'header_informatie.jpg';
    var j = 0;
    var p = theImages.length;
    var preBuffer = new Array();

    for (i = 0; i < p; i++) {
        preBuffer[i] = new Image();
        preBuffer[i].src = theImages[i];
    }
    var whichImage = Math.round(Math.random() * (p - 1));
    document.write('<img src="../SiteContent/Banners homepage/' + theImages[whichImage] + '">');
}

function openwindow(file,name)
{
	window.open(file,name,height=255,width=250,
			 toolbar=no,directories=no,status=no,menubar=no,
			 scrollbars=no,resizable=no); 
}	

function maximize() {
    document.getElementById("max").style.display = "none";
    document.getElementById("res").style.display = "";
    showhide("");
}

function restore() {
    document.getElementById("max").style.display = "";
    document.getElementById("res").style.display = "none";
    showhide("none");
}

function showhide(show) {
    for (var i = 8; i < 35; i++)
        if (document.getElementById("tablerow" + i) != null)
        document.getElementById("tablerow" + i).style.display = show;
}

function focusselect(id) {
    var elm = document.getElementById(id);
    elm.focus();
    elm.select();
}

function cart() {
    document.getElementById('shoppingcart').submit();
}

function list() {
    document.getElementById('shoppinglist').submit();
}

function avail() {
    document.getElementById('availability').submit();
}


function popup(page, name, options) {
    if (options == null)
        options = 'width=650,height=600,top=25,left=25,location=no,toolbar=no,directories=no,status=no,scrollbars=yes,resize=no,menubar=no'
    window.open(page, name, options);
}

function bookmark(url, title) {
    if (window.external) {
        window.external.AddFavorite(url, title);
    }
}

function homepage(url) {
    document.body.style.behavior = "url(#default#homepage)";
    document.body.setHomePage(url);
}

function trim(value) {
    return value.replace(/^\s*|\s*$/g, "");
}

function IsNumeric(input) {
    return (input - 0) == input && input.length > 0;
}

function maxLineCount(lines) {
    if (IsNumeric(lines.value)) {
        if (lines.value > 30) {
            lines.value = 10;
            alert("Waarde moet onder de 30 liggen.");
        }
    }
    else {
        lines.value = 10;
        alert("Alleen numerieke waardes zijn toegestaan.");
    }
}

