[NAME]
OE Preview Pane

[AUTHOR]
Konstantin Zadorozhny

[COMMENT]
OE Preview Pane replacement

Warning!
This skin required scripting features to be enabled. It could affect security.

To make this skin working property, please check following options:

1.	"Tools -> Options -> Security: (X) Internet Zone"
2.	If "FL Bar -> Misc -> DocHost: [X] Enable Controlling", be sure "[ ] No Scripts" unchecked.
3.	If "FL Bar -> Templates -> General: [X] Show X-Face", check "[X] Float" for X-Face. 
    When this option is not checked all message body disappears. 
4.  If "FL Bar -> Templates -> General: [ ] Do not use templates for messages in HTML format", 
    do not use option "HTML view format: ( ) HTML frame",
5.  Settings "FL Bar -> Templates -> General: Web Page Options..." do not take any effect for 
    message view. To change text margins you have to modify css style "DIV.#msg_body padding".


[HEADER]


<SCRIPT LANGUAGE="JavaScript">
	document.body.scroll = 'no';
	document.body.style.margin = 0;
	// xface
	var imgXFace; // to store xFace image object
	var n = document.images[0];  
	if (n && n.src.match(/XFace.bmp$/)) {
		imgXFace = n.removeNode();
	}
</SCRIPT>
<SCRIPT FOR="window" EVENT="onfocus" LANGUAGE="JavaScript">
var mb = document.all.msg_body;
if (mb && mb.setActive) {
	mb.setActive();
}
</SCRIPT>
<STYLE TYPE="text/css">

#from_info, #to_info {
	position: absolute;
	visibility: hidden;	
	z-index: 1;
	background-color: infobackground;
	font-family: 'MS Shell Dlg';
	font-size: 8pt;
	padding: 1pt 10pt 1pt 10pt;
	border: 1px solid windowframe;
}
DIV.#msg_body {
	overflow: auto; 
	height: expression(document.body.clientHeight - document.all.msg_body.offsetTop);
	width: 100%;
	padding: 7.5pt;
	border: expression((document.activeElement == document.all.msg_body)?'1px inset':'1px solid threedface');
}
TABLE.#head {
	background-color: threedface;
	border-width: 1px;
	border-style: solid; 
	border-left-color: threedhighlight;
	border-bottom-color: threedshadow;
	border-right-color: threedshadow;
	font-family: 'MS Shell Dlg';
	font-size: 8pt;
	cursor: default;
}
TABLE.#head TD {
	font-family: 'MS Shell Dlg';
	font-size: 8pt;
}
#tearline, #origin {
	color: graytext;
}
A.btn {
	border: 1px solid;  
	padding: 1pt 5pt 1pt 5pt;
	border-color: expression(this.checked?'threeddarkshadow threedhighlight threedhighlight threeddarkshadow':'threedshadow');
	display: inline-block;
	background-color: expression(this.checked?'threedshadow':'transparent');
	color: expression(this.checked?'highlighttext':'windowtext');
	text-decoration: none;
}

A.btn:hover {
	border-color: expression(this.checked?'threedshadow threedlightshadow threedlightshadow threedshadow':'threedhighlight threeddarkshadow threeddarkshadow threedhighlight');
}
</STYLE>

<SPAN ID="from_info" ONMOUSEOVER="showInfo('from')" ONMOUSEOUT="hideInfo('from')">
        <B>Address</B>:&nbsp; 
        %if(%ffidoem)%then(
                %htmlschrs(%ffidoem)
        )%else(
                %htmlschrs(%faddreml(From))
        )
        %if(%fhdrf(X-FTN-REPLYADDR))%then(
                &nbsp;&nbsp;<B>FTN Reply To</B>:&nbsp; %htmlschrs(%faddreml(X-FTN-REPLYADDR))
        )
        %if(%fhdrf(Reply-To))%then(
                &nbsp;&nbsp;<B>Reply To</B>:&nbsp; %htmlschrs(%faddreml(Reply-To))
        )
        %if(%fhdrf(X-FTN-RealName))%then(
                <BR/>
                <B>RealName</B>:&nbsp; %fhdrf(X-FTN-RealName)
        )
        %if(%fhdrf(Organization))%then(
                <BR/>
                <B>%if(%ffidoem)%then(Origin)%else(Organization)</B>:&nbsp; %htmlschrs(%fhdrf(Organization))
        )
        <BR/>
        <B>User-Agent</B>:&nbsp; 
        %if(%fhdrf(FL-Build))%then(%fhdrf(FL-Build))%else(
        %if(%fhdrf(X-Mailer))%then(%fhdrf(X-Mailer))%else(
        %if(%fhdrf(X-Newsreader))%then(%fhdrf(X-Newsreader))%else(
        %if(%fhdrf(User-Agent))%then(%fhdrf(User-Agent))%else(
        %if(%ftrln)%then(%ftrln)%else(N.A.)
        ))))

</SPAN>

<SPAN ID="to_info" ONMOUSEOVER="showInfo('to')" ONMOUSEOUT="hideInfo('to')">
	<B>Address: </B>
	%if(%faddreml(X-Comment-To))%then(
		%htmlschrs(%faddreml(X-Comment-To))
	)%else(%if(%faddreml(To))%then(
		%htmlschrs(%faddreml(To))
	)%else(N.A.))
	</BR>
</SPAN>

<SCRIPT LANGUAGE="JavaScript">

function getElementRect(e) {
		var top = 0; 
		var left = 0;
		var ce = e;
		while (ce && ce.offsetParent) {
			top += ce.offsetTop;
			left += ce.offsetLeft;
      ce = ce.offsetParent;
    }
		var r = new Object();
		r.top = top;
		r.bottom = top+e.offsetHeight;
		r.left = left; 
		r.right = left+e.offsetWidth; 
		return r;
}

function showInfo (infoId) {
	var field = document.all[infoId];
	var info = document.all[infoId+'_info'];
	if (field && info) {
		var r = getElementRect(field);
		if (r) {
			info.style.pixelTop = r.bottom;
			info.style.pixelLeft = r.left;
			info.style.visibility = 'visible';
		}
	}
}

function hideInfo (infoId) {
	var info = document.all[infoId+'_info'];
	if (info) {
		info.style.visibility = 'hidden';
	}
}

function fixedFont (cbFixed) {
	var mb = document.all.msg_body;
	cbFixed.checked = !cbFixed.checked;
	if (cbFixed.checked) {
		mb.style.fontFamily = 'courier new';
	} else {
		mb.style.fontFamily = '';
	}
}
</SCRIPT>

<TABLE ID="head" WIDTH="100%" CELLSPACING="1" CELLPADDING="0">
	<TR>
		<TD STYLE="padding-left: 2pt; padding-top: 1pt; padding-bottom: 1pt;">
			<SPAN ID="from" ONMOUSEOVER="showInfo(this.id)" ONMOUSEOUT="hideInfo(this.id)">
				<B>From: </B> %htmlschrs(%faddrname(From))
			</SPAN>
			%if(%farea)%then(
			&nbsp;
			<SPAN ID="group">
				<B>Area: </B> %htmlschrs(%farea)
			</SPAN>
			)%else(%if(%fngrp)%then(
			&nbsp;
			<SPAN ID="group">
				<B>Group: </B> %htmlschrs(%fngrp)
			</SPAN>
			))
			&nbsp;
			<SPAN ID="to" ONMOUSEOVER="showInfo(this.id)" ONMOUSEOUT="hideInfo(this.id)"> 
				<B>To: </B>
				%if(%fhdrf(X-Comment-To))%then(
					%htmlschrs(%faddrname(X-Comment-To))
				)%else(%if(%fhdrf(To))%then(
					%htmlschrs(%faddrname(To))
				)%else(All))
			</SPAN>
		</TD>
		<TD ALIGN="right" STYLE="text-transform: capitalize; padding-right: 2pt;">
			%fdate
		</TD>                              
	</TR>
	<TR>
		<TD STYLE="padding-left: 2pt;">
			<B>Subject: </B> %htmlschrs(%fhdrf(Subject))
		</TD>
		<TD ALIGN="right" STYLE="padding-right: 2pt;">
			<A CLASS="btn" HREF="" ONCLICK="fixedFont(this); return false;">Fixed Font</A>
		</TD>
	<TR>
</TABLE>

<DIV ID="msg_body">
<SCRIPT LANGUAGE="JavaScript">
// insert XFace image
if (imgXFace) {
	document.all.msg_body.insertBefore(imgXFace);
}
</SCRIPT>


[FOOTER]
<DIV ID="tearline">
---&nbsp;
%if(%ftrln)%then(%ftrln)%else(
%if(%fhdrf(FL-Build))%then(%fhdrf(FL-Build))%else(
%if(%fhdrf(X-Mailer))%then(%fhdrf(X-Mailer))%else(
%if(%fhdrf(X-Newsreader))%then(%fhdrf(X-Newsreader))%else(
%if(%fhdrf(User-Agent))%then(%fhdrf(User-Agent))
))))
</DIV>
<DIV ID="origin">
* Origin: %if(%forig)%then(%forig)%else(
%if(%forga)%then(%forga)%else(
%if(%fhost)%then(%fhost))
)
</DIV>

<!-- for ID="msg_body" -->
</DIV>
