preview.html
<!--
freeText('title')?>
headerStuff()?>
//function to fix height of iframe!
var calcHeight = function() {
var headerDimensions = $('#header-bar').height();
$('#preview-frame').height($(window).height() - headerDimensions);
}
$(document).ready(function() {
calcHeight();
$('#header-bar a.close').mouseover(function() {
$('#header-bar a.close').addClass('activated');
}).mouseout(function() {
$('#header-bar a.close').removeClass('activated');
});
});
$(window).resize(function() {
calcHeight();
}).load(function() {
calcHeight();
});
var qstring = window.location.search.substring(1);
var redir = qstring.substr(qstring.indexOf('=')+1,qstring.length,qstring);
if( redir.length>0 && redir.indexOf("http")==-1 ) {
document.getElementById("preview-frame").src=redir;
document.getElementById("close").href=redir;
}
else {
document.getElementById("preview-frame").src="/404.html"
}