(
function
($){
var
isIE = !!window.ActiveXObject;
var
isIE6 = isIE && !window.XMLHttpRequest;
var
isIE8 = isIE && !!document.documentMode && (document.documentMode == 8);
var
isIE7 = isIE && !isIE6 && !isIE8;
if
(isIE6 || isIE7) {
$().ready(
function
(){
var
body = document.body;
var
BLANK_GIF;
if
(body.currentStyle.backgroundAttachment !=
"fixed"
) {
if
(body.currentStyle.backgroundImage ==
"none"
) {
body.runtimeStyle.backgroundImage =
"url("
+ BLANK_GIF +
")"
;
body.runtimeStyle.backgroundAttachment =
"fixed"
;
}
}
});
}
$.fn.extend({
toFixed:
function
(position){
var
isIE = !!window.ActiveXObject;
var
isIE6 = isIE && !window.XMLHttpRequest;
var
isIE8 = isIE && !!document.documentMode && (document.documentMode == 8);
var
isIE7 = isIE && !isIE6 && !isIE8;
if
(isIE6 || isIE7) {
}
else
{
return
this;
}
return
this.each(
function
(){
var
t = $(this);
var
id = t.get(0).id || 'fixed_' + parseInt(Math.rand() * 10000);
var
rect = {
w: t.width(),
h: t.height(),
l: t.css('left'),
r: t.css('right'),
't': t.css('top'),
b: t.css('bottom')
};
if
(rect.l != 'auto') {
rectl = parseInt(rect.l);
}
else
{
rectl = 0;
}
if
(rect.r != 'auto') {
rectr = parseInt(rect.r);
}
else
{
rectr = 0;
}
if
(rect.t != 'auto') {
rectt = parseInt(rect.t);
}
else
{
rectt = 0;
}
if
(rect.b != 'auto') {
rectb = parseInt(rect.b);
}
else
{
rectb = 0;
}
var
_pos = {
left: rect.l,
right: rect.r,
top: rect.t,
bottom: rect.b
};
_pos = $.extend(_pos, position);
var
css = t.attr('style') + ';';
css += 'position:absolute;bottom:auto;right:auto;clear:both;';
if
(rect.l != 'auto' && rect.r != 'auto')
css += 'width:expression(
eval
(document.compatMode && document.compatMode==\'CSS1Compat\') ? documentElement.clientWidth - ' + rectl + ' - ' + rectr + ' : document.body.clientWidth - ' + rectl + ' - ' + rectr + ' );';
if
(rect.l == 'auto' && rect.r != 'auto')
css += 'left:expression(
eval
(document.compatMode && document.compatMode==\'CSS1Compat\') ? documentElement.scrollLeft + (documentElement.clientWidth-this.clientWidth - ' + rectr + ') : document.body.scrollLeft +(document.body.clientWidth-this.clientWidth - ' + rectr + '));';
else
css += 'left:expression(
eval
(document.compatMode && document.compatMode==\'CSS1Compat\') ? documentElement.scrollLeft + ' + rectl + ' : document.body.scrollLeft + ' + rectl + ');';
if
(rect.t == 'auto' && rect.b != 'auto')
css += 'top:expression(
eval
(document.compatMode && document.compatMode==\'CSS1Compat\') ? documentElement.scrollTop + (documentElement.clientHeight-this.clientHeight - ' + rectb + ') : document.body.scrollTop +(document.body.clientHeight-this.clientHeight - ' + rectb + '));';
else
css += 'top:expression(
eval
(document.compatMode && document.compatMode==\'CSS1Compat\') ? documentElement.scrollTop + ' + rectt + ' : document.body.scrollTop + ' + rectt + ');';
t.attr('style', css);
});
}
});
})(jQuery);