Вторая часть скрипта
var left = parentObject.offsetLeft+parentObject.offsetWidth-22;
var top = parentObject.offsetTop-25;
setStyle(objCloseButton, 'position:absolute; top:'+top+'; left:'+left+'; cursor:pointer; cursor:hand');
//DEBUG:
//alert(this.shop_url);
//objCloseButton.src = ((window.CONF_ON_WEBASYST||(this.shop_url.search('webasyst.net')!=-1))?(this.shop_url.replace(/shop\//,'')):(this.shop_url+'published/SC/html/scripts/'))+'images_common/close.gif';
objCloseButton.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/close.gif';
// objCloseButton.src = this.shop_url+'published/SC/html/scripts/images_common/close.gif';
objCloseButton.onclick = function(){sswgt_CartManager.hide();return false;};
objBase.appendChild(objCloseButton);
};
},
'border': function(parentObj){
var objBorder = document.getElementById(this.prefix+'border');
if(!objBorder){
objBorder = document.createElement('div');
objBorder.id = this.prefix+'border';
this.objBase.appendChild(objBorder);
}
var border_width = 0;
var left = parseInt(parentObj.style.left,10)-border_width;
var top = parseInt(parentObj.style.top,10)-border_width;
var width = parentObj.offsetWidth;
var height = parentObj.offsetHeight;
if(/MSIE/.test(navigator.userAgent)){
width += border_width*2;
height += border_width*2;
}
setStyle(objBorder, 'position:absolute; top:'+top+'; left:'+left+'; width:'+width+'px; height:'+height+'px; border: '+border_width+'px solid #efefef');
this.objBorder = objBorder;
}
};
function showSelectBoxes(){
var selects = document.getElementsByTagName("select");
for (i = 0; i != selects.length; i++) {
selects[i].style.visibility = "visible";
}
}
function hideSelectBoxes(){
var selects = document.getElementsByTagName("select");
for (i = 0; i != selects.length; i++) {
selects[i].style.visibility = "hidden";
}
}
function showFlash(){
var flashObjects = document.getElementsByTagName("object");
for (i = 0; i < flashObjects.length; i++) {
flashObjects[i].style.visibility = "visible";
}
var flashEmbeds = document.getElementsByTagName("embed");
for (i = 0; i < flashEmbeds.length; i++) {
flashEmbeds[i].style.visibility = "visible";
}
}
function hideFlash(){
var flashObjects = document.getElementsByTagName("object");
for (i = 0; i < flashObjects.length; i++) {
flashObjects[i].style.visibility = "hidden";
}
var flashEmbeds = document.getElementsByTagName("embed");
for (i = 0; i < flashEmbeds.length; i++) {
flashEmbeds[i].style.visibility = "hidden";
}
}
function getPageSize(){
var xScroll, yScroll;
if (window.innerHeight && window.scrollMaxY) {
xScroll = window.innerWidth + window.scrollMaxX;
yScroll = window.innerHeight + window.scrollMaxY;
} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
xScroll = document.body.scrollWidth;
yScroll = document.body.scrollHeight;
} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
xScroll = document.body.offsetWidth;
yScroll = document.body.offsetHeight;
}
var windowWidth, windowHeight;
if (self.innerHeight) { // all except Explorer
if(document.documentElement.clientWidth){
windowWidth = document.documentElement.clientWidth;
} else {
windowWidth = self.innerWidth;
}
windowHeight = self.innerHeight;
} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
windowWidth = document.documentElement.clientWidth;
windowHeight = document.documentElement.clientHeight;
} else if (document.body) { // other Explorers
windowWidth = document.body.clientWidth;
windowHeight = document.body.clientHeight;
}
// for small pages with total height less then height of the viewport
if(yScroll < windowHeight){
pageHeight = windowHeight;
} else {
pageHeight = yScroll;
}
// for small pages with total width less then width of the viewport
if(xScroll < windowWidth){
pageWidth = xScroll;
} else {
pageWidth = windowWidth;
}
arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight);
return arrayPageSize;
}
function setOpacity(element, value){
if (value == 1){
element.style.opacity = (/Gecko/.test(navigator.userAgent) && !/Konqueror|Safari|KHTML/.test(navigator.userAgent)) ? 0.999999 : null;
if(/MSIE/.test(navigator.userAgent)){
element.style.filter = element.style.filter.replace(/alpha\([^\)]*\)/gi, '');
}
} else {
if(value < 0.00001){ value = 0;}
element.style.opacity = value;
if(/MSIE/.test(navigator.userAgent)){
element.style.filter = element.style.filter.replace(/alpha\([^\)]*\)/gi, '')+ 'alpha(opacity='+value*100+')';
}
}
}
function setStyle(obj, style_str){
var styles = style_str.split(";");
with(obj){
for(var k=styles.length-1; k>=0; k--){
var _style = styles[k].split(':', 2);
if(!_style[1]){continue;}
_style[0] = _style[0].replace(/^\s|\s$/, '');
_style[1] = _style[1].replace(/^\s|\s$/, '');
style[_style[0]] = _style[1];
}
};
}
function getEventObject(ev){
var my_ev = {};
ev = ev?ev:window.event;
if(ev.srcElement){
my_ev.target = ev.srcElement;
}else{
my_ev.target = ev.target;
}
my_ev.ev = ev;
return my_ev;
}
}