function popup(area,header,dir) {
var editarea = tinyMCE.get(area).getContent();
var newurl = '<a href="http://exploris.net84.net/downloads/';
var editarea = editarea.replace(/<a href=\"downloads\//g,newurl);
var newurl = '<img src="http://exploris.net84.net/images/'+dir+'/';
var editarea = editarea.replace(/<img src=\"/g,newurl);
	width=770;
	height=500;
	var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
    var windowFeatures = "scrollbars=1," + "width=" + width + ",height=" + height + ",left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
    var newwindow = window.open("", "preview", windowFeatures);
	newwindow.focus()
	newwindow.document.write('<html><head><title>Preview</title><link rel="stylesheet" type="text/css" href="menu.css" /></head><body style="background-color: #fff"><div id="center" class="editpages"><h1 style="color: #f00">PREVIEW - CHANGES ARE NOT SAVED YET</h1><h1>'+header+'</h1>'+editarea+'</div></div></body></html>');
	newwindow.document.close()
	return false;
}

function tradedivs(a,b) {
document.getElementById(a).style.display = "none";
document.getElementById(b).style.display = "";
}