Вот собственно код. Везде(во всех браузерах) отображаеться нормально. то есть содиржимое открываеться в том месте где находиться пользователь. При прокрутке вниз и вверх крутиться вместе сним. экран притемляет. А в эксплоере он отображаеться сверху, те на видимой части экрана и при прикруткеостаеться на своем месте
if(!sswgt_CartManager){
var sswgt_CartManager = {
'prefix': 'my_',
'mode': 'frame',
'add2cart': function(objA){
this.shop_url = objA.getAttribute('rel');
sizes = getPageSize();
this.show(objA.href+'&widgets=1', sizes[2]*0.7, sizes[3]*0.7);
return false;
},
'go2cart': function(objA){
this.shop_url = objA.getAttribute('rel');
sizes = getPageSize();
this.show(objA.href, sizes[2]*0.7, sizes[3]*0.7);
return false;
},
'_show': function(width, height){
this.hide(true);
hideSelectBoxes();
hideFlash();
this.div();
this.base();
if(this.mode == 'frame'){
this.frame(this.params.url, width, height);
}else if(this.mode == 'layer'){
this.layer(this.params.layer_id, width, height);
}
this.border(this.objMain);
this.closeButton(this.objBorder);
var old_onresize= window.onresize;
window.onresize = function(){
with(sswgt_CartManager){
if(!(objOverlay && objDiv)){return;}
var arrayPageSize = getPageSize();
objOverlay.style.width = arrayPageSize[2]+'px';
objOverlay.style.height = arrayPageSize[3]+'px';
objBase.style.width = arrayPageSize[2]+'px';
objBase.style.height = arrayPageSize[3]+'px';
if(sswgt_CartManager.mode == 'frame'){
sswgt_CartManager.frame(null, frameWidth, frameHeight);
}else{ if(sswgt_CartManager.mode == 'layer'){
this.layer(sswgt_CartManager.params.layer_id, frameWidth, frameHeight);
}}
border(sswgt_CartManager.objMain);
closeButton(objBorder);
};
if(old_onresize){old_onresize();}
};
var old_onkeydown = document.onkeydown;
document.onkeydown = function (event){
event = event?event:window.event;
if(event){
switch (event.keyCode ? event.keyCode : event.which ? event.which : null){
case 0x1B: sswgt_CartManager.hide();
}}
if(old_onkeydown){old_onkeydown();}
};
},
'showLayer': function(layer_id, width, height){
this.mode = 'layer';
this.params = {'layer_id': layer_id};
this._show(width, height);
showSelectBoxes();
},
'show': function(url, width, height){
this.mode = 'frame';
this.params = {'url': url};
//__DEBUG
//alert(url+'\n::\n'+this.shop_url);
this._show(width, height);
},
'resizeFrame': function(width, height){
if(width != null){this.frameWidth = width;}
if(height != null){this.frameHeight = height;}
this.frame(null, this.frameWidth, this.frameHeight);
this.border(this.objFrame);
this.closeButton(this.objBorder);
},
'div': function(){
this.objDiv = document.createElement('div');
setStyle(this.objDiv, 'zIndex:100; position: absolute; left:0; top: 0; background:url("n.gif") no-repeat; backgroundAttachment:fixed');
var objBody = document.getElementsByTagName("body").item(0);
objBody.appendChild(this.objDiv);
this.objDiv.style.backgroundAttachment = 'fixed';
},
'layer': function(layer_id, width, height){
var objLayer = getLayer(layer_id);
setStyle(objLayer,'visibility:hidden; display: block');
if(!width){width = objLayer.offsetWidth;}
if(!height){height = objLayer.offsetHeight;}
this.frameWidth = width;
this.frameHeight = height;
var page = getPageSize();
var left = (page[2] - width)/2;
if(left<0){left=0;}
var top = (page[3] - height)/2;
if(top<10){top=10;}
this.objBase.appendChild(objLayer);
setStyle(objLayer, 'top:'+top+'px; left:'+left+'px; width:'+width+'px; height:'+height+'px;overflow: auto;zIndex:121; position:absolute;visibility:visible');
this.objBase.style.visibility = 'visible';
this.objMain = objLayer;
},
'frame': function(url, width, height){
this.frameWidth = width;
this.frameHeight = height;
var page = getPageSize();
var left = (page[2] - width)/2;if(left<0){left=0;}
var top = (page[3] - height)/2;if(top<10){top=10;}
var objFrame = document.getElementById(this.prefix+'frame');
if(!objFrame){
var objT = document.createElement('div');
objT.style.display = 'none';
objT.innerHTML = '<iframe id="'+this.prefix+'frame" frameborder="0"></iframe>';
this.objBase.appendChild(objT);
objFrame = document.getElementById(this.prefix+'frame');
this.objBase.appendChild(objFrame);
this.objBase.removeChild(objT);
setStyle(objFrame, 'zIndex:120; position:absolute; backgroundColor:#ffffff');
var objLoading = document.createElement('div');
this.objBase.appendChild(objLoading);
setStyle(objLoading, 'backgroundColor:#ffffff; zIndex:121; position:absolute; padding:20px; left:'+(page[2]/2-50+20)+'px; top:'+(page[3]/2-50)+'px;visibility: visible;');
var objImgLoading = document.createElement('img');
// objImgLoading.src = this.shop_url+'published/SC/html/scripts/images_common/loading.gif';
objImgLoading.src = ((window.CONF_ON_WEBASYST||(this.shop_url.search('webasyst.net')!=-1))?(this.shop_url.replace(/shop\//,'')+'shop/'):(this.shop_url+'published/SC/html/scripts/'))+'images_common/loading.gif';
objLoading.appendChild(objImgLoading);
setTimeout(function(){objFrame.src = url;},100);
var objBase = this.objBase;
function objFrame_onload(){
if(objFrame.style.visibility != 'visible'){
var objLoading1 = objLoading;
var objBase1 = objBase;
setTimeout(function(){
if(objLoading1 && objLoading1.parentNode){
objLoading1.parentNode.removeChild(objLoading1);
objLoading1 = null;
}
objBase1.style.visibility = 'visible';}, 800);
}
};
if (objFrame.addEventListener) objFrame.addEventListener("load",objFrame_onload,false);
else if (objFrame.attachEvent) objFrame.attachEvent("onload", objFrame_onload);
this.objFrame = objFrame;
this.objMain = this.objFrame;
}
setStyle(objFrame, 'top:'+top+'px; left:'+left+'px; width:'+width+'px; height:'+height+'px');
},
'base': function(){
if(!/MSIE/.test(navigator.userAgent)){
var objBase = document.createElement("div");
objBase.style.visibility = 'hidden';
}else{
this.objDiv.innerHTML += '<div'+' id="myBase" style=\'z-index:95; position:absolute; visibility:hidden; top: expression(parseInt(document.documentElement.scrollTop || document.body.scrollTop, 10)+"px"); left: expression(parseInt(document.documentElement.scrollLeft || document.body.scrollLeft, 10)+"px");\'></div>';
var objBase = document.getElementById('myBase');
}
setStyle(objBase, 'zIndex:95');
if(!/MSIE/.test(navigator.userAgent)){setStyle(objBase, 'top:0; left:0; position: fixed');}
var arrayPageSize = getPageSize();
objBase.style.width = arrayPageSize[2]+'px';
objBase.style.height = arrayPageSize[3]+'px';
objBase.onclick = function(ev){if(getEventObject(ev).target.id && getEventObject(ev).target.id == this.id){sswgt_CartManager.hide();}};
this.objDiv.insertBefore(objBase, this.objDiv.firstChild);
this.objBase = objBase;
this.overlay();
},
'overlay':function(){
var objOverlay = document.getElementById(this.prefix+'overlay');
if(!objOverlay){
objOverlay = document.createElement('div');
objOverlay.id = this.prefix+'overlay';
this.objBase.appendChild(objOverlay);
}
var left = 0;
var top = 0;
var width = this.objBase.offsetWidth;
var height = this.objBase.offsetHeight;
setStyle(objOverlay, 'position:absolute; visibility: visible; top:'+top+'; left:'+left+'; width:'+width+'px; height:'+height+'px; backgroundColor:#000000');
setOpacity(objOverlay, 0.7);
objOverlay.onclick = function(ev){if(getEventObject(ev).target.id && getEventObject(ev).target.id == this.id){sswgt_CartManager.hide();}};
this.objOverlay = objOverlay;
},
'hide': function(remove){
if(this.objDiv && this.objDiv.parentNode){
if(this.objOverlay){
this.objDiv.appendChild(this.objOverlay);
}
this.objDiv.style.display = "none";
if(remove){
if(this.mode == 'layer'){
setStyle(this.objMain, 'display:none');
document.body.appendChild(this.objMain);
}
this.objDiv.parentNode.removeChild(this.objDiv);
this.objDiv = null;
this.objOverlay = null;
}
showSelectBoxes();
showFlash();
}
},
'closeButton': function(parentObject){
with(this){
var objCloseButton = document.getElementById(prefix+'closeButton');
if(!objCloseButton){
objCloseButton = document.createElement('img');
objCloseButton.id = prefix+'closeButton';
}