function OpenModalOrderFrm(id) {
    var modal_bg = $('modal_bg');
    var modal_wrap = $('modal_win');
    var viewport = $(window).getSize();
    var win_height = $(window).getScrollHeight();
    var wrapsize = $('modal_win').getSize();
    var scrollTop = document.body.scrollTop;
    if (scrollTop == 0) {
        if (window.pageYOffset)
            scrollTop = window.pageYOffset;
        else
            scrollTop = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0;
    }

    
    var req = new Request.HTML({url:'/include/ajax/ajax.load.order.form.php?mid=' + id, 
		onSuccess: function(html) {
			//Clear the text currently inside the results div.
			$('modal_win').set('text', '');
			//Inject the new DOM elements into the results div.
			$('modal_win').adopt(html);
		},
		//Our request will most likely succeed, but just in case, we'll add an
		//onFailure method which will let the user know what happened.
		onFailure: function() {
			$('modal_win').set('text', 'Er is een fout opgetreden bij het ophalen van het bestelformulier.');
		}
	});
    req.send();
    modal_bg.setStyle('display', 'block');
    modal_bg.setStyle('visibility', 'visible');
    modal_bg.setOpacity(0.5);
    modal_bg.setStyle('height', win_height);
    modal_wrap.setOpacity(1.0);
    modal_wrap.setStyles({
            display: 'block',
            visibility: 'visible',
            width: 400,
            height: 275,
            position: 'absolute',
            left: (viewport.x/2)-200,
            top: scrollTop+160,
            background: '#000',
            'z-index': 1000
    });
}

function UpdateModalOrderForm(id, cid) {
	 var req = new Request.HTML({url:'/include/ajax/ajax.load.order.form.php?mid=' + id + '&cid=' + cid, 
		onSuccess: function(html) {
			//Clear the text currently inside the results div.
			$('modal_win').set('text', '');
			//Inject the new DOM elements into the results div.
			$('modal_win').adopt(html);
		},
		//Our request will most likely succeed, but just in case, we'll add an
		//onFailure method which will let the user know what happened.
		onFailure: function() {
			$('modal_win').set('text', 'Er is een fout opgetreden bij het ophalen van het bestelformulier.');
		}
	});
    req.send();
}
