function iframe_toggle(id) {
    var e = document.getElementById('iframe_'+id);
    var p = document.getElementById('preview_'+id);
	var hide = 0;
    if (e.style.display == 'block') {
		e.style.display = 'none';
		p.style.display = 'block';
		hide = 1;
    } else {
		e.style.display = 'block';
		p.style.display = 'none';
    }
    a = 0;
	return !hide;
}
a = 1;

function iframe_onload(id) {
    e = document.getElementById('iframe_'+id);
    /*
    e.height = e.contentWindow.document.height + 48; 
    
    //TODO : find proper way to get borders
    */
    if (e.contentDocument && e.contentDocument.body.offsetHeight) //ns6 syntax
	e.height = e.contentDocument.body.offsetHeight + 32;  
    else if (e.Document && e.Document.body.scrollHeight) //ie5+ syntax
	e.height = e.Document.body.scrollHeight + 32;
}