function clearValue(field_id, default_value){
	field = document.getElementById(field_id);
	if (field.value == default_value){
		field.value = '';
	}
	
}
function blurValue(field_id, default_value){
	field = document.getElementById(field_id);
	if(field.value.length == 0){
		field.value = default_value;
	}
}
function checkToDisable(value){
	if (value != "price"){
		document.getElementById('price').disabled = true;
		document.getElementById('price').className = 'pricedisabled';
	}else{
		document.getElementById('price').disabled = false;	
		document.getElementById('price').className = 'price';
	}
}

/*
 * Tooltip script 
 * powered by jQuery (http://www.jquery.com)
 *
 */
this.tooltip = function(){	
	/* CONFIG */		
		xOffset = 10;
		yOffset = 20;		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result		
	/* END CONFIG */		
	$("a.tooltip").hover(function(e){											  
		this.t = this.title;
		this.title = "";									  
		$("body").append("<p id='tooltip'>"+ this.t +"</p>");
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");		
    },
	function(){
		this.title = this.t;		
		$("#tooltip").remove();
    });	
	$("a.tooltip").mousemove(function(e){
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};

function formatAsMoney(mnt) {
    mnt -= 0;
    mnt = (Math.round(mnt*100))/100;
    value = (mnt == Math.floor(mnt)) ? mnt + '.00' 
              : ( (mnt*10 == Math.floor(mnt*10)) ? 
                       mnt + '0' : mnt);
	document.getElementById('price').value = value;	  
}

function filterForbidden(waarde){
	var forbidden = new Array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','Q','W','E','R','T','Y','U','I','O','P','A','S','D','F','G','H','J','K','L','Z','X','C','V','B','N','M','~','`','!','@','#','$','%','^','&','*','(',')','-','_','=','+','[',']','\\','}','{',';','\'',':','"','/','?','>','<');
	for(var i in forbidden){
		waarde = waarde.replace(forbidden[i], ''); 	
	}
	
	// replace
	waarde = waarde.replace(/,/, ".");
	
	document.getElementById('price').value = waarde;
}

function goTo(pre, varia, post){
	location = pre+varia+post;
	window.location = location;
	
}













