﻿//voorladen van de plaatjes
var foto1=new Image()
foto1.src="/images/logo_delonghi.jpg"// foto 1
var foto2=new Image()
foto2.src="/images/logo_gaggia.jpg"// foto 2
var foto3=new Image()
foto3.src="/images/logo_danesi.jpg"// foto 3
var foto4=new Image()
foto4.src="/images/logo_saeco.jpg"// foto 4
var foto5=new Image()
foto5.src="/images/logo_illy.jpg"// foto 5
var foto6=new Image()
foto6.src="/images/logo_arabier.jpg"// foto 6
var foto7=new Image()
foto7.src="/images/logo_rheavendors.jpg"// foto 7
var foto8=new Image()
foto8.src="/images/logo_spidem.jpg"// foto 8
var foto9=new Image()
foto9.src="/images/logo_turmix.jpg"// foto 9


<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->

var stap=1
var beeldnr=1
function overvloeier(){
    if (!document.images)
    return
    if (document.all)
    //slide.filters.blendTrans.apply()
    document.images.slide.src=eval("foto"+stap+".src")
    if (document.all)
    //slide.filters.blendTrans.play()
    beeldnr=stap
    if (stap<8)// aanpassen aan aantal plaatjes
    stap++
    else
    stap=1
    setTimeout("overvloeier()",4000)// de tijd tussen twee plaatjes in milliseconden
}
function overgang(){
    if (beeldnr==1)
    window.location="http://www.delonghi-products.net"
    else if (beeldnr==2)
    window.location="http://www.gaggia.com/index.asp"
    else if (beeldnr==3)
    window.location="http://www.danesi-caffe.com" 
    else if (beeldnr==4)
    window.location="http://www.saeco.be"
    else if (beeldnr==5)
    window.location="http://www.illy.com"
    else if (beeldnr==6)
    window.location="http://www.arabicaffe.com/arabica"
    else if (beeldnr==7)
    window.location="http://www.rheavendors.nl"
    else if (beeldnr==8)
    window.location="http://www.spidem.it"
    else if (beeldnr==9)
    window.location="http://www.turmix.ch"
    // bij meer foto's gewoon doornummeren
}

function PopupWindow(strURL,strName,strWidth,strHeight)
	{
	var hWindow;
	if (strWidth != '') {strWidth = 'width=' + strWidth ;}
	if (strHeight != '') {strHeight = 'Height=' + strHeight;} 
	hWindow = window.open(strURL , '', 'dependent=yes, hotkeys=no, titlebar=no, scrollbars=yes, fullscreen=no, channelmode=no, toolbar=no, location=no, directories=no, status=no, menubars=no, resizable=no,' + strWidth + ', ' + strHeight + ', top=150, left=70');
	}


function enableField()
	{
		document.getElementById('btnSubmit').style.visibility = "hidden";
		document.getElementById('cboCountry').style.visibility = "hidden";
		document.getElementById('Betalingsmethode').style.visibility= "hidden";
		return true;
}

function activetab(tab) {
    activetab1(tab);
    setTimeout("activetab1('" + tab + "')", 5);
}
function activetab1(tab) {

    var intTeller;
    var obj;
    var strtab;

    intTeller = 1;

    strtab = 'tab' + intTeller;
    while (getElementById_s(strtab) != null) {
        obj = getElementById_s(strtab);
        if (strtab == tab) {
            obj.className = 'showtab';
            //obj = getElementById_s(strtab + '_h');
            //obj.className = '1tabaktief';
            //obj = getElementById_s(strtab + '_image');
            //obj.src = '/images/' + strtab + '_ro.jpg';
        } else {
            obj.className = 'hiddentab';
            //obj = getElementById_s(strtab + '_h');
            //obj.className = '1tabgewoon';
            //obj = getElementById_s(strtab + '_image');
            //obj.src = '/images/' + strtab + '.jpg';
        }
        intTeller++;
        strtab = 'tab' + intTeller;
    }

    intTeller = 1;

    strtab = 'tab' + intTeller;
    while (getElementById_s(strtab) != null) {
        obj = getElementById_s(strtab);
        if (strtab == tab) {
            //obj.className = 'showtab';
            //obj = getElementById_s(strtab + '_h');
            //obj.className = '1tabaktief';
            document.images[strtab + '_image'].src = '/images/' + strtab + '_ro.jpg';
        } else {
            //obj.className = 'hiddentab';
            //obj = getElementById_s(strtab + '_h');
            //obj.className = '1tabgewoon';
            //obj = getElementById_s(strtab + '_image');
            document.images[strtab + '_image'].src = '/images/' + strtab + '.jpg';
        }
        intTeller++;
        strtab = 'tab' + intTeller;
    }
}

function getElementById_s(id) {
    var obj = null;
    if (document.getElementById) {
        /* Prefer the widely supported W3C DOM method, if
        available:-
        */
        obj = document.getElementById(id);
    } else if (document.all) {
        /* Branch to use document.all on document.all only
        browsers. Requires that IDs are unique to the page
        and do not coincide with NAME attributes on other
        elements:-
        */
        obj = document.all[id];
    }
    /* If no appropriate element retrieval mechanism exists on
    this browser this function always returns null:-
    */
    return obj;
}

//Load extern file in div
var loadedobjects = ""
var rootdomain = "http://" + window.location.hostname

function ajaxtabpage(url, containerid) {
    ajaxpage(url, containerid);
    activetab(containerid);
}

function ajaxpage(url, containerid) {
    document.getElementById(containerid).innerHTML = "<img src='/images/loading.gif' border=0>";
    var page_request = false;
    if (window.XMLHttpRequest) { // if Mozilla, Safari etc
        page_request = new XMLHttpRequest()
    }
    else if (window.ActiveXObject) { // if IE
        try {
            page_request = new ActiveXObject("Msxml2.XMLHTTP")
        }
        catch (e) {
            try {
                page_request = new ActiveXObject("Microsoft.XMLHTTP")
            }
            catch (e) { }
        }
    }
    else
        return false
    page_request.onreadystatechange = function() {
        loadpage(page_request, containerid)
    }
    page_request.open('GET', url, true)
    page_request.send(null)
}

function loadpage(page_request, containerid) {
    var rep;
    if (page_request.readyState == 4 && (page_request.status == 200 || window.location.href.indexOf("http") == -1)) {
        rep = page_request.responseText;
        document.getElementById(containerid).innerHTML = "";
        document.getElementById(containerid).innerHTML = "" + rep + "";
    }
}

function loadobjs() {
    if (!document.getElementById)
        return
    for (i = 0; i < arguments.length; i++) {
        var file = arguments[i]
        var fileref = ""
        if (loadedobjects.indexOf(file) == -1) { //Check to see if this object has not already been added to page before proceeding
            if (file.indexOf(".js") != -1) { //If object is a js file
                fileref = document.createElement('script')
                fileref.setAttribute("type", "text/javascript");
                fileref.setAttribute("src", file);
            }
            else if (file.indexOf(".css") != -1) { //If object is a css file
                fileref = document.createElement("link")
                fileref.setAttribute("rel", "stylesheet");
                fileref.setAttribute("type", "text/css");
                fileref.setAttribute("href", file);
            }
        }
        if (fileref != "") {
            document.getElementsByTagName("head").item(0).appendChild(fileref)
            loadedobjects += file + " " //Remember this object as being already added to page
        }
    }
}

function formsubmitting() {
    var breedte;
    var hoogte;
    var diameter;

    breedte = document.getElementById('objKettingzoeker_cboBreedte');
    hoogte = document.getElementById('objKettingzoeker_cboVerhouding');
    diameter = document.getElementById('objKettingzoeker_cboDiameter');

    if (breedte != null) { breedte.style.visibility = "hidden"; }
    if (hoogte != null) { hoogte.style.visibility = "hidden"; }
    if (diameter != null) { diameter.style.visibility = "hidden"; }
    
}