3 window
.isMSIE55
= ( window
.showModalDialog
&& window
.clipboardData
&& window
.createPopup
);
4 window
.doneIETransform
= undefined;
5 window
.doneIEAlphaFix
= undefined;
7 window
.hookit = function() {
8 if ( !doneIETransform
&& document
.getElementById
&& document
.getElementById( 'bodyContent' ) ) {
9 doneIETransform
= true;
15 if ( document
.attachEvent
) {
16 document
.attachEvent( 'onreadystatechange', window
.hookit
);
19 // png alpha transparency fixes
20 window
.fixalpha = function( logoId
) {
22 if ( isMSIE55
&& !doneIEAlphaFix
) {
23 var plogo
= document
.getElementById( logoId
|| 'p-logo' );
28 var logoa
= plogo
.getElementsByTagName('a')[0];
33 var bg
= logoa
.currentStyle
.backgroundImage
;
34 var imageUrl
= bg
.substring( 5, bg
.length
- 2 );
36 doneIEAlphaFix
= true;
38 if ( imageUrl
.substr( imageUrl
.length
- 4 ).toLowerCase() == '.png' ) {
39 var logospan
= logoa
.appendChild( document
.createElement( 'span' ) );
41 logoa
.style
.backgroundImage
= 'none';
42 logospan
.style
.filter
= 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=' + imageUrl
+ ')';
43 logospan
.style
.height
= '100%';
44 logospan
.style
.position
= 'absolute';
45 logospan
.style
.width
= logoa
.currentStyle
.width
;
46 logospan
.style
.cursor
= 'hand';
47 // Center image with hack for IE5.5
48 if ( document
.documentElement
.dir
== 'rtl' ) {
49 logospan
.style
.right
= '50%';
50 logospan
.style
.setExpression( 'marginRight', '"-" + (this.offsetWidth / 2) + "px"' );
52 logospan
.style
.left
= '50%';
53 logospan
.style
.setExpression( 'marginLeft', '"-" + (this.offsetWidth / 2) + "px"' );
55 logospan
.style
.top
= '50%';
56 logospan
.style
.setExpression( 'marginTop', '"-" + (this.offsetHeight / 2) + "px"' );
58 var linkFix
= logoa
.appendChild( logoa
.cloneNode() );
59 linkFix
.style
.position
= 'absolute';
60 linkFix
.style
.height
= '100%';
61 linkFix
.style
.width
= '100%';
71 // fix ie6 disappering float bug
72 window
.relativeforfloats = function() {
73 var bc
= document
.getElementById( 'bodyContent' );
75 var tables
= bc
.getElementsByTagName( 'table' );
76 var divs
= bc
.getElementsByTagName( 'div' );
77 setrelative( tables
);
82 window
.setrelative = function( nodes
) {
84 while ( i
< nodes
.length
) {
85 if( ( ( nodes
[i
].style
.float && nodes
[i
].style
.float != ( 'none' ) ||
86 ( nodes
[i
].align
&& nodes
[i
].align
!= ( 'none' ) ) ) &&
87 ( !nodes
[i
].style
.position
|| nodes
[i
].style
.position
!= 'relative' ) ) )
89 nodes
[i
].style
.position
= 'relative';
95 // Expand links for printing
96 String
.prototype.hasClass = function( classWanted
) {
97 var classArr
= this.split(/\s/);
98 for ( var i
= 0; i
< classArr
.length
; i
++ ) {
99 if ( classArr
[i
].toLowerCase() == classWanted
.toLowerCase() ) {
106 window
.expandedURLs
= undefined;
108 window
.onbeforeprint = function() {
111 var contentEl
= document
.getElementById( 'content' );
114 var allLinks
= contentEl
.getElementsByTagName( 'a' );
116 for ( var i
= 0; i
< allLinks
.length
; i
++ ) {
117 if ( allLinks
[i
].className
.hasClass( 'external' ) && !allLinks
[i
].className
.hasClass( 'free' ) ) {
118 var expandedLink
= document
.createElement( 'span' );
119 var expandedText
= document
.createTextNode( ' (' + allLinks
[i
].href
+ ')' );
120 expandedLink
.appendChild( expandedText
);
121 allLinks
[i
].parentNode
.insertBefore( expandedLink
, allLinks
[i
].nextSibling
);
122 expandedURLs
[i
] = expandedLink
;
128 window
.onafterprint = function() {
129 for ( var i
= 0; i
< expandedURLs
.length
; i
++ ) {
130 if ( expandedURLs
[i
] ) {
131 expandedURLs
[i
].removeNode( true );