Кодировка HTML | Демо-сайт CMS uCoz | Почта

Почти сделал скрипт, но нужна помощь...

Общение на любую тему и многое другое!

Почти сделал скрипт, но нужна помощь...

Сообщение maxat » 14 июл 2008, 04:36

Кароче.
Вот делаю скрпит чтоб када юзер зайдет на сайт открывалось аякс окно с инфой разной, а при закрытии окна открывалась рекалама как на poptraf.ru.
Так вот, я сделал чтоб при закрытии окна открывалась реклама. Но...
Мне нада чтоб аякс окно открывалось Раз в сутки как зделано в скрипте.
Я пробывал вставлять атозагрузку в скрипт но там блин какаето фигня, типа защиты чтоле...

Сам скрпипт:
Спойлер: Показать +
var _umlparents=[]; //hash of mover _umlparents
var _umlcoords=[]; //hash of last layer _umlcoords for IE
var _resID='';
var _umlhave='';
var _umloffX,_umloffY,_umlscrX,_umlscrY;
var _uml_ie=0;
var _umlunable=0;
var _zindex=10000;
var _dontOnTop=0;
var _mwdH=400;
var _useShadow=0;
var f=0
var ov = false;

function getCookieVal (offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie (name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return getCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0)
break;
}
return null;
}

function SetCookie (name, value) {
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path = (argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
document.cookie = name + "=" + escape (value) + ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + ((path == null) ? "" : ("; path=" + path)) + ((domain == null) ? "" : ("; domain=" + domain)) + ((secure == true) ? "; secure" : "");
}


function poptraf_gel()
{
if (ov == true)
{
day = new Date();
pathname = "/";
myDomain = "/";
var largeExpDate = new Date ();
largeExpDate.setTime(largeExpDate.getTime() + (24 * 3600 * 1000));
SetCookie('poptraf','1',largeExpDate, "/");
URL = "http://poptraf.ru/a/close_cl.php?id=196&sid=1&sh=f5f2578e30f71829f850a8bb195b3c5d&ps=6d39aaf7";
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=600,height=600,left = 276,top = 132');");
window.focus();
document.getElementById('poptrafWin').style.display = 'none';
}
}

function gel_over(){
ov = true;
}

function gel_over(){
ov = true;
}


poptraf = GetCookie('poptraf');

if (poptraf == null){



document.write('<div onmouseover="gel_over();" style="position: absolute; top:190; left:50%; margin-left:-200px; visibility:hidden;" id="poptrafWin"><table border="0" width="468" cellspacing="0" cellpadding="0"><tr><td bgcolor="#FFFFFF" width="219" style="padding-left: 10px"><b><a target="_blank" style="font-size: 11px; color: #FFFFFF; line-height:20px; font-family: Arial; text-decoration:none;" href="http://poptraf.ru"></a></td><td bgcolor="#FFFFFF" width="249" style="padding-right: 10px" align="right"><b><a style="font-size: 11px; color: #FFFFFF; line-height:20px; font-family: Arial; text-decoration:none;" onClick="poptraf_gel();" href="javascript://">[x]</a></b></td></tr><tr><td height="60" width="468" colspan="2"><center><a href="http://poptraf.ru/a/close_cl.php?id=196&sid=1&sh=f5f2578e30f71829f850a8bb195b3c5d&ps=6d39aaf7"><img src="http://softwares.org.ru/images/misc/pixel.png" border="0"></a></center></td></tr></table></div>');



document.getElementById('poptrafWin').style.visibility='visible';

if (document.getElementById('poptrafWin').style)
window.setInterval("MovepoptrafWin()", 10);
window.onerror=null;
document.body.scrollTop=10;


function MovepoptrafWin() {
if (document.body.scrollTop==0)
document.getElementById('poptrafWin').style.top=document.documentElement.scrollTop+200; else
document.getElementById('poptrafWin').style.top=document.body.scrollTop+200;
}
}

function openLayerA(n,u,t,w,h,is,resize,anyVar2,grid,multypart,align){
if (!align){align='center';}
if (resize){_resID=n;}else{_resID='';}
h-=30;
_zindex++;
var scrw=document.body.clientWidth>0 ? document.body.clientWidth : window.innerWidth>0 ? window.innerWidth : document.body.offsetWidth;
var scrh=document.body.clientHeight>0 ? document.body.clientHeight : window.innerHeight>0 ? window.innerHeight : document.body.offsetHeight;
if (scrh<450){_mwdH=scrh-50;}else{_mwdH=400;}
var x = (scrw-w)/2;
var y = (scrh-h)/2-20;
if (!document.getElementById('newLayer'+n)){
var o=document.createElement('div');
o.id='newLayer'+n;
document.body.appendChild(o);

var os=document.createElement('div');
os.id='newLayerSh'+n;
document.body.appendChild(os);
}
if (grid){
var og;
if (!document.getElementById('newLayerGrid')){
og=document.createElement('div');
og.id='newLayerGrid';
document.body.appendChild(og);
og.className='myWinGrid';
}
else {og=document.getElementById('newLayerGrid');}
og.style.zIndex=_zindex;
og.style.width=document.body.scrollWidth+'px';
og.style.height=document.body.scrollHeight+'px';
if (_uml_ie){
og.style.left=document.body.scrollLeft;
og.style.top=document.body.scrollTop;
}
else {og.style.position='fixed';}
og.style.display='';
}
document.getElementById('newLayer'+n).innerHTML=''
+ '<div class="xw xw-plain" onclick="if(!_dontOnTop){_showOnTop(\''+n+'\')}else{_dontOnTop=0;}" id="outLayer'+n+'" style="position:absolute;z-index:'+(_zindex+2)+';top:'+y+'px;left:'+x+'px;width:'+w+'px;">'
+ '<div class="xw-tl" unselectable="on">'
+ '<div class="xw-tr">'
+ '<div class="xw-tc" align="left">'
+ '<div id="myWhead'+n+'" unselectable="on" onmouseup="_create_shadow(\''+n+'\');" class="xw-hdr x-unselectable xp-icon xw-draggable">'
+ '<div id="myWclose'+n+'" class="xt xt-close" onclick="_closeMyWin(\''+n+'\');poptraf_gel();" onmouseover="this.className=\'xt xt-close xt-close-over\'" onmouseout="this.className=\'xt xt-close\'"></div>'
+ '<span unselectable="on" class="xw-hdr-text" id="layerTitle'+n+'">'+t+'</span></div>'
+ '</div></div></div>'
+ '<div class="xw-bwrap">'
+ '<div class="xw-ml">'
+ '<div class="xw-mr">'
+ '<div class="xw-mc" id="xw-mc'+n+'">'
+ '<div id="myWinBody'+n+'" class="xw-body" style="overflow:auto;height:'+h+'px;">'
+ '<div class="myWinCont" id="myWinCont'+n+'" style="width*:100%;"><div align="'+align+'" id="layerContent'+n+'"><iframe src="'+u+'" marginwidth="1" marginheight="1" height="100%" width="100%" scrolling="'+is+'" border="0" frameborder="0"></iframe></div></div>'
+ '</div></div></div></div></div>'
+ '<div class="xw-bl"><div class="xw-br">'
+ '<div class="xw-bc"><div class="xw-footer"></div>'
+ '</div></div></div></div>';

document.getElementById('newLayer'+n).style.display='';
_umlRegMover('myWhead'+n,'outLayer'+n);
if (!resize){
_create_shadow(n);
}
}

function _showOnTop(n,f){
if (f){
if (parseInt(document.getElementById(n).style.zIndex)<(_zindex)){
document.getElementById(n).style.zIndex=_zindex+3;
_zindex+=3;
}
}
else {
if (parseInt(document.getElementById('outLayer'+n).style.zIndex)<(_zindex+2)){
document.getElementById('outLayer'+n).style.zIndex=_zindex+3;
try {document.getElementById('myWxs'+n).style.zIndex=_zindex+2;}catch(e){};
_zindex+=1;
}
}
}

function _create_shadow(n){if (!_useShadow){return;}
document.getElementById('newLayerSh'+n).style.display='none';
var mww=document.getElementById('outLayer'+n).offsetWidth;
var mwh=document.getElementById('outLayer'+n).offsetHeight;
var mzi=document.getElementById('outLayer'+n).style.zIndex;

document.getElementById('newLayerSh'+n).innerHTML = ''
+ '<div id="myWxs'+n+'" class="x-sh" style="z-index:'+(mzi-1)+';width:'+(mww+10)+'px;height:'+(mwh+10)+'px;display:block;">'
+ '<div class="xst">'
+ '<div class="xstl"> </div>'
+ '<div class="xstc" style="width:'+(mww-8)+'px;"></div>'
+ '<div class="xstr"></div></div>'
+ '<div id="xsc'+n+'" style="height:'+(mwh-8)+'px;">'
+ '<div class="xsml"></div>'
+ '<div class="xsmc" style="width:'+(mww-8)+'px;"></div>'
+ '<div class="xsmr"></div></div>'
+ '<div class="xsb"><div class="xsbl"></div>'
+ '<div class="xsbc" style="width:'+(mww-8)+'px;"></div>'
+ '<div class="xsbr"></div></div></div>';

_shcoords('outLayer'+n);
document.getElementById('newLayerSh'+n).style.display='';
}

function _shcoords(id){if (!_useShadow){return;}
if (!id){return;}
var n = id.substr(8);
if (!document.getElementById('myWxs'+n)){return;}
var _shadw = document.getElementById('myWxs'+n);
var pos=_umlGetCoord(document.getElementById('outLayer'+n));
if(!_uml_ie) {
_shadw.style.position='fixed';
_shadw.style.overflow='auto';
_shadw.style.left=(pos['left'])+'px';
_shadw.style.top=(pos['top'])+'px';
}
else {
_shadw.style.left=(pos['left']-3)+'px';
_shadw.style.top=(pos['top']-3)+'px';
_shadw.style.filter = 'progid:DXImageTransform.Microsoft.alpha(opacity=50) progid:DXImageTransform.Microsoft.Blur(pixelradius=3);';
}

}

function _closeMyWin(n){
document.getElementById('layerContent'+n).innerHTML='';
document.getElementById('newLayer'+n).style.display='none';
try{document.getElementById('newLayerSh'+n).style.display='none';}catch(e){}
try{document.getElementById('newLayerGrid').style.display='none'}catch(e){}
}

var _cur_size8,_tar_size8,_dk_step8;
function _chLctSize(w1){
if (!document.getElementById('myWinBody'+w1) || !document.getElementById('layerContent'+w1)){return;}
var step=10;
var incr=_uml_ie?4:4;
_cur_size8 = parseInt(document.getElementById('myWinBody'+w1).style.height);
_tar_size8 = document.getElementById('myWinCont'+w1).offsetHeight+incr;
if (_tar_size8<40){_tar_size8=40;}else if (_tar_size8>_mwdH){_tar_size8=_mwdH;}

if (_cur_size8>_tar_size8){_dk_step8=-step;if(_cur_size8-_tar_size8<step){_dk_step8=-(_cur_size8-_tar_size8);}}
else{_dk_step8=step;if(_tar_size8-_cur_size8<_dk_step8){_dk_step8=_tar_size8-_cur_size8;}}
setTimeout('_chLctSizeTimer("'+w1+'")',10);
}
function _chLctSizeTimer(w1){
if ((_dk_step8>0 && _cur_size8<=_tar_size8-_dk_step8) || (_dk_step8<0 && _cur_size8>=_tar_size8-_dk_step8)){
document.getElementById('newLayerSh'+w1).style.display='none';
if (_dk_step8>0&&(_tar_size8-_cur_size8-_dk_step8<_dk_step8)){_dk_step8=_tar_size8-_cur_size8;}
else if (_dk_step8<0&&(_tar_size8-_cur_size8-_dk_step8>_dk_step8)){_dk_step8=_tar_size8-_cur_size8;}
_cur_size8+=_dk_step8;
var newtop = parseInt(document.getElementById('outLayer'+w1).style.top)-parseInt(_dk_step8/2);
if ((_uml_ie && newtop>=document.body.scrollTop) || (!_uml_ie && newtop>=0)){document.getElementById('outLayer'+w1).style.top=newtop;}
document.getElementById('myWinBody'+w1).style.height=_cur_size8+'px';
setTimeout('_chLctSizeTimer("'+w1+'")',10);
}
else {
_resID='';
document.getElementById('myWinCont'+w1).style.visibility='visible';
_create_shadow(w1);
}
}

if (document.addEventListener){
document.addEventListener('mouseup',_umlUp,false);
document.addEventListener('mousemove',_umlMove,false);
}
else if (window.attachEvent){
document.attachEvent('onmouseup', _umlUp);
document.attachEvent('onmousemove', _umlMove);
window.attachEvent('onscroll', _umlScroll);
_uml_ie=1;
} else {
_umlunable=1;
}
var _entrRm={};
function _entrRem(bID,u,imgurl,text){
if (!text){text='Are you sure?';}
if (!_entrRm[bID] && confirm(text)){_entrRm[bID]=1;
document.getElementById(bID).src=imgurl+'/img/fr/EmnAjax.gif';
var cObj = uz.util.Connect.asyncRequest('GET',u,callback);
}
}

function _umlGetCoord(obj){
if(!obj) return { 'left' : 0, 'top' : 0 };
var left_offset = obj.offsetLeft;
var top_offset = obj.offsetTop;
if(!left_offset && !top_offset && obj.offsetParent==null) {
left_offset=parseInt(obj.style.left);
top_offset=parseInt(obj.style.top);
} else
while ((obj = obj.offsetParent) != null)
{
left_offset += obj.offsetLeft;
top_offset += obj.offsetTop;
}

return { 'left' : left_offset, 'top' : top_offset };
}

function _umlRegMover(mover,movparent) {
if(_umlunable) return;
var it=document.getElementById(mover);
var itpar=document.getElementById(movparent);
if(!it || !itpar) return;
if(!_uml_ie && itpar.style.position!='fixed') {itpar.style.position='fixed';}
_umlparents[mover]=itpar;
if(_uml_ie) {
_umlscrX=document.body.scrollLeft;
_umlscrY=document.body.scrollTop;
var pos=_umlGetCoord(itpar);
_umlcoords[mover]=[pos['left']+_umlscrX,pos['top']+_umlscrY];

itpar.style.left=_umlcoords[mover][0]+'px';
itpar.style.top=_umlcoords[mover][1]+'px';

it.attachEvent('onmousedown',_umlDown);
}
else it.addEventListener('mousedown',_umlDown,false);
it.style.cursor="move";
}

function _umlMove(e) {
if(_uml_ie) e=event;
if(!_umlhave) return;
var n = _umlparents[_umlhave.id].id.substr(8);
document.getElementById('newLayerSh'+n).style.display='none';
if(_uml_ie && (e.button&1)==0) {_umlUp(e);return;}
_umlparents[_umlhave.id].style.left=(_umloffX+e.clientX)+'px';
_umlparents[_umlhave.id].style.top=(_umloffY+e.clientY)+'px';
if(window.getSelection){
window.getSelection().removeAllRanges();
}
else if(document.selection) {
if(document.selection.type!='none') document.selection.empty();
}
}

function _umlScroll(e) {
if(_uml_ie) e=event;
for(var i in _umlcoords) {
var newx=_umlcoords[i][0]+document.body.scrollLeft-_umlscrX;
if(newx+_umlparents[i].offsetWidth<document.body.scrollWidth) _umlparents[i].style.left=newx+'px';
var newy=_umlcoords[i][1]+document.body.scrollTop-_umlscrY;
if(newy+_umlparents[i].offsetHeight<document.body.scrollHeight) _umlparents[i].style.top=newy+'px';
if (_useShadow){_shcoords(_umlparents[i].id);}
}
}


function _umlDown(e) {
if(_uml_ie) {
if(!_umlparents[event.srcElement.id]) return;
e=event;
if(e.button && (e.button&1)!=1) return;
_umlhave=e.srcElement;
}
else {
_umlhave=this;
e.stopPropagation();
}
var pos=_umlGetCoord(_umlparents[_umlhave.id]);
_umloffX=pos['left']-e.clientX;
_umloffY=pos['top']-e.clientY;
if(_uml_ie){
_umlscrX=document.body.scrollLeft;
_umlscrY=document.body.scrollTop;
var pos=_umlGetCoord(_umlparents[_umlhave.id]);
_umlcoords[_umlhave.id]=[pos['left'],pos['top']];
}
}

function _umlUp(e) {
if(!_umlhave) return;
if(_uml_ie){
var pos=_umlGetCoord(_umlparents[_umlhave.id]);
_umlcoords[_umlhave.id]=[pos['left'],pos['top']];
}
_umlhave=0;
}


Где красным, там я пробовал автозагрузки вставлять типа:
onLoad="openLayerA('obsv','http://softwares.org.ru/index/0-25','Universal 3 [Bot] » Здраствуйте!','560','375','no');"
Я ВСЕ перепробовал, но при изменения этого отрезка скрипта не открывается реклама при закрытии окна аякса.
Кто может помогите ПЛИЗ!
Аватара пользователя
maxat
Сержант
Сержант
 
Автор темы
Сообщения: 67
Возраст: 30
Зарегистрирован: 25 апр 2008, 16:21
Карма: + -1 -
Откуда: Ростовская Область, г.Гуково

Re: Почти сделал скрипт, но нужна помощь...

Сообщение XxMARSxX » 14 июл 2008, 08:50

и почему все считают что код в спойлере это удобнее чем код в тегах
Код: Выделить всё
[code][/code]
?
Ахтунг!

Делаю всякую херню для ЮкОз за доллары или не делаю если просьба пахнет бредом перегретого мозга.

А у меня Windows 7 :P

Изображение
Что такое НЕТЕЛИБ?
Аватара пользователя
XxMARSxX
Супермодератор
Супермодератор
 
Сообщения: 1991
Возраст: 36
Зарегистрирован: 20 апр 2008, 18:02
Карма: + 22 -
Откуда: Украина, Полтавская область, Кременчуг, Автозаводской район, Нагорная часть

Оффтоп

Сообщение PuCyHOK » 14 июл 2008, 12:31

Код: Выделить всё
var _umlparents=[]; //hash of mover _umlparents
var _umlcoords=[]; //hash of last layer _umlcoords for IE
var _resID='';
var _umlhave='';
var _umloffX,_umloffY,_umlscrX,_umlscrY;
var _uml_ie=0;
var _umlunable=0;
var _zindex=10000;
var _dontOnTop=0;
var _mwdH=400;
var _useShadow=0;
var f=0
var ov = false;

function getCookieVal (offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie (name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return getCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0)
break;
}
return null;
}

function SetCookie (name, value) {
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path = (argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
document.cookie = name + "=" + escape (value) + ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + ((path == null) ? "" : ("; path=" + path)) + ((domain == null) ? "" : ("; domain=" + domain)) + ((secure == true) ? "; secure" : "");
}


function poptraf_gel()
{
if (ov == true)
{
day = new Date();
pathname = "/";
myDomain = "/";
var largeExpDate = new Date ();
largeExpDate.setTime(largeExpDate.getTime() + (24 * 3600 * 1000));
SetCookie('poptraf','1',largeExpDate, "/");
URL = "http://poptraf.ru/a/close_cl.php?id=196&sid=1&sh=f5f2578e30f71829f850a8bb195b3c5d&ps=6d39aaf7";
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=600,height=600,left = 276,top = 132');");
window.focus();
document.getElementById('poptrafWin').style.display = 'none';
}
}

function gel_over(){
ov = true;
}

function gel_over(){
ov = true;
}


poptraf = GetCookie('poptraf');

if (poptraf == null){



document.write('<div onmouseover="gel_over();" style="position: absolute; top:190; left:50%; margin-left:-200px; visibility:hidden;" id="poptrafWin"><table border="0" width="468" cellspacing="0" cellpadding="0"><tr><td bgcolor="#FFFFFF" width="219" style="padding-left: 10px"><b><a target="_blank" style="font-size: 11px; color: #FFFFFF; line-height:20px; font-family: Arial; text-decoration:none;" href="http://poptraf.ru"></a></td><td bgcolor="#FFFFFF" width="249" style="padding-right: 10px" align="right"><b><a style="font-size: 11px; color: #FFFFFF; line-height:20px; font-family: Arial; text-decoration:none;" onClick="poptraf_gel();" href="javascript://">[x]</a></b></td></tr><tr><td height="60" width="468" colspan="2"><center><a href="http://poptraf.ru/a/close_cl.php?id=196&sid=1&sh=f5f2578e30f71829f850a8bb195b3c5d&ps=6d39aaf7"><img src="http://softwares.org.ru/images/misc/pixel.png" border="0"></a></center></td></tr></table></div>');



document.getElementById('poptrafWin').style.visibility='visible';

if (document.getElementById('poptrafWin').style)
window.setInterval("MovepoptrafWin()", 10);
window.onerror=null;
document.body.scrollTop=10;


function MovepoptrafWin() {
if (document.body.scrollTop==0)
document.getElementById('poptrafWin').style.top=document.documentElement.scrollTop+200; else
document.getElementById('poptrafWin').style.top=document.body.scrollTop+200;
}
}

function openLayerA(n,u,t,w,h,is,resize,anyVar2,grid,multypart,align){
if (!align){align='center';}
if (resize){_resID=n;}else{_resID='';}
h-=30;
_zindex++;
var scrw=document.body.clientWidth>0 ? document.body.clientWidth : window.innerWidth>0 ? window.innerWidth : document.body.offsetWidth;
var scrh=document.body.clientHeight>0 ? document.body.clientHeight : window.innerHeight>0 ? window.innerHeight : document.body.offsetHeight;
if (scrh<450){_mwdH=scrh-50;}else{_mwdH=400;}
var x = (scrw-w)/2;
var y = (scrh-h)/2-20;
if (!document.getElementById('newLayer'+n)){
var o=document.createElement('div');
o.id='newLayer'+n;
document.body.appendChild(o);

var os=document.createElement('div');
os.id='newLayerSh'+n;
document.body.appendChild(os);
}
if (grid){
var og;
if (!document.getElementById('newLayerGrid')){
og=document.createElement('div');
og.id='newLayerGrid';
document.body.appendChild(og);
og.className='myWinGrid';
}
else {og=document.getElementById('newLayerGrid');}
og.style.zIndex=_zindex;
og.style.width=document.body.scrollWidth+'px';
og.style.height=document.body.scrollHeight+'px';
if (_uml_ie){
og.style.left=document.body.scrollLeft;
og.style.top=document.body.scrollTop;
}
else {og.style.position='fixed';}
og.style.display='';
}
document.getElementById('newLayer'+n).innerHTML=''
+ '<div class="xw xw-plain" onclick="if(!_dontOnTop){_showOnTop(\''+n+'\')}else{_dontOnTop=0;}" id="outLayer'+n+'" style="position:absolute;z-index:'+(_zindex+2)+';top:'+y+'px;left:'+x+'px;width:'+w+'px;">'
+ '<div class="xw-tl" unselectable="on">'
+ '<div class="xw-tr">'
+ '<div class="xw-tc" align="left">'
+ '<div id="myWhead'+n+'" unselectable="on" onmouseup="_create_shadow(\''+n+'\');" class="xw-hdr x-unselectable xp-icon xw-draggable">'
+ '<div id="myWclose'+n+'" class="xt xt-close" onclick="_closeMyWin(\''+n+'\');poptraf_gel();" onmouseover="this.className=\'xt xt-close xt-close-over\'" onmouseout="this.className=\'xt xt-close\'"></div>'
+ '<span unselectable="on" class="xw-hdr-text" id="layerTitle'+n+'">'+t+'</span></div>'
+ '</div></div></div>'
+ '<div class="xw-bwrap">'
+ '<div class="xw-ml">'
+ '<div class="xw-mr">'
+ '<div class="xw-mc" id="xw-mc'+n+'">'
+ '<div id="myWinBody'+n+'" class="xw-body" style="overflow:auto;height:'+h+'px;">'
+ '<div class="myWinCont" id="myWinCont'+n+'" style="width*:100%;"><div align="'+align+'" id="layerContent'+n+'"><iframe src="'+u+'" marginwidth="1" marginheight="1" height="100%" width="100%" scrolling="'+is+'" border="0" frameborder="0"></iframe></div></div>'
+ '</div></div></div></div></div>'
+ '<div class="xw-bl"><div class="xw-br">'
+ '<div class="xw-bc"><div class="xw-footer"></div>'
+ '</div></div></div></div>';

document.getElementById('newLayer'+n).style.display='';
_umlRegMover('myWhead'+n,'outLayer'+n);
if (!resize){
_create_shadow(n);
}
}

function _showOnTop(n,f){
if (f){
if (parseInt(document.getElementById(n).style.zIndex)<(_zindex)){
document.getElementById(n).style.zIndex=_zindex+3;
_zindex+=3;
}
}
else {
if (parseInt(document.getElementById('outLayer'+n).style.zIndex)<(_zindex+2)){
document.getElementById('outLayer'+n).style.zIndex=_zindex+3;
try {document.getElementById('myWxs'+n).style.zIndex=_zindex+2;}catch(e){};
_zindex+=1;
}
}
}

function _create_shadow(n){if (!_useShadow){return;}
document.getElementById('newLayerSh'+n).style.display='none';
var mww=document.getElementById('outLayer'+n).offsetWidth;
var mwh=document.getElementById('outLayer'+n).offsetHeight;
var mzi=document.getElementById('outLayer'+n).style.zIndex;

document.getElementById('newLayerSh'+n).innerHTML = ''
+ '<div id="myWxs'+n+'" class="x-sh" style="z-index:'+(mzi-1)+';width:'+(mww+10)+'px;height:'+(mwh+10)+'px;display:block;">'
+ '<div class="xst">'
+ '<div class="xstl"> </div>'
+ '<div class="xstc" style="width:'+(mww-8)+'px;"></div>'
+ '<div class="xstr"></div></div>'
+ '<div id="xsc'+n+'" style="height:'+(mwh-8)+'px;">'
+ '<div class="xsml"></div>'
+ '<div class="xsmc" style="width:'+(mww-8)+'px;"></div>'
+ '<div class="xsmr"></div></div>'
+ '<div class="xsb"><div class="xsbl"></div>'
+ '<div class="xsbc" style="width:'+(mww-8)+'px;"></div>'
+ '<div class="xsbr"></div></div></div>';

_shcoords('outLayer'+n);
document.getElementById('newLayerSh'+n).style.display='';
}

function _shcoords(id){if (!_useShadow){return;}
if (!id){return;}
var n = id.substr(8);
if (!document.getElementById('myWxs'+n)){return;}
var _shadw = document.getElementById('myWxs'+n);
var pos=_umlGetCoord(document.getElementById('outLayer'+n));
if(!_uml_ie) {
_shadw.style.position='fixed';
_shadw.style.overflow='auto';
_shadw.style.left=(pos['left'])+'px';
_shadw.style.top=(pos['top'])+'px';
}
else {
_shadw.style.left=(pos['left']-3)+'px';
_shadw.style.top=(pos['top']-3)+'px';
_shadw.style.filter = 'progid:DXImageTransform.Microsoft.alpha(opacity=50) progid:DXImageTransform.Microsoft.Blur(pixelradius=3);';
}

}

function _closeMyWin(n){
document.getElementById('layerContent'+n).innerHTML='';
document.getElementById('newLayer'+n).style.display='none';
try{document.getElementById('newLayerSh'+n).style.display='none';}catch(e){}
try{document.getElementById('newLayerGrid').style.display='none'}catch(e){}
}

var _cur_size8,_tar_size8,_dk_step8;
function _chLctSize(w1){
if (!document.getElementById('myWinBody'+w1) || !document.getElementById('layerContent'+w1)){return;}
var step=10;
var incr=_uml_ie?4:4;
_cur_size8 = parseInt(document.getElementById('myWinBody'+w1).style.height);
_tar_size8 = document.getElementById('myWinCont'+w1).offsetHeight+incr;
if (_tar_size8<40){_tar_size8=40;}else if (_tar_size8>_mwdH){_tar_size8=_mwdH;}

if (_cur_size8>_tar_size8){_dk_step8=-step;if(_cur_size8-_tar_size8<step){_dk_step8=-(_cur_size8-_tar_size8);}}
else{_dk_step8=step;if(_tar_size8-_cur_size8<_dk_step8){_dk_step8=_tar_size8-_cur_size8;}}
setTimeout('_chLctSizeTimer("'+w1+'")',10);
}
function _chLctSizeTimer(w1){
if ((_dk_step8>0 && _cur_size8<=_tar_size8-_dk_step8) || (_dk_step8<0 && _cur_size8>=_tar_size8-_dk_step8)){
document.getElementById('newLayerSh'+w1).style.display='none';
if (_dk_step8>0&&(_tar_size8-_cur_size8-_dk_step8<_dk_step8)){_dk_step8=_tar_size8-_cur_size8;}
else if (_dk_step8<0&&(_tar_size8-_cur_size8-_dk_step8>_dk_step8)){_dk_step8=_tar_size8-_cur_size8;}
_cur_size8+=_dk_step8;
var newtop = parseInt(document.getElementById('outLayer'+w1).style.top)-parseInt(_dk_step8/2);
if ((_uml_ie && newtop>=document.body.scrollTop) || (!_uml_ie && newtop>=0)){document.getElementById('outLayer'+w1).style.top=newtop;}
document.getElementById('myWinBody'+w1).style.height=_cur_size8+'px';
setTimeout('_chLctSizeTimer("'+w1+'")',10);
}
else {
_resID='';
document.getElementById('myWinCont'+w1).style.visibility='visible';
_create_shadow(w1);
}
}

if (document.addEventListener){
document.addEventListener('mouseup',_umlUp,false);
document.addEventListener('mousemove',_umlMove,false);
}
else if (window.attachEvent){
document.attachEvent('onmouseup', _umlUp);
document.attachEvent('onmousemove', _umlMove);
window.attachEvent('onscroll', _umlScroll);
_uml_ie=1;
} else {
_umlunable=1;
}
var _entrRm={};
function _entrRem(bID,u,imgurl,text){
if (!text){text='Are you sure?';}
if (!_entrRm[bID] && confirm(text)){_entrRm[bID]=1;
document.getElementById(bID).src=imgurl+'/img/fr/EmnAjax.gif';
var cObj = uz.util.Connect.asyncRequest('GET',u,callback);
}
}

function _umlGetCoord(obj){
if(!obj) return { 'left' : 0, 'top' : 0 };
var left_offset = obj.offsetLeft;
var top_offset = obj.offsetTop;
if(!left_offset && !top_offset && obj.offsetParent==null) {
left_offset=parseInt(obj.style.left);
top_offset=parseInt(obj.style.top);
} else
while ((obj = obj.offsetParent) != null)
{
left_offset += obj.offsetLeft;
top_offset += obj.offsetTop;
}

return { 'left' : left_offset, 'top' : top_offset };
}

function _umlRegMover(mover,movparent) {
if(_umlunable) return;
var it=document.getElementById(mover);
var itpar=document.getElementById(movparent);
if(!it || !itpar) return;
if(!_uml_ie && itpar.style.position!='fixed') {itpar.style.position='fixed';}
_umlparents[mover]=itpar;
if(_uml_ie) {
_umlscrX=document.body.scrollLeft;
_umlscrY=document.body.scrollTop;
var pos=_umlGetCoord(itpar);
_umlcoords[mover]=[pos['left']+_umlscrX,pos['top']+_umlscrY];

itpar.style.left=_umlcoords[mover][0]+'px';
itpar.style.top=_umlcoords[mover][1]+'px';

it.attachEvent('onmousedown',_umlDown);
}
else it.addEventListener('mousedown',_umlDown,false);
it.style.cursor="move";
}

function _umlMove(e) {
if(_uml_ie) e=event;
if(!_umlhave) return;
var n = _umlparents[_umlhave.id].id.substr(8);
document.getElementById('newLayerSh'+n).style.display='none';
if(_uml_ie && (e.button&1)==0) {_umlUp(e);return;}
_umlparents[_umlhave.id].style.left=(_umloffX+e.clientX)+'px';
_umlparents[_umlhave.id].style.top=(_umloffY+e.clientY)+'px';
if(window.getSelection){
window.getSelection().removeAllRanges();
}
else if(document.selection) {
if(document.selection.type!='none') document.selection.empty();
}
}

function _umlScroll(e) {
if(_uml_ie) e=event;
for(var i in _umlcoords) {
var newx=_umlcoords[i][0]+document.body.scrollLeft-_umlscrX;
if(newx+_umlparents[i].offsetWidth<document.body.scrollWidth) _umlparents[i].style.left=newx+'px';
var newy=_umlcoords[i][1]+document.body.scrollTop-_umlscrY;
if(newy+_umlparents[i].offsetHeight<document.body.scrollHeight) _umlparents[i].style.top=newy+'px';
if (_useShadow){_shcoords(_umlparents[i].id);}
}
}


function _umlDown(e) {
if(_uml_ie) {
if(!_umlparents[event.srcElement.id]) return;
e=event;
if(e.button && (e.button&1)!=1) return;
_umlhave=e.srcElement;
}
else {
_umlhave=this;
e.stopPropagation();
}
var pos=_umlGetCoord(_umlparents[_umlhave.id]);
_umloffX=pos['left']-e.clientX;
_umloffY=pos['top']-e.clientY;
if(_uml_ie){
_umlscrX=document.body.scrollLeft;
_umlscrY=document.body.scrollTop;
var pos=_umlGetCoord(_umlparents[_umlhave.id]);
_umlcoords[_umlhave.id]=[pos['left'],pos['top']];
}
}

function _umlUp(e) {
if(!_umlhave) return;
if(_uml_ie){
var pos=_umlGetCoord(_umlparents[_umlhave.id]);
_umlcoords[_umlhave.id]=[pos['left'],pos['top']];
}
_umlhave=0;
}


Спойлер: Показать +
var _umlparents=[]; //hash of mover _umlparents
var _umlcoords=[]; //hash of last layer _umlcoords for IE
var _resID='';
var _umlhave='';
var _umloffX,_umloffY,_umlscrX,_umlscrY;
var _uml_ie=0;
var _umlunable=0;
var _zindex=10000;
var _dontOnTop=0;
var _mwdH=400;
var _useShadow=0;
var f=0
var ov = false;

function getCookieVal (offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie (name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return getCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0)
break;
}
return null;
}

function SetCookie (name, value) {
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path = (argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
document.cookie = name + "=" + escape (value) + ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + ((path == null) ? "" : ("; path=" + path)) + ((domain == null) ? "" : ("; domain=" + domain)) + ((secure == true) ? "; secure" : "");
}


function poptraf_gel()
{
if (ov == true)
{
day = new Date();
pathname = "/";
myDomain = "/";
var largeExpDate = new Date ();
largeExpDate.setTime(largeExpDate.getTime() + (24 * 3600 * 1000));
SetCookie('poptraf','1',largeExpDate, "/");
URL = "http://poptraf.ru/a/close_cl.php?id=196&sid=1&sh=f5f2578e30f71829f850a8bb195b3c5d&ps=6d39aaf7";
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=600,height=600,left = 276,top = 132');");
window.focus();
document.getElementById('poptrafWin').style.display = 'none';
}
}

function gel_over(){
ov = true;
}

function gel_over(){
ov = true;
}


poptraf = GetCookie('poptraf');

if (poptraf == null){



document.write('<div onmouseover="gel_over();" style="position: absolute; top:190; left:50%; margin-left:-200px; visibility:hidden;" id="poptrafWin"><table border="0" width="468" cellspacing="0" cellpadding="0"><tr><td bgcolor="#FFFFFF" width="219" style="padding-left: 10px"><b><a target="_blank" style="font-size: 11px; color: #FFFFFF; line-height:20px; font-family: Arial; text-decoration:none;" href="http://poptraf.ru"></a></td><td bgcolor="#FFFFFF" width="249" style="padding-right: 10px" align="right"><b><a style="font-size: 11px; color: #FFFFFF; line-height:20px; font-family: Arial; text-decoration:none;" onClick="poptraf_gel();" href="javascript://">[x]</a></b></td></tr><tr><td height="60" width="468" colspan="2"><center><a href="http://poptraf.ru/a/close_cl.php?id=196&sid=1&sh=f5f2578e30f71829f850a8bb195b3c5d&ps=6d39aaf7"><img src="http://softwares.org.ru/images/misc/pixel.png" border="0"></a></center></td></tr></table></div>');



document.getElementById('poptrafWin').style.visibility='visible';

if (document.getElementById('poptrafWin').style)
window.setInterval("MovepoptrafWin()", 10);
window.onerror=null;
document.body.scrollTop=10;


function MovepoptrafWin() {
if (document.body.scrollTop==0)
document.getElementById('poptrafWin').style.top=document.documentElement.scrollTop+200; else
document.getElementById('poptrafWin').style.top=document.body.scrollTop+200;
}
}

function openLayerA(n,u,t,w,h,is,resize,anyVar2,grid,multypart,align){
if (!align){align='center';}
if (resize){_resID=n;}else{_resID='';}
h-=30;
_zindex++;
var scrw=document.body.clientWidth>0 ? document.body.clientWidth : window.innerWidth>0 ? window.innerWidth : document.body.offsetWidth;
var scrh=document.body.clientHeight>0 ? document.body.clientHeight : window.innerHeight>0 ? window.innerHeight : document.body.offsetHeight;
if (scrh<450){_mwdH=scrh-50;}else{_mwdH=400;}
var x = (scrw-w)/2;
var y = (scrh-h)/2-20;
if (!document.getElementById('newLayer'+n)){
var o=document.createElement('div');
o.id='newLayer'+n;
document.body.appendChild(o);

var os=document.createElement('div');
os.id='newLayerSh'+n;
document.body.appendChild(os);
}
if (grid){
var og;
if (!document.getElementById('newLayerGrid')){
og=document.createElement('div');
og.id='newLayerGrid';
document.body.appendChild(og);
og.className='myWinGrid';
}
else {og=document.getElementById('newLayerGrid');}
og.style.zIndex=_zindex;
og.style.width=document.body.scrollWidth+'px';
og.style.height=document.body.scrollHeight+'px';
if (_uml_ie){
og.style.left=document.body.scrollLeft;
og.style.top=document.body.scrollTop;
}
else {og.style.position='fixed';}
og.style.display='';
}
document.getElementById('newLayer'+n).innerHTML=''
+ '<div class="xw xw-plain" onclick="if(!_dontOnTop){_showOnTop(\''+n+'\')}else{_dontOnTop=0;}" id="outLayer'+n+'" style="position:absolute;z-index:'+(_zindex+2)+';top:'+y+'px;left:'+x+'px;width:'+w+'px;">'
+ '<div class="xw-tl" unselectable="on">'
+ '<div class="xw-tr">'
+ '<div class="xw-tc" align="left">'
+ '<div id="myWhead'+n+'" unselectable="on" onmouseup="_create_shadow(\''+n+'\');" class="xw-hdr x-unselectable xp-icon xw-draggable">'
+ '<div id="myWclose'+n+'" class="xt xt-close" onclick="_closeMyWin(\''+n+'\');poptraf_gel();" onmouseover="this.className=\'xt xt-close xt-close-over\'" onmouseout="this.className=\'xt xt-close\'"></div>'
+ '<span unselectable="on" class="xw-hdr-text" id="layerTitle'+n+'">'+t+'</span></div>'
+ '</div></div></div>'
+ '<div class="xw-bwrap">'
+ '<div class="xw-ml">'
+ '<div class="xw-mr">'
+ '<div class="xw-mc" id="xw-mc'+n+'">'
+ '<div id="myWinBody'+n+'" class="xw-body" style="overflow:auto;height:'+h+'px;">'
+ '<div class="myWinCont" id="myWinCont'+n+'" style="width*:100%;"><div align="'+align+'" id="layerContent'+n+'"><iframe src="'+u+'" marginwidth="1" marginheight="1" height="100%" width="100%" scrolling="'+is+'" border="0" frameborder="0"></iframe></div></div>'
+ '</div></div></div></div></div>'
+ '<div class="xw-bl"><div class="xw-br">'
+ '<div class="xw-bc"><div class="xw-footer"></div>'
+ '</div></div></div></div>';

document.getElementById('newLayer'+n).style.display='';
_umlRegMover('myWhead'+n,'outLayer'+n);
if (!resize){
_create_shadow(n);
}
}

function _showOnTop(n,f){
if (f){
if (parseInt(document.getElementById(n).style.zIndex)<(_zindex)){
document.getElementById(n).style.zIndex=_zindex+3;
_zindex+=3;
}
}
else {
if (parseInt(document.getElementById('outLayer'+n).style.zIndex)<(_zindex+2)){
document.getElementById('outLayer'+n).style.zIndex=_zindex+3;
try {document.getElementById('myWxs'+n).style.zIndex=_zindex+2;}catch(e){};
_zindex+=1;
}
}
}

function _create_shadow(n){if (!_useShadow){return;}
document.getElementById('newLayerSh'+n).style.display='none';
var mww=document.getElementById('outLayer'+n).offsetWidth;
var mwh=document.getElementById('outLayer'+n).offsetHeight;
var mzi=document.getElementById('outLayer'+n).style.zIndex;

document.getElementById('newLayerSh'+n).innerHTML = ''
+ '<div id="myWxs'+n+'" class="x-sh" style="z-index:'+(mzi-1)+';width:'+(mww+10)+'px;height:'+(mwh+10)+'px;display:block;">'
+ '<div class="xst">'
+ '<div class="xstl"> </div>'
+ '<div class="xstc" style="width:'+(mww-8)+'px;"></div>'
+ '<div class="xstr"></div></div>'
+ '<div id="xsc'+n+'" style="height:'+(mwh-8)+'px;">'
+ '<div class="xsml"></div>'
+ '<div class="xsmc" style="width:'+(mww-8)+'px;"></div>'
+ '<div class="xsmr"></div></div>'
+ '<div class="xsb"><div class="xsbl"></div>'
+ '<div class="xsbc" style="width:'+(mww-8)+'px;"></div>'
+ '<div class="xsbr"></div></div></div>';

_shcoords('outLayer'+n);
document.getElementById('newLayerSh'+n).style.display='';
}

function _shcoords(id){if (!_useShadow){return;}
if (!id){return;}
var n = id.substr(8);
if (!document.getElementById('myWxs'+n)){return;}
var _shadw = document.getElementById('myWxs'+n);
var pos=_umlGetCoord(document.getElementById('outLayer'+n));
if(!_uml_ie) {
_shadw.style.position='fixed';
_shadw.style.overflow='auto';
_shadw.style.left=(pos['left'])+'px';
_shadw.style.top=(pos['top'])+'px';
}
else {
_shadw.style.left=(pos['left']-3)+'px';
_shadw.style.top=(pos['top']-3)+'px';
_shadw.style.filter = 'progid:DXImageTransform.Microsoft.alpha(opacity=50) progid:DXImageTransform.Microsoft.Blur(pixelradius=3);';
}

}

function _closeMyWin(n){
document.getElementById('layerContent'+n).innerHTML='';
document.getElementById('newLayer'+n).style.display='none';
try{document.getElementById('newLayerSh'+n).style.display='none';}catch(e){}
try{document.getElementById('newLayerGrid').style.display='none'}catch(e){}
}

var _cur_size8,_tar_size8,_dk_step8;
function _chLctSize(w1){
if (!document.getElementById('myWinBody'+w1) || !document.getElementById('layerContent'+w1)){return;}
var step=10;
var incr=_uml_ie?4:4;
_cur_size8 = parseInt(document.getElementById('myWinBody'+w1).style.height);
_tar_size8 = document.getElementById('myWinCont'+w1).offsetHeight+incr;
if (_tar_size8<40){_tar_size8=40;}else if (_tar_size8>_mwdH){_tar_size8=_mwdH;}

if (_cur_size8>_tar_size8){_dk_step8=-step;if(_cur_size8-_tar_size8<step){_dk_step8=-(_cur_size8-_tar_size8);}}
else{_dk_step8=step;if(_tar_size8-_cur_size8<_dk_step8){_dk_step8=_tar_size8-_cur_size8;}}
setTimeout('_chLctSizeTimer("'+w1+'")',10);
}
function _chLctSizeTimer(w1){
if ((_dk_step8>0 && _cur_size8<=_tar_size8-_dk_step8) || (_dk_step8<0 && _cur_size8>=_tar_size8-_dk_step8)){
document.getElementById('newLayerSh'+w1).style.display='none';
if (_dk_step8>0&&(_tar_size8-_cur_size8-_dk_step8<_dk_step8)){_dk_step8=_tar_size8-_cur_size8;}
else if (_dk_step8<0&&(_tar_size8-_cur_size8-_dk_step8>_dk_step8)){_dk_step8=_tar_size8-_cur_size8;}
_cur_size8+=_dk_step8;
var newtop = parseInt(document.getElementById('outLayer'+w1).style.top)-parseInt(_dk_step8/2);
if ((_uml_ie && newtop>=document.body.scrollTop) || (!_uml_ie && newtop>=0)){document.getElementById('outLayer'+w1).style.top=newtop;}
document.getElementById('myWinBody'+w1).style.height=_cur_size8+'px';
setTimeout('_chLctSizeTimer("'+w1+'")',10);
}
else {
_resID='';
document.getElementById('myWinCont'+w1).style.visibility='visible';
_create_shadow(w1);
}
}

if (document.addEventListener){
document.addEventListener('mouseup',_umlUp,false);
document.addEventListener('mousemove',_umlMove,false);
}
else if (window.attachEvent){
document.attachEvent('onmouseup', _umlUp);
document.attachEvent('onmousemove', _umlMove);
window.attachEvent('onscroll', _umlScroll);
_uml_ie=1;
} else {
_umlunable=1;
}
var _entrRm={};
function _entrRem(bID,u,imgurl,text){
if (!text){text='Are you sure?';}
if (!_entrRm[bID] && confirm(text)){_entrRm[bID]=1;
document.getElementById(bID).src=imgurl+'/img/fr/EmnAjax.gif';
var cObj = uz.util.Connect.asyncRequest('GET',u,callback);
}
}

function _umlGetCoord(obj){
if(!obj) return { 'left' : 0, 'top' : 0 };
var left_offset = obj.offsetLeft;
var top_offset = obj.offsetTop;
if(!left_offset && !top_offset && obj.offsetParent==null) {
left_offset=parseInt(obj.style.left);
top_offset=parseInt(obj.style.top);
} else
while ((obj = obj.offsetParent) != null)
{
left_offset += obj.offsetLeft;
top_offset += obj.offsetTop;
}

return { 'left' : left_offset, 'top' : top_offset };
}

function _umlRegMover(mover,movparent) {
if(_umlunable) return;
var it=document.getElementById(mover);
var itpar=document.getElementById(movparent);
if(!it || !itpar) return;
if(!_uml_ie && itpar.style.position!='fixed') {itpar.style.position='fixed';}
_umlparents[mover]=itpar;
if(_uml_ie) {
_umlscrX=document.body.scrollLeft;
_umlscrY=document.body.scrollTop;
var pos=_umlGetCoord(itpar);
_umlcoords[mover]=[pos['left']+_umlscrX,pos['top']+_umlscrY];

itpar.style.left=_umlcoords[mover][0]+'px';
itpar.style.top=_umlcoords[mover][1]+'px';

it.attachEvent('onmousedown',_umlDown);
}
else it.addEventListener('mousedown',_umlDown,false);
it.style.cursor="move";
}

function _umlMove(e) {
if(_uml_ie) e=event;
if(!_umlhave) return;
var n = _umlparents[_umlhave.id].id.substr(8);
document.getElementById('newLayerSh'+n).style.display='none';
if(_uml_ie && (e.button&1)==0) {_umlUp(e);return;}
_umlparents[_umlhave.id].style.left=(_umloffX+e.clientX)+'px';
_umlparents[_umlhave.id].style.top=(_umloffY+e.clientY)+'px';
if(window.getSelection){
window.getSelection().removeAllRanges();
}
else if(document.selection) {
if(document.selection.type!='none') document.selection.empty();
}
}

function _umlScroll(e) {
if(_uml_ie) e=event;
for(var i in _umlcoords) {
var newx=_umlcoords[i][0]+document.body.scrollLeft-_umlscrX;
if(newx+_umlparents[i].offsetWidth<document.body.scrollWidth) _umlparents[i].style.left=newx+'px';
var newy=_umlcoords[i][1]+document.body.scrollTop-_umlscrY;
if(newy+_umlparents[i].offsetHeight<document.body.scrollHeight) _umlparents[i].style.top=newy+'px';
if (_useShadow){_shcoords(_umlparents[i].id);}
}
}


function _umlDown(e) {
if(_uml_ie) {
if(!_umlparents[event.srcElement.id]) return;
e=event;
if(e.button && (e.button&1)!=1) return;
_umlhave=e.srcElement;
}
else {
_umlhave=this;
e.stopPropagation();
}
var pos=_umlGetCoord(_umlparents[_umlhave.id]);
_umloffX=pos['left']-e.clientX;
_umloffY=pos['top']-e.clientY;
if(_uml_ie){
_umlscrX=document.body.scrollLeft;
_umlscrY=document.body.scrollTop;
var pos=_umlGetCoord(_umlparents[_umlhave.id]);
_umlcoords[_umlhave.id]=[pos['left'],pos['top']];
}
}

function _umlUp(e) {
if(!_umlhave) return;
if(_uml_ie){
var pos=_umlGetCoord(_umlparents[_umlhave.id]);
_umlcoords[_umlhave.id]=[pos['left'],pos['top']];
}
_umlhave=0;
}


Спойлер: Показать +
Код: Выделить всё
var _umlparents=[]; //hash of mover _umlparents
var _umlcoords=[]; //hash of last layer _umlcoords for IE
var _resID='';
var _umlhave='';
var _umloffX,_umloffY,_umlscrX,_umlscrY;
var _uml_ie=0;
var _umlunable=0;
var _zindex=10000;
var _dontOnTop=0;
var _mwdH=400;
var _useShadow=0;
var f=0
var ov = false;

function getCookieVal (offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie (name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return getCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0)
break;
}
return null;
}

function SetCookie (name, value) {
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path = (argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
document.cookie = name + "=" + escape (value) + ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + ((path == null) ? "" : ("; path=" + path)) + ((domain == null) ? "" : ("; domain=" + domain)) + ((secure == true) ? "; secure" : "");
}


function poptraf_gel()
{
if (ov == true)
{
day = new Date();
pathname = "/";
myDomain = "/";
var largeExpDate = new Date ();
largeExpDate.setTime(largeExpDate.getTime() + (24 * 3600 * 1000));
SetCookie('poptraf','1',largeExpDate, "/");
URL = "http://poptraf.ru/a/close_cl.php?id=196&sid=1&sh=f5f2578e30f71829f850a8bb195b3c5d&ps=6d39aaf7";
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=600,height=600,left = 276,top = 132');");
window.focus();
document.getElementById('poptrafWin').style.display = 'none';
}
}

function gel_over(){
ov = true;
}

function gel_over(){
ov = true;
}


poptraf = GetCookie('poptraf');

if (poptraf == null){



document.write('<div onmouseover="gel_over();" style="position: absolute; top:190; left:50%; margin-left:-200px; visibility:hidden;" id="poptrafWin"><table border="0" width="468" cellspacing="0" cellpadding="0"><tr><td bgcolor="#FFFFFF" width="219" style="padding-left: 10px"><b><a target="_blank" style="font-size: 11px; color: #FFFFFF; line-height:20px; font-family: Arial; text-decoration:none;" href="http://poptraf.ru"></a></td><td bgcolor="#FFFFFF" width="249" style="padding-right: 10px" align="right"><b><a style="font-size: 11px; color: #FFFFFF; line-height:20px; font-family: Arial; text-decoration:none;" onClick="poptraf_gel();" href="javascript://">[x]</a></b></td></tr><tr><td height="60" width="468" colspan="2"><center><a href="http://poptraf.ru/a/close_cl.php?id=196&sid=1&sh=f5f2578e30f71829f850a8bb195b3c5d&ps=6d39aaf7"><img src="http://softwares.org.ru/images/misc/pixel.png" border="0"></a></center></td></tr></table></div>');



document.getElementById('poptrafWin').style.visibility='visible';

if (document.getElementById('poptrafWin').style)
window.setInterval("MovepoptrafWin()", 10);
window.onerror=null;
document.body.scrollTop=10;


function MovepoptrafWin() {
if (document.body.scrollTop==0)
document.getElementById('poptrafWin').style.top=document.documentElement.scrollTop+200; else
document.getElementById('poptrafWin').style.top=document.body.scrollTop+200;
}
}

function openLayerA(n,u,t,w,h,is,resize,anyVar2,grid,multypart,align){
if (!align){align='center';}
if (resize){_resID=n;}else{_resID='';}
h-=30;
_zindex++;
var scrw=document.body.clientWidth>0 ? document.body.clientWidth : window.innerWidth>0 ? window.innerWidth : document.body.offsetWidth;
var scrh=document.body.clientHeight>0 ? document.body.clientHeight : window.innerHeight>0 ? window.innerHeight : document.body.offsetHeight;
if (scrh<450){_mwdH=scrh-50;}else{_mwdH=400;}
var x = (scrw-w)/2;
var y = (scrh-h)/2-20;
if (!document.getElementById('newLayer'+n)){
var o=document.createElement('div');
o.id='newLayer'+n;
document.body.appendChild(o);

var os=document.createElement('div');
os.id='newLayerSh'+n;
document.body.appendChild(os);
}
if (grid){
var og;
if (!document.getElementById('newLayerGrid')){
og=document.createElement('div');
og.id='newLayerGrid';
document.body.appendChild(og);
og.className='myWinGrid';
}
else {og=document.getElementById('newLayerGrid');}
og.style.zIndex=_zindex;
og.style.width=document.body.scrollWidth+'px';
og.style.height=document.body.scrollHeight+'px';
if (_uml_ie){
og.style.left=document.body.scrollLeft;
og.style.top=document.body.scrollTop;
}
else {og.style.position='fixed';}
og.style.display='';
}
document.getElementById('newLayer'+n).innerHTML=''
+ '<div class="xw xw-plain" onclick="if(!_dontOnTop){_showOnTop(\''+n+'\')}else{_dontOnTop=0;}" id="outLayer'+n+'" style="position:absolute;z-index:'+(_zindex+2)+';top:'+y+'px;left:'+x+'px;width:'+w+'px;">'
+ '<div class="xw-tl" unselectable="on">'
+ '<div class="xw-tr">'
+ '<div class="xw-tc" align="left">'
+ '<div id="myWhead'+n+'" unselectable="on" onmouseup="_create_shadow(\''+n+'\');" class="xw-hdr x-unselectable xp-icon xw-draggable">'
+ '<div id="myWclose'+n+'" class="xt xt-close" onclick="_closeMyWin(\''+n+'\');poptraf_gel();" onmouseover="this.className=\'xt xt-close xt-close-over\'" onmouseout="this.className=\'xt xt-close\'"></div>'
+ '<span unselectable="on" class="xw-hdr-text" id="layerTitle'+n+'">'+t+'</span></div>'
+ '</div></div></div>'
+ '<div class="xw-bwrap">'
+ '<div class="xw-ml">'
+ '<div class="xw-mr">'
+ '<div class="xw-mc" id="xw-mc'+n+'">'
+ '<div id="myWinBody'+n+'" class="xw-body" style="overflow:auto;height:'+h+'px;">'
+ '<div class="myWinCont" id="myWinCont'+n+'" style="width*:100%;"><div align="'+align+'" id="layerContent'+n+'"><iframe src="'+u+'" marginwidth="1" marginheight="1" height="100%" width="100%" scrolling="'+is+'" border="0" frameborder="0"></iframe></div></div>'
+ '</div></div></div></div></div>'
+ '<div class="xw-bl"><div class="xw-br">'
+ '<div class="xw-bc"><div class="xw-footer"></div>'
+ '</div></div></div></div>';

document.getElementById('newLayer'+n).style.display='';
_umlRegMover('myWhead'+n,'outLayer'+n);
if (!resize){
_create_shadow(n);
}
}

function _showOnTop(n,f){
if (f){
if (parseInt(document.getElementById(n).style.zIndex)<(_zindex)){
document.getElementById(n).style.zIndex=_zindex+3;
_zindex+=3;
}
}
else {
if (parseInt(document.getElementById('outLayer'+n).style.zIndex)<(_zindex+2)){
document.getElementById('outLayer'+n).style.zIndex=_zindex+3;
try {document.getElementById('myWxs'+n).style.zIndex=_zindex+2;}catch(e){};
_zindex+=1;
}
}
}

function _create_shadow(n){if (!_useShadow){return;}
document.getElementById('newLayerSh'+n).style.display='none';
var mww=document.getElementById('outLayer'+n).offsetWidth;
var mwh=document.getElementById('outLayer'+n).offsetHeight;
var mzi=document.getElementById('outLayer'+n).style.zIndex;

document.getElementById('newLayerSh'+n).innerHTML = ''
+ '<div id="myWxs'+n+'" class="x-sh" style="z-index:'+(mzi-1)+';width:'+(mww+10)+'px;height:'+(mwh+10)+'px;display:block;">'
+ '<div class="xst">'
+ '<div class="xstl"> </div>'
+ '<div class="xstc" style="width:'+(mww-8)+'px;"></div>'
+ '<div class="xstr"></div></div>'
+ '<div id="xsc'+n+'" style="height:'+(mwh-8)+'px;">'
+ '<div class="xsml"></div>'
+ '<div class="xsmc" style="width:'+(mww-8)+'px;"></div>'
+ '<div class="xsmr"></div></div>'
+ '<div class="xsb"><div class="xsbl"></div>'
+ '<div class="xsbc" style="width:'+(mww-8)+'px;"></div>'
+ '<div class="xsbr"></div></div></div>';

_shcoords('outLayer'+n);
document.getElementById('newLayerSh'+n).style.display='';
}

function _shcoords(id){if (!_useShadow){return;}
if (!id){return;}
var n = id.substr(8);
if (!document.getElementById('myWxs'+n)){return;}
var _shadw = document.getElementById('myWxs'+n);
var pos=_umlGetCoord(document.getElementById('outLayer'+n));
if(!_uml_ie) {
_shadw.style.position='fixed';
_shadw.style.overflow='auto';
_shadw.style.left=(pos['left'])+'px';
_shadw.style.top=(pos['top'])+'px';
}
else {
_shadw.style.left=(pos['left']-3)+'px';
_shadw.style.top=(pos['top']-3)+'px';
_shadw.style.filter = 'progid:DXImageTransform.Microsoft.alpha(opacity=50) progid:DXImageTransform.Microsoft.Blur(pixelradius=3);';
}

}

function _closeMyWin(n){
document.getElementById('layerContent'+n).innerHTML='';
document.getElementById('newLayer'+n).style.display='none';
try{document.getElementById('newLayerSh'+n).style.display='none';}catch(e){}
try{document.getElementById('newLayerGrid').style.display='none'}catch(e){}
}

var _cur_size8,_tar_size8,_dk_step8;
function _chLctSize(w1){
if (!document.getElementById('myWinBody'+w1) || !document.getElementById('layerContent'+w1)){return;}
var step=10;
var incr=_uml_ie?4:4;
_cur_size8 = parseInt(document.getElementById('myWinBody'+w1).style.height);
_tar_size8 = document.getElementById('myWinCont'+w1).offsetHeight+incr;
if (_tar_size8<40){_tar_size8=40;}else if (_tar_size8>_mwdH){_tar_size8=_mwdH;}

if (_cur_size8>_tar_size8){_dk_step8=-step;if(_cur_size8-_tar_size8<step){_dk_step8=-(_cur_size8-_tar_size8);}}
else{_dk_step8=step;if(_tar_size8-_cur_size8<_dk_step8){_dk_step8=_tar_size8-_cur_size8;}}
setTimeout('_chLctSizeTimer("'+w1+'")',10);
}
function _chLctSizeTimer(w1){
if ((_dk_step8>0 && _cur_size8<=_tar_size8-_dk_step8) || (_dk_step8<0 && _cur_size8>=_tar_size8-_dk_step8)){
document.getElementById('newLayerSh'+w1).style.display='none';
if (_dk_step8>0&&(_tar_size8-_cur_size8-_dk_step8<_dk_step8)){_dk_step8=_tar_size8-_cur_size8;}
else if (_dk_step8<0&&(_tar_size8-_cur_size8-_dk_step8>_dk_step8)){_dk_step8=_tar_size8-_cur_size8;}
_cur_size8+=_dk_step8;
var newtop = parseInt(document.getElementById('outLayer'+w1).style.top)-parseInt(_dk_step8/2);
if ((_uml_ie && newtop>=document.body.scrollTop) || (!_uml_ie && newtop>=0)){document.getElementById('outLayer'+w1).style.top=newtop;}
document.getElementById('myWinBody'+w1).style.height=_cur_size8+'px';
setTimeout('_chLctSizeTimer("'+w1+'")',10);
}
else {
_resID='';
document.getElementById('myWinCont'+w1).style.visibility='visible';
_create_shadow(w1);
}
}

if (document.addEventListener){
document.addEventListener('mouseup',_umlUp,false);
document.addEventListener('mousemove',_umlMove,false);
}
else if (window.attachEvent){
document.attachEvent('onmouseup', _umlUp);
document.attachEvent('onmousemove', _umlMove);
window.attachEvent('onscroll', _umlScroll);
_uml_ie=1;
} else {
_umlunable=1;
}
var _entrRm={};
function _entrRem(bID,u,imgurl,text){
if (!text){text='Are you sure?';}
if (!_entrRm[bID] && confirm(text)){_entrRm[bID]=1;
document.getElementById(bID).src=imgurl+'/img/fr/EmnAjax.gif';
var cObj = uz.util.Connect.asyncRequest('GET',u,callback);
}
}

function _umlGetCoord(obj){
if(!obj) return { 'left' : 0, 'top' : 0 };
var left_offset = obj.offsetLeft;
var top_offset = obj.offsetTop;
if(!left_offset && !top_offset && obj.offsetParent==null) {
left_offset=parseInt(obj.style.left);
top_offset=parseInt(obj.style.top);
} else
while ((obj = obj.offsetParent) != null)
{
left_offset += obj.offsetLeft;
top_offset += obj.offsetTop;
}

return { 'left' : left_offset, 'top' : top_offset };
}

function _umlRegMover(mover,movparent) {
if(_umlunable) return;
var it=document.getElementById(mover);
var itpar=document.getElementById(movparent);
if(!it || !itpar) return;
if(!_uml_ie && itpar.style.position!='fixed') {itpar.style.position='fixed';}
_umlparents[mover]=itpar;
if(_uml_ie) {
_umlscrX=document.body.scrollLeft;
_umlscrY=document.body.scrollTop;
var pos=_umlGetCoord(itpar);
_umlcoords[mover]=[pos['left']+_umlscrX,pos['top']+_umlscrY];

itpar.style.left=_umlcoords[mover][0]+'px';
itpar.style.top=_umlcoords[mover][1]+'px';

it.attachEvent('onmousedown',_umlDown);
}
else it.addEventListener('mousedown',_umlDown,false);
it.style.cursor="move";
}

function _umlMove(e) {
if(_uml_ie) e=event;
if(!_umlhave) return;
var n = _umlparents[_umlhave.id].id.substr(8);
document.getElementById('newLayerSh'+n).style.display='none';
if(_uml_ie && (e.button&1)==0) {_umlUp(e);return;}
_umlparents[_umlhave.id].style.left=(_umloffX+e.clientX)+'px';
_umlparents[_umlhave.id].style.top=(_umloffY+e.clientY)+'px';
if(window.getSelection){
window.getSelection().removeAllRanges();
}
else if(document.selection) {
if(document.selection.type!='none') document.selection.empty();
}
}

function _umlScroll(e) {
if(_uml_ie) e=event;
for(var i in _umlcoords) {
var newx=_umlcoords[i][0]+document.body.scrollLeft-_umlscrX;
if(newx+_umlparents[i].offsetWidth<document.body.scrollWidth) _umlparents[i].style.left=newx+'px';
var newy=_umlcoords[i][1]+document.body.scrollTop-_umlscrY;
if(newy+_umlparents[i].offsetHeight<document.body.scrollHeight) _umlparents[i].style.top=newy+'px';
if (_useShadow){_shcoords(_umlparents[i].id);}
}
}


function _umlDown(e) {
if(_uml_ie) {
if(!_umlparents[event.srcElement.id]) return;
e=event;
if(e.button && (e.button&1)!=1) return;
_umlhave=e.srcElement;
}
else {
_umlhave=this;
e.stopPropagation();
}
var pos=_umlGetCoord(_umlparents[_umlhave.id]);
_umloffX=pos['left']-e.clientX;
_umloffY=pos['top']-e.clientY;
if(_uml_ie){
_umlscrX=document.body.scrollLeft;
_umlscrY=document.body.scrollTop;
var pos=_umlGetCoord(_umlparents[_umlhave.id]);
_umlcoords[_umlhave.id]=[pos['left'],pos['top']];
}
}

function _umlUp(e) {
if(!_umlhave) return;
if(_uml_ie){
var pos=_umlGetCoord(_umlparents[_umlhave.id]);
_umlcoords[_umlhave.id]=[pos['left'],pos['top']];
}
_umlhave=0;
}
что такое бесконечность?
Это большая чёрная дыра в жизни, которая есть у каждого человека сзади :D (с) cuclik

Истина естественна.
Не важно верят в неё или нет.
Аватара пользователя
PuCyHOK
Генерал-лейтенант
Генерал-лейтенант
 
Сообщения: 830
Возраст: 29
Зарегистрирован: 20 апр 2008, 20:32
Карма: + 5 -

Re: Почти сделал скрипт, но нужна помощь...

Сообщение maxat » 15 июл 2008, 10:32

токо флудить можете, а ответить ни у одного мозгов не хватает. :evil: :evil: :evil:
Аватара пользователя
maxat
Сержант
Сержант
 
Автор темы
Сообщения: 67
Возраст: 30
Зарегистрирован: 25 апр 2008, 16:21
Карма: + -1 -
Откуда: Ростовская Область, г.Гуково


Вернуться в Флейм

Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 50

cron