function showPopup(title, body, size){
		var oDiv = document.createElement('div')
		oDiv.innerText = body
		var height = 200
		var width = 350
		
		if(size=='small'){
			height = 200
			width = 350
		}else if(size=='medium'){
			height = 300
			width = 550
		}
		
		$(oDiv).dialog({
				title: title
				, modal: true
				, resizable: false
				, draggable: true
				, height: height
				, width: width
				, buttons: {
						'ok': function() {
							$(this).dialog('destroy');
						}
				}
		})
}

$(window).load(function () {
	
	var page = document.location.protocol + '//' + document.location.host + document.location.pathname

	$.getJSON('http://store.gepu.nl/popup.xml.asp?callback=?&	req=popups&page=' + page , function(data) {
		if(data){
			$.each(data.records, function(key, val) {
				showPopup(val.title, val.message, val.size)
			});
		}

	})

});

