
    	  // Global variables
    xMousePos = 0; // Horizontal position of the mouse on the screen
    yMousePos = 0; // Vertical position of the mouse on the screen
    xMousePosMax = 0; // Width of the page
    yMousePosMax = 0; // Height of the page
    
    function captureMousePosition(e) {
        if (document.layers) {
            xMousePos = e.pageX;
            yMousePos = e.pageY;
            xMousePosMax = window.innerWidth+window.pageXOffset;
            yMousePosMax = window.innerHeight+window.pageYOffset;

            mouse_y = yMousePos - 120;
    		document.getElementById('meter').style.top = mouse_y+'px;';
        } else if (document.all) {
        	if (document.documentElement) {
	            xMousePos = window.event.x+document.documentElement.scrollLeft;
	            yMousePos = window.event.y+document.documentElement.scrollTop;
	            xMousePosMax = document.body.clientWidth+document.documentElement.scrollLeft;
	            yMousePosMax = document.body.clientHeight+document.documentElement.scrollTop;
        	} else {
 	            xMousePos = window.event.x+document.body.scrollLeft;
	            yMousePos = window.event.y+document.body.scrollTop;
	            xMousePosMax = document.body.clientWidth+document.body.scrollLeft;
	            yMousePosMax = document.body.clientHeight+document.body.scrollTop;       		
        	}

			var element = document.getElementById('meter');

			mouse_y = yMousePos - 120;
    		element.style.top = mouse_y;
        } else if (document.getElementById) {
            xMousePos = e.pageX;
            yMousePos = e.pageY;
            xMousePosMax = window.innerWidth+window.pageXOffset;
            yMousePosMax = window.innerHeight+window.pageYOffset;

            mouse_y = yMousePos - 120;
    		document.getElementById('meter').style.top = mouse_y+'px';
        }
}


function validate_offer(){
	var valid = new Validation('offer_form', {onSubmit:true});
    var result = valid.validate();
}

function print_offer(){
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open('/nl/offerte/print_offerte', '" + id + "', 'toolbar=0,scrollbars=auto,location=0,statusbar=0,menubar=0,resizable=1,width=740, height=530');");
}

/* Faq
   Open and close functions
*/
var open_question_div = '';
var open_answer_div = '';

function open_faq(question_div, answer_div){
	if(open_answer_div == answer_div){
		$(question_div).className  = 'faq_question';
		$(answer_div).style.display = 'none';
		open_answer_div = '';
		open_question_div = '';
	}else{
		$(question_div).className = 'faq_question_open';
		$(answer_div).style.display = 'block';

		if(open_answer_div != '' && open_question_div != ''){
			$(open_answer_div).style.display = 'none';
			$(open_question_div).className = 'faq_question';
		}

		open_answer_div = answer_div;
		open_question_div = question_div;
	}
}
