function extend(Child, Parent) {
var F = function() { }
F.prototype = Parent.prototype;
Child.prototype = new F();
Child.prototype.constructor = Child;
Child.superclass = Parent.prototype ;
}
function Redirect(url)
{
document.location.replace(url);
}
function cClass(elm,cls)
{
if (elm) {
if (elm.className!=cls) elm.className = cls;
}
}
function init_params(obj,params)
{
for (var i in params)
{
child[i] = params[i];
}
}
function make_extend(child,parent)
{
for(var i in parent)
{
child[i] = parent[i];
}
return parent;
}
function include(scripturl)
{
var s = Core.New('SCRIPT');
s.language = 'javascript';
s.src = scripturl;
Core.B().appendChild(s);
}
function initHTML(c)
{
c.initHTML_();
}
function CoreObject()
{
this.worldCont = null;
var ua=navigator.userAgent.toLowerCase();
this.isOpera=ua.indexOf("opera")>-1;
this.isSafari=(/webkit|khtml/).test(ua);
this.isSafari3=this.isSafari&&ua.indexOf("webkit/5")!=-1;
this.isIE=!this.isOpera&&ua.indexOf("msie")>-1;
this.isIE7=!this.isOpera&&ua.indexOf("msie 7")>-1;
this.isIE8=!this.isOpera&&ua.indexOf("msie 8")>-1;
this.isGecko=!this.isSafari&&ua.indexOf("gecko")>-1;
this.isGecko3=!this.isSafari&&ua.indexOf("rv:1.9")>-1;
this.isChrome = (ua.indexOf("chrome")!=-1);
this.isWindows=(ua.indexOf("windows")!=-1||ua.indexOf("win32")!=-1);
this.isMac=(ua.indexOf("macintosh")!=-1||ua.indexOf("mac os x")!=-1);
this.isAir=(ua.indexOf("adobeair")!=-1);
this.isLinux=(ua.indexOf("linux")!=-1);
this.isSecure=window.location.href.toLowerCase().indexOf("https")===0;
this.isMSIE = this.isIE;
this.xmlhttps = new Array();
this.toolTipObject = null;
this.toolTipTarget = null;
this.xmlhttps = new Array();
this.isRun = true;
this.Refreshers = new Array();
this.zIndexMax = 1000001;
this.cashImages = new Array();
this.ObjectsStore = new Array();
this.DebugWin = null;
this.DebugMsg = true;
this.unicIDCount = 100;
this.cb_frames = [];
this.CSAjaxCheck = function()
{
var new_cbframes = [];
_$.FEach(this.cb_frames, function (cb_ajax) {
//Проверка загрузки данных в фрейме
try {
if (cb_ajax[0]!='OK')
{
new_cbframes.push(cb_ajax);
if (cb_ajax[1].contentWindow) {
var iDoc = (_$.isIE) ? cb_ajax[1].contentWindow.document : cb_ajax[1].contentDocument;
if (iDoc) {
if (iDoc.body && iDoc.body.innerHTML!=undefined) {
var bOk = false;
if (iDoc.body.innerHTML=='')
{ //Возможно еще не получены данные
//Устанавливаем тикер 10 пунктов, по истечению отправляеться пустая строка
if (!cb_ajax[3]) cb_ajax[3]=1;
if (cb_ajax[3]>50) bOk=true;
cb_ajax[3]++;
} else bOk = true;
if (bOk)
{
cb_ajax[2](iDoc.body.innerHTML);
if (cb_ajax[0]=='GET')
{
//Чистим поле GET
_$.$('xbody').d(cb_ajax[1]);
cb_ajax[1] = null;
} else {
//Чистим после POST
_$.$('xbody').d(cb_ajax[1]);
_$.$('xbody').d(cb_ajax[4]);
cb_ajax[1] = null;
cb_ajax[4] = null;
}
cb_ajax[0]='OK';
}
}
}
}
}
} catch (e) {}
} );
this.cb_frames = new_cbframes;
if (this.cb_frames.length==0)
{
_$.delI(_$.OS_Get('CSAjaxTimer_h'));
_$.OS_Add('CSAjaxTimer_h',false);
}
}
this.CSAjaxPost = function(url,post,cb,silent)
{
var frm = _$.New('IFRAME', {
s_width: '0px',
s_height: '0px',
s_left: '1px',
s_top: '1px',
s_position: 'absolute',
s_display: 'block',
s_visibility: 'hidden',
src : '',
border: '0px',
width: '1px',
height: '1px'
} );
frm.name = 'frame_'+frm.uid;
//Строим форму для отправки пост данных
var form = _$.New('FORM', {
action : url,
method : 'post',
target : 'frame_'+frm.uid } );
for ( var post_name in post)
{
form.a(_$.New('INPUT', {
type : 'hidden',
name : post_name,
value : _$.win2unicode(post[post_name]) } ) );
}
_$.$('xbody').a(form);
_$.$('xbody').a(frm);
this.cb_frames.push(['POST',frm,cb,0,form,silent]);
form.submit();
//Включаем таймер проверки, если он еще не включен
if (!_$.OS_Get('CSAjaxTimer_h'))
{
_$.OS_Add('CSAjaxTimer_h', _$.setI('_$.CSAjaxCheck();',10));
}
}
this.CSAjaxGet = function (url,cb,silent)
{
var frm = _$.New('IFRAME', {
s_width: '0px',
s_height: '0px',
s_left: '1px',
s_top: '1px',
s_position: 'absolute',
s_display: 'block',
s_visibility: 'hidden',
src : url,
border: '0px',
width: '1px',
height: '1px'
} );
this.cb_frames.push(['GET',frm,cb,0,null,silent]);
_$.$('xbody').a(frm);
//Включаем таймер проверки, если он еще не включен
if (!_$.OS_Get('CSAjaxTimer_h'))
{
_$.OS_Add('CSAjaxTimer_h', _$.setI('_$.CSAjaxCheck();',10));
}
}
this.setRng = function(r)
{
var s;
if (!_$.isIE) {
s = _$.getSelection();
if (s) {
s.removeAllRanges();
s.addRange(r);
}
} else {
try {
r.select();
} catch (ex) {}
}
}
this.prew = function(n)
{
var p = n.parentNode;
if (p.childNodes)
{
for(var i=0;i
0) && (p.childNodes.item(i-1)==n)) return p.childNodes.item(i);
}
}
return false;
}
this.next = function(n)
{
var p = n.parentNode;
if (p.childNodes)
{
for(var i=0;i 0 ? s.getRangeAt(0) : (s.createRange ? s.createRange() : window.document.createRange());
}
} catch (ex) {}
if (!r)
r = _$.isIE ? window.document.body.createTextRange() : window.document.createRange();
return r;
}
this.getSelection = function ()
{
if (_$.isIE)
{
return window.document.selection;
} else {
return window.getSelection();
}
}
this.setI = function(func,time)
{
return window.setInterval(func,time);
}
this.setT = function(func,time)
{
return window.setTimeout(func,time);
}
this.delI = function(id)
{
return window.clearInterval(id);
}
this.delT = function(id)
{
return window.clearInterval(id);
}
this.SetDebug = function(dwin)
{
this.DebugWin = dwin;
}
this.DebugDump = function(obj)
{
var msg = '';
for(var i in obj)
{
msg = msg + "
" + i + ":" + obj[i];
}
Core.DebugAdd(msg);
}
this.DebugAdd = function(msg)
{
if (this.DebugWin)
{
try {
this.DebugWin.AddMsg(msg);
} catch (e) {}
}
}
this.CI_onLoad = function(elm , func) {
var cOnLoadCI = 0;
if (this.OS_Get('CI_LoadCI')) cOnLoadCI = this.OS_Get('CI_LoadCI');
cOnLoadCI++;
this.OS_Add('CI_LoadCI_E'+cOnLoadCI,elm);
this.OS_Add('CI_LoadCI_C'+cOnLoadCI,func)
this.OS_Add('CI_LoadCI_F'+cOnLoadCI, function (cit) {
if (_$.OS_Get('CI_LoadCI_E'+cit).complete) {
window.clearInterval(_$.OS_Get('CI_LoadCI_I'+cit));
_$.OS_Get('CI_LoadCI_C'+cit)(_$.OS_Get('CI_LoadCI_E'+cit));
_$.OS_Del('CI_LoadCI_I'+cit);
_$.OS_Del('CI_LoadCI_F'+cit);
_$.OS_Del('CI_LoadCI_E'+cit);
}
} );
this.OS_Add('CI_LoadCI_I'+cOnLoadCI, window.setInterval("_$.OS_Get('CI_LoadCI_F"+ cOnLoadCI + "')(" + cOnLoadCI + ");",100));
this.OS_Add('CI_LoadCI',cOnLoadCI);
}
this.CI_LoadCount = function()
{
var i;
var ii=0;
var tc=0;
for (i in this.cashImages)
{
tc++;
if (this.cashImages[i])
{
if (this.cashImages[i].complete)
{
ii++;
}
}
}
return (tc - ii);
}
this.CI_Get = function(id)
{
if (this.cashImages[id]) return this.cashImages[id];
}
this.CI_Add = function(imgname,id)
{
if (!this.cashImages[id])
{
var ni = new Image();
ni.src = imgname;
this.cashImages[id] = ni;
}
}
this.OS_Add = function(sid,obj)
{
this.ObjectsStore[sid] = obj;
}
this.OS_Del = function(sid)
{
this.ObjectsStore[sid] = null;
}
this.OS_Chk = function(sid)
{
if (this.ObjectsStore[sid]) return true;
return false;
}
this.OS_New = function(id,createfunc)
{
if (this.ObjectsStore) if (this.ObjectsStore[id]) return this.ObjectsStore[id];
if (this.ObjectsStore)
{
this.ObjectsStore[id] = createfunc();
return this.ObjectsStore[id];
}
return null;
}
this.OS_Or = function(id,olternate)
{
if (this.ObjectsStore) {
if (this.ObjectsStore[id]) return this.ObjectsStore[id];
this.ObjectsStore[id] = olternate;
return this.ObjectsStore[id];
}
return null;
}
this.OS_Get = function(id)
{
if (this.ObjectsStore) if (this.ObjectsStore[id]!=undefined) return this.ObjectsStore[id];
return null;
}
this.R = function(obj,cb)
{
this.Refreshers.push( new Array(obj,cb));
}
this.R_ = function(obj,cb)
{
var tr = new Array();
for(var i in this.Refreshers)
if ((this.Refreshers[i][0]!=obj) && (this.Refreshers[i][1]!=cb))
tr.push(this.Refreshers[i]);
this.Refreshers = tr;
}
this.UpdateRefreshers = function()
{
for(var i in this.Refreshers)
{
var cb = this.Refreshers[i][1];
var ob = this.Refreshers[i][0];
try {
cb(ob);
} catch (e) {}
/*if (cb) cb(ob); */
}
}
this.MaxZOrder = function(cont,cmax)
{
this.zIndexMax++;
return this.zIndexMax;
}
this.New = function(tag,params)
{
var obj = this.MakeFW(document.createElement(tag));
if (params)
{
for (var i in params)
{
if (i.substr(0,2)=='s_')
{
try {
var i2 = i.substr(2);
i2 = Effects.ccs2js(i2);
obj.style[i2] = params[i];
} catch (e) {}
} else {
/*IMG PNG IE BUG FIX*/
if (tag=='IMG' && i=='src')
{
if (params[i].substr(params[i].length-3,3)=='png')
{
if (_$.isIE) {
obj[i] = 'http://21200.ru/js/blank.gif';
obj.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + params[i] + "', sizingMethod=scale)";
obj.pngImage = true;
} else {
obj[i] = params[i];
obj.setAttribute(i,params[i]);
}
} else {
obj[i] = params[i];
obj.setAttribute(i,params[i]);
}
} else {
obj[i] = params[i];
obj.setAttribute(i,params[i]);
}
}
}
}
return obj;
}
this.XBODY = function () { return this.MakeFW(this.worldCont); }
this.B = function()
{
if (document.documentElement)
return this.MakeFW(document.documentElement); else
return this.MakeFW(document.body);
},
this.V = function(val)
{
return val;
},
this.FindF = function(parent,tag)
{
if (typeof(parent) == 'string') parent=this.$(parent);
for(var i=0;i0) for (var i=0;i0)
{
for(var i = 0;i0) Core.DOM_4All(arr,p.childNodes.item(i),func);
}
}
}
}
}
} catch (e) {}
}
/*Проверка условия визов функции */
this.$if = function(condition,tf,ff)
{
if (condition) { alert(1); return tf();}
alert(2);
return ff();
}
this.$ = function(id)
{
if (id instanceof Object) return this.MakeFW(id);
if (id instanceof Array)
{
var rv=new Array();
for(e in id)
{
var o = this.MakeFW(document.getElementById(id[e]));
rv.push(o);
}
return rv;
} else {
return this.MakeFW(document.getElementById(id));
}
},
this.AJAX_StatusCheck = function()
{
var cl = 0;
if (Core.xmlhttps)
{
if (Core.xmlhttps.length)
{
cl = Core.xmlhttps.length;
if (Core.xmlhttps.length>0)
{
for (i=0;i Нет поддержки AJAX приложений');
}
}
}
this.xmlhttps.push(n_xmlhttp);
return n_xmlhttp;
},
this.Ajax_POST_RequestCB = function(url,postvars,callback,status)
{
//Кроссдоменный запрос?
var urls = new String(url);
if (urls.indexOf(document.location.host)==-1)
{
this.CSAjaxPost(url,postvars,callback,status);
return true;
}
if (this.$('bgload') && (!status)) this.$('bgload').style.display='block';
var xmlhttp;
xmlhttp = this.Get_Free_xmlhttp();
/*xmlhttp.nostatus = status;*/
if (!xmlhttp) {
alert("Core.js:Objects:Ajax_POST_Request - > Не удалось создать объект XMLHttpRequest");
return false;
}
/*
var url_get = url.split("?");
if (url_get[1]) //Есть GET данные
{
postvars['GET_REQUEST'] = url_get[1];
url = url_get[0];
}*/
var post = "";
var ii = 1;
for(v in postvars) {
post += encodeURIComponent(v) + "=" + encodeURIComponent(postvars[v]);
if (ii!=(postvars.length-1)) post = post+ "&";
ii++;
}
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState==4) {
Core.AJAX_StatusCheck();
if(Core.isRun) if (callback) callback(xmlhttp.responseText);
}
}
xmlhttp.open('POST',url,true);
xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlhttp.setRequestHeader("Content-Length", post.length);
/*xmlhttp.setRequestHeader("Connection", "close");*/
xmlhttp.send(post);
return true;
},
this.POST = function(url,postvars,callback,status) { _$.Ajax_POST_RequestCB(url,postvars,callback,status); }
this.Ajax_POST_Request = function(url,postvars,status)
{
return this.Ajax_POST_RequestCB(url,postvars,null,status);
},
this.AjaxCB = function(r) {
_$.DebugAdd('AjaxCB:');
_$.DebugAdd(r);
_$.DebugAdd('------------------------------------------');
if (r) {
try {
_$.setT("try { " + r + "} catch (e) { alert(e.message); } ",1);
//eval(r);
} catch (e) {
if (this.DebugMsg) alert(e.message);
}
}
}
this.win2unicode = function(str) {
var charmap = unescape(
"%u0402%u0403%u201A%u0453%u201E%u2026%u2020%u2021%u20AC%u2030%u0409%u2039%u040A%u040C%u040B%u040F"+
"%u0452%u2018%u2019%u201C%u201D%u2022%u2013%u2014%u0000%u2122%u0459%u203A%u045A%u045C%u045B%u045F"+
"%u00A0%u040E%u045E%u0408%u00A4%u0490%u00A6%u00A7%u0401%u00A9%u0404%u00AB%u00AC%u00AD%u00AE%u0407"+
"%u00B0%u00B1%u0406%u0456%u0491%u00B5%u00B6%u00B7%u0451%u2116%u0454%u00BB%u0458%u0405%u0455%u0457")
var code2char = function(code) {
if(code >= 0xC0 && code <= 0xFF) return String.fromCharCode(code - 0xC0 + 0x0410)
if(code >= 0x80 && code <= 0xBF) return charmap.charAt(code - 0x80)
return String.fromCharCode(code)
}
var res = ""
for(var i = 0; i < str.length; i++) res = res + code2char(str.charCodeAt(i))
return res
}
this.GET = function(url,callback,status) { _$.Ajax_GET_RequestCB(url,callback,status); }
this.Ajax_GET_RequestCB = function(url,callback,status)
{
//Кроссдоменный запрос?
var urls = new String(url);
if (urls.indexOf(document.location.host)==-1)
{
this.CSGetPost(url,callback,status);
return true;
}
if (this.$('bgload') && (!status)) this.$('bgload').style.display='block';
var xmlhttp;
xmlhttp = this.Get_Free_xmlhttp();
/*xmlhttp.nostatus = status;*/
if(!xmlhttp) {
alert("Core.js:Objects:Ajax_GET_Request -> Не удалось создать объект XMLHttpRequest");
return false;
}
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState==4) {
Core.AJAX_StatusCheck();
if (Core.isRun) if (callback) callback(xmlhttp.responseText);
}
}
xmlhttp.open('GET',url,true);
xmlhttp.send(null);
return true;
},
this.Ajax_GET_Request = function(url,status)
{
return this.Ajax_GET_RequestCB(url,null,status);
},
this.HideTooltip = function()
{
if (Core.$('OC_TOOLTIP')) Core.$('OC_TOOLTIP').style.display='none';
}
this.PopupTooltip2 = function (targetobj,tt_obj,tt_cont,x_o,y_o,msg)
{
this.toolTipTarget = targetobj;
if (tt_obj && tt_cont)
{
tt_cont.innerHTML =msg;
tt_obj.style.left = this.getLeftPos(targetobj) + x_o +'px';
tt_obj.style.top = this.getTopPos(targetobj) + y_o + 'px';
tt_obj.style.display = 'block';
_$.OS_Add('TOOLTIP2_OBJECT',tt_obj);
function HideTooltip()
{
_$.OS_Get('TOOLTIP2_OBJECT').style.display='none';
if (Core.toolTipTarget)
{
Core.removeHandler(Core.toolTipTarget,"mouseout",HideTooltip);
}
}
this.addHandler(targetobj,"mouseout",HideTooltip);
}
},
this.PopupTooltip = function (targetobj,xoffset,yoffset,msg)
{
this.toolTipTarget = targetobj;
if (this.toolTipObject == null)
{
this.toolTipObject = _$.New('DIV', {
id : 'OC_TOOLTIP'} );
with (this.toolTipObject)
{
className = 'tooltip';
this.worldCont.appendChild(this.toolTipObject);
style.position = 'absolute';
style.zIndex = 9000000;
var n_left = this.getLeftPos(targetobj) + xoffset;
if (n_left + 200>_$.$('xbody').w()) n_left = _$.$('xbody').w() - 200;
style.left = n_left + 'px';
style.top = this.getTopPos(targetobj) + yoffset + 'px';
appendChild(document.createTextNode(msg));
//innerHTML = msg;
style.display = 'block';
style.visibility = 'visible';
}
} else {
this.toolTipObject.style.display = 'block';
this.toolTipObject.innerHTML =msg;
var n_left = this.getLeftPos(this.toolTipTarget) + xoffset;
if ((n_left + 200)>_$.$('xbody').w()) n_left = _$.$('xbody').w() - 200;
this.toolTipObject.style.left = n_left + 'px';
this.toolTipObject.style.top = this.getTopPos(targetobj) + yoffset + 'px';
}
/*Effects.add(new Effect('OC_TOOLTIP',500).Opacity(0,1));*/
function HideTooltip()
{
Core.$('OC_TOOLTIP').style.display='none';
/*Effects.add(new Effect('OC_TOOLTIP',500).Opacity(1,0).SCB(function (p) { p.style.display='none';},Core.$('OC_TOOLTIP')));*/
if (Core.toolTipTarget)
{
Core.removeHandler(Core.toolTipTarget,"mouseout",HideTooltip);
}
}
this.addHandler(targetobj,"mouseout",HideTooltip);
},
this.WindowSY = function()
{
var rv = "";
if (this.isIE)
{
rv = (window.document.body.scrollTop || document.documentElement.scrollTop);
} else {
rv = window.scrollY;
}
return rv;
},
this.WindowHeight = function()
{
var hh=0;
if (window.innerHeight) { /*Для всех браузеров кроме ослика*/
hh = window.innerHeight;
} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6
hh = document.documentElement.clientHeight;
} else if (document.body) { /* другие Explorerы*/
hh = document.body.clientHeight;
}
return hh;
},
this.WindowWidth = function()
{
var ww=0;
if (window.innerWidth) { /* Для всех браузеров кроме ослика*/
ww = window.innerWidth;
} else if (document.documentElement && document.documentElement.clientWidth) { /* Explorer 6*/
ww = document.documentElement.clientWidth;
} else if (document.body) { /* другие Explorerы*/
ww = document.body.clientWidth;
}
return ww;
},
this.getTopPos = function(inputObj)
{
if (typeof(inputObj) == 'string') inputObj = this.$(inputObj);
if (inputObj)
{
/*
var returnValue = 0;
if (inputObj.offsetTop) returnValue = inputObj.offsetTop;
if (inputObj.offsetParent)
{
while((inputObj = inputObj.offsetParent) != null){
if(inputObj.tagName!='HTML')returnValue += inputObj.offsetTop;
}
}
return returnValue;
*/
var offsetTop = 0;
do {
if (inputObj.offsetTop)
offsetTop += inputObj.offsetTop;
} while (inputObj = inputObj.offsetParent);
return offsetTop;
}
},
this.getLeftPos = function(inputObj)
{
if (typeof(inputObj) == 'string') inputObj = this.$(inputObj);
if (inputObj)
{
/*
var returnValue = 0;
if (inputObj.offsetLeft != undefined) returnValue = inputObj.offsetLeft;
if (inputObj.offsetParent !=undefined)
{
while((inputObj = inputObj.offsetParent) != null){
if(inputObj.tagName!='HTML') returnValue += inputObj.offsetLeft;
}
}
return returnValue;*/
var offsetLeft = 0;
do {
if (inputObj.offsetLeft)
offsetLeft += inputObj.offsetLeft;
} while (inputObj = inputObj.offsetParent);
return offsetLeft;
}
},
this.addHandler = function(object, event, handler, useCapture) {
/*alert(object.fxLib);
f (event=='mousewheel' && !_$.isIE && !_$.isOpera) event='DOMMouseScroll';*/
if (object instanceof Array)
{
for(var i in object)
{
this.addHandler(object[i],event,handler, useCapture ? useCapture : false);
}
} else {
if (typeof(object) == 'string') object=Core.$(object);
if (object)
{
if (!object.fxLib) object=_$.MakeFW(object);
if (!object.events[event])
{
object.events[event] = new Array();
}
object.events[event].push(handler);
if (object.addEventListener) {
/*alert('add');*/
object.addEventListener(event, handler, useCapture ? useCapture : false);
} else if (object.attachEvent) {
object.attachEvent('on' + event, handler);
} else alert("Add handler is not supported");
}
}
},
this.removeHandler = function(object, event, handler) {
/*if (event=='mousewheel' && !_$.isIE && !_$.isOpera) event='DOMMouseScroll';*/
if (object instanceof Array)
{
for (var i in object)
{
this.removeHandler(object[i],event,handler);
}
} else {
if (typeof(object) == 'string') object=Core.$(object);
if (object)
{
if (object.removeEventListener) {
object.removeEventListener(event, handler, false);
} else if (object.detachEvent) {
object.detachEvent('on' + event, handler);
} else alert("Remove handler is not supported");
}
}
}
this.Init = function()
{
this.worldCont=this.$('xbody');
if (Core.isIE) window.document.execCommand("BackgroundImageCache", false, true);
}
this.W = function(id)
{
var obj = id;
if (typeof(id) == 'string') obj = this.$(id);
if (obj)
{
if (obj.offsetWidth) return obj.offsetWidth;
if (obj.style)
{
if (obj.style.width) return parseInt(obj.style.width);
}
}
}
this.H = function(id)
{
var obj = id;
if (typeof(id) == 'string') obj = this.$(id);
if (obj)
{
if (obj.offsetHeight) return obj.offsetHeight;
if (obj.style)
{
if (obj.style.height) return parseInt(obj.style.height);
}
}
}
this.X = function(id)
{
return this.getLeftPos(id);
}
this.Y = function(id)
{
return this.getTopPos(id);
}
this.Rect = function(id)
{
if (id instanceof Array)
{
var rv = new Array();
for (var i in id)
{
if (typeof(id[i])=='string') id[i] = this.$(id[i]);
var nr = new Rect(this.X(id[i]),this.Y(id[i]),this.W(id[i]),this.H(id[i]));
rv.push(nr);
}
return rv;
} else {
if (typeof(id) == 'string') id = this.$(id);
var nr = new Rect(this.X(id),this.Y(id),this.W(id),this.H(id));
return nr;
}
}
this.Event = function(e)
{
var r = window.event;
/*if (!r) r = Event;*/
if (!r) r = e;
if (r)
{
r.kCode = (_$.isIE) ? e.keyCode : e.which;
if (r.type.match(/DOMMouseScroll|mousewheel/)){
r.wheel = (r.wheelDelta) ? r.wheelDelta / 120 : -(r.detail || 0) / 3;
}
if (r.target == undefined)
{
if (r.srcElement) r.target = r.srcElement;
if (r.currentTarget) r.target = r.currentTarget;
}
var rr = Core.Rect(r.target);
this.MakeFW(r.target);
if (r.pageX == undefined) r.pageX = r.clientX;
if (r.pageY == undefined) r.pageY = r.clientY;
r.OX = r.pageX - rr.x;
r.OY = r.pageY - rr.y;
return r;
}
}
this.MakeFW = function(obj)
{
/*return obj;*/
var _core = this;
if (obj)
{
if (obj.fxLib == undefined)
{
obj.fxLib = '1.0.0';
obj.events = new Array();
_core.unicIDCount++;
obj.uid = _core.unicIDCount;
obj.e_rall = function(etype)
{
if (this.events)
{
if (this.events[etype])
{
if (this.events[etype].length>0)
{
var i=0;
for (i=0;i=0)
{
return this.Toggle();
} else {
this.type=0;
}
}
this.end = true;
this.lastRefresh = MSTicker.ticks();
return this;
}
this.ToggleShow = function()
{
if (this.target)
{
var v = parseInt(this.target.style.marginTop);
if (!this.target.style.marginTop) return this.Toggle();
if (v<=0)
{
return this.Toggle();
} else {
this.type=0;
}
}
this.end = true;
this.lastRefresh = MSTicker.ticks();
return this;
}
this.Toggle = function()
{
this.type = 7;
if (this.target)
{
var v = parseInt(this.target.style.marginTop);
if (v<0)
{
this.p2 = 1; /*Открываем*/
this.p3 = v;
} else {
this.p2 = 2; /*Закрываем*/
this.p3 = Core.H(this.target);
}
}
/*/alert(this.p3);*/
this.end = false;
this.lastRefresh = MSTicker.ticks();
return this;
}
this.ResizeWH = function (w_f,h_f,w_t,h_t)
{
this.type = 5;
this.p1 = w_f;
this.p2 = h_f;
this.p3 = w_t;
this.p4 = h_t;
this.lastRefresh = MSTicker.ticks();
this.end = false;
return this;
}
this.ResizeW = function(w_from,w_to)
{
this.type = 4;
this.p1 = w_from;
this.p2 = w_to;
this.lastRefresh = MSTicker.ticks();
this.end = false;
return this;
}
this.ResizeH = function(h_from,h_to)
{
this.type = 3;
this.p1 =h_from;
this.p2 =h_to;
this.lastRefresh = MSTicker.ticks();
this.end = false;
return this;
}
this.Move = function(x_to,y_to,x_f,y_f)
{
this.type = 2;
this.p1 = x_to;
this.p2 = y_to;
if (!x_f) this.p3 = Core.X(this.target); else this.p3=x_f;
if (!y_f) this.p4 = Core.Y(this.target); else this.p4=y_f;
this.lastRefresh = MSTicker.ticks();
this.end = false;
return this;
}
this.Opacity = function(value_from,value_to)
{
/*/if (value_from==0) this.target.style.display='none';*/
this.type=1;
this.p1 = value_from;
this.p2 = value_to;
this.lastRefresh = MSTicker.ticks();
this.end = false;
return this;
}
this.Morph = function(style,from,to,eds,usestatic)
{
if (style=='opacity')
{
return this.Opacity(from,to);
} else {
this.type = 6;
this.p1 = Effects.ccs2js(style);
if (eds) this.p5 = eds; else this.p5="";
if (typeof(to)=='string' && to.substr(0,1)=='#')
{
if (usestatic)
if(this.target.style[this.p1]) from=this.target.style[this.p1];
this.p2 = Effects.splitRGB(from);
this.p3 = Effects.splitRGB(to);
this.p4 = 0;
} else {
if (usestatic)
if (this.target.style[this.p1]) from = parseFloat(this.target.style[this.p1]);
this.p2 = from;
this.p3 = to;
this.p4 = 1;
}
this.lastRefresh = MSTicker.ticks();
this.end = false;
/*/alert(this.p3['r'] + '-' + this.p3['g'] + '-' + this.p3['b']);*/
return this;
}
}
}
function FXP(prop,from,to,dur,eds)
{
this.prop = prop;
this.from = from;
this.to = to;
this.dur = dur;
this.eds = eds;
}
/*/===========================================================================================================================*/
function EffectsObject()
{
this.Effects = new Array();
this.splitRGB = function (color)
{
var rgb = color.replace(/[# ]/g,"").replace(/^(.)(.)(.)$/,'$1$1$2$2$3$3').match(/.{2}/g);
for (var i=0; i<3; i++) rgb[i] = parseInt(rgb[i], 16);
return {'r':rgb[0],'g':rgb[1],'b':rgb[2]};
}
this.ccs2js = function (prop)
{
var i;
while ((i=prop.indexOf("-"))!=-1)
prop = prop.substr(0, i) + prop.substr(i+1,1).toUpperCase() + prop.substr(i+2);
return prop;
}
this.addMorphPack = function(el,pack)
{
if (el)
{
if (pack instanceof Array)
{
for (var i in pack)
{
this.add(new Effect(el,pack[i].dur).Morph(pack[i].prop,pack[i].from,pack[i].to,pack[i].eds));
}
}
}
return this;
}
this.checkOverlap = function(eff)
{
if (this.Effects.length==0) return eff;
for (var i in this.Effects)
with(this.Effects[i]) {
if(!this.Effects[i].end) if (this.Effects[i].target==eff.target) {
var d = (MSTicker.ticks()+1) - this.Effects[i].lastRefresh;
if (this.Effects[i].type==eff.type)
{
end=true;
switch (type)
{
case 0 :
break;
case 1 : /*/Opacity*/
var x = (this.Effects[i].p2 - this.Effects[i].p1) / this.Effects[i].speed * d;
eff.p1 = this.Effects[i].p1 + x;
break;
case 2 : /*/Move*/
var d_x = (this.Effects[i].p1 - this.Effects[i].p3) / this.Effects[i].speed * d;
var d_y = (this.Effects[i].p2 - this.Effects[i].p4) / this.Effects[i].speed * d;
eff.p3 = this.Effects[i].p3 + d_x;
eff.p4 = this.Effects[i].p4 + d_y;
break;
case 3 : /*/ResizeH*/
var d_h = (this.Effects[i].p2 - this.Effects[i].p1) / this.Effects[i].speed * d;
eff.p1 = this.Effects[i].p1+d_h;
break;
case 4 : /*/ResizeW*/
var d_w = (this.Effects[i].p2 - this.Effects[i].p1) / this.Effects[i].speed * d;
eff.p1 = (this.Effects[i].p1 + d_w);
break;
case 5 : /*/ResizeWH*/
var dd_w = (this.Effects[i].p3 - this.Effects[i].p1) / this.Effects[i].speed * d;
var dd_h = (this.Effects[i].p4 - this.Effects[i].p2) / this.Effects[i].speed * d;
eff.p1 = (this.Effects[i].p1 + dd_w);
eff.p2 = (this.Effects[i].p2 + dd_h);
break;
case 6 : /*/Morph*/
if (this.Effects[i].p1==eff.p1)
{
if (this.Effects[i].p4==1)
{
/*/Number morph*/
var d_c = (this.Effects[i].p3 - this.Effects[i].p2) / this.Effects[i].speed * d;
/*/alert(d_c);*/
eff.p2 = Math.floor( this.Effects[i].p2 + d_c )
} else {
/*/Color morph*/
var d_c = d/(this.Effects[i].speed/100)/100;
var startPercent = 1 -d_c;
var finishPercent = d_c;
var aRGBStart = this.Effects[i].p2;
var aRGBFinish = eff.p3;
eff.p2['r'] = Math.floor(aRGBStart['r'] * startPercent + aRGBFinish['r'] * finishPercent);
eff.p2['g'] = Math.floor(aRGBStart['g'] * startPercent + aRGBFinish['g'] * finishPercent);
eff.p2['b'] = Math.floor(aRGBStart['b'] * startPercent + aRGBFinish['b'] * finishPercent);
}
this.Effects[i].end = true;
} else {
this.Effects[i].end = false;
}
break;
case 7 : /*/Toggle\*/
break;
}
/*/end = true;*/
}
}
}
return eff;
}
this.add = function(eff)
{
eff = this.checkOverlap(eff);
eff.end = false;
eff.lastRefresh = MSTicker.ticks();
this.Effects.push(eff);
return this;
}
this.setElementOpacity = function(elem, nOpacity)
{
var opacityProp = this.getOpacityProperty();
if (!elem || !opacityProp) return;
nOpacity = parseFloat(nOpacity) * 100;
if (opacityProp=="filter")
{
try {
if (elem.filters)
{
var oAlpha = elem.filters['DXImageTransform.Microsoft.alpha'] || elem.filters.alpha;
if (oAlpha) {
oAlpha.opacity = nOpacity;
} else {
elem.style.filter += "progid:DXImageTransform.Microsoft.Alpha(opacity="+nOpacity+")";
}
} else {
elem.style.filter += "progid:DXImageTransform.Microsoft.Alpha(opacity="+nOpacity+")";
}
} catch (e) {
//elem.style.filter += "progid:DXImageTransform.Microsoft.Alpha(opacity="+nOpacity+")";
//ie 8
elem.setAttribute("style","-ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(opacity="+nOpacity+")'");
}
} else {
var props = ['MozOpacity', 'KhtmlOpacity', 'opacity'];
for (var i in props) {
if (typeof elem.style[props[i]] == 'string') {
elem.style[props[i]] = nOpacity;
return;
}
}
}
}
this.getOpacityProperty =function()
{
if (typeof document.body.style.opacity == 'string')
return 'opacity';
else if (typeof document.body.style.MozOpacity == 'string')
return 'MozOpacity';
else if (typeof document.body.style.KhtmlOpacity == 'string')
return 'KhtmlOpacity';
else if (_$.isIE)
return 'filter';
return false;
}
this.setOpacity = function(elem, nOpacity) {
if (typeof elem == 'string') elem = Core.$(elem);
if (_$.isIE8)
{
return this.setElementOpacity(elem,nOpacity);
} else {
var props = ['MozOpacity', 'KhtmlOpacity', 'opacity'];
for (var i in props) {
if (typeof elem.style[props[i]] == 'string') {
elem.style[props[i]] = nOpacity;
return;
}
}
/*/ IE 6+*/
try {
/*/alert(nOpacity);*/
nOpacity = 100 * parseFloat(nOpacity);
var oAlpha;
if ((oAlpha = elem.filters['DXImageTransform.Microsoft.alpha'] || elem.filters.alpha))
{
oAlpha.opacity = nOpacity;
/*/alert(oAlpha.opacity);*/
}
else
{
/*alert(elem.runtimeStyle.filter);
obj.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + params[i] + "', sizingMethod=scale)";*/
elem.runtimeStyle.filter += "progid:DXImageTransform.Microsoft.Alpha(opacity="+nOpacity+")";
}
elem.style.backgroundColor = '#FFFFFF';
elem.style.filter += "progid:DXImageTransform.Microsoft.Alpha(opacity="+nOpacity+")";
} catch (e) {
/*/alert(' IE <= 5.5 OR Opera < 9 OR another browser. Do nothing');*/
}
}
}
this.Refresh = function ()
{
Core.UpdateRefreshers();
var nel = new Array();
for (var i = 0 ; i< this.Effects.length ; i++)
{
if (this.Effects[i])
{
var e = this.Effects[i];
if (!e.end)
{
var d = (MSTicker.ticks()+1) - e.lastRefresh;
/*/alert(d);*/
if (d>=e.speed)
{
e.end = true;
if (e.next)
{
for (var i in e.next)
{
e.next[i].lastRefresh = MSTicker.ticks();
nel.push(e.next[i]);
}
}
switch (e.type)
{
case 0 : break;
case 1 :
this.setOpacity(e.target,e.p2);
break;
case 2 :
e.target.style.left=e.p1 + 'px';
e.target.style.top=e.p2 + 'px';
break;
case 3 :
e.target.style.height = e.p2 + 'px';
break;
case 4 :
e.target.style.width = e.p2 + 'px';
break;
case 5 :
e.target.style.width = e.p3 + 'px';
e.target.style.height = e.p4 + 'px';
break;
case 6 :
if (e.p4==1)
{
e.target.style[e.p1] = e.p3 + e.p5;
} else {
e.target.style[e.p1] = 'rgb('+
Math.floor(e.p3['r']) + ','+
Math.floor(e.p3['g']) + ','+
Math.floor(e.p3['b']) +')';
}
break;
case 7 :
if (e.p2 == 1)
{
e.target.style.marginTop = '0px';
} else {
e.target.style.marginTop = -e.p3 +'px';
}
}
if (e.cb)
{
if (e.cbp) {
e.cb(e.cbp);
} else {
e.cb();
}
}
} else {
switch (e.type)
{
case 0 :
break;
case 1 : /*/Opacity*/
var x = (e.p2 - e.p1) / e.speed * d;
this.setOpacity(e.target, e.p1 + x);
if ((e.p1+x)!=0)
{
e.target.style.display='block';
e.target.style.visibility = "inherit";
}
break;
case 2 : /*/Move*/
var d_x = (e.p1 - e.p3) / e.speed * d;
var d_y = (e.p2 - e.p4) / e.speed * d;
e.target.style.left = parseInt(e.p3 + d_x) + 'px';
e.target.style.top = parseInt(e.p4 + d_y) + 'px';
break;
case 3 : /*/ResizeH*/
var d_h = (e.p2 - e.p1) / e.speed * d;
e.target.style.height = (e.p1 + d_h) +'px';
break;
case 4 : /*/ResizeW*/
var d_w = (e.p2 - e.p1) / e.speed * d;
e.target.style.width = (e.p1 + d_w) + 'px';
break;
case 5 : /*/ResizeWH*/
var dd_w = (e.p3 - e.p1) / e.speed * d;
var dd_h = (e.p4 - e.p2) / e.speed * d;
e.target.style.width = (e.p1 + dd_w) + 'px';
e.target.style.height = (e.p2 + dd_h) + 'px';
break;
case 6 : /*/Morph*/
if (e.p4==1)
{
/*/Number morph*/
var d_c = (e.p3 - e.p2) / e.speed * d;
/*/alert(d_c);*/
e.target.style[e.p1] = Math.floor( e.p2 + d_c ) + e.p5;
} else {
/*/Color morph*/
var d_c = d/(e.speed/100)/100;
var startPercent = 1 -d_c;
var finishPercent = d_c;
var aRGBStart = e.p2;
var aRGBFinish = e.p3;
e.target.style[e.p1] = 'rgb('+
Math.floor( aRGBStart['r'] * startPercent + aRGBFinish['r'] * finishPercent ) + ','+
Math.floor( aRGBStart['g'] * startPercent + aRGBFinish['g'] * finishPercent ) + ','+
Math.floor( aRGBStart['b'] * startPercent + aRGBFinish['b'] * finishPercent ) +')';
}
break;
case 7 : /*/Toggle\*/
if (e.p2 == 1)
{
var t_h = e.p3 / e.speed * d;
e.target.style.marginTop = e.p3 - parseInt(t_h) + 'px';
/*/alert('1=' + e.target.style.marginTop);*/
} else {
var t_h = e.p3 / e.speed * d;
e.target.style.marginTop = -parseInt(t_h) + 'px';
/*/alert(t_h);// + 'px';
//alert('2=' + e.target.style.marginTop)*/
}
break;
}
}
if (!e.end) nel.push(e);
}
}
}
this.Effects = nel;
}
}
function Rect(x,y,w,h)
{
this.x = x;
this.y = y;
this.w = w;
this.h = h;
/*/Проверяет текущий квадрат с переданым на предмет вхождения исходного в данный*/
this.Intersect = function (r)
{
var bf = false;
if ((this.x>r.x) && (this.xr.y) && (this.yc.x+c.w) d.x=c.x+c.w-d.w;
if (d.y+d.h>c.y+c.h) d.y=c.y+c.h-d.h;
this.drogable.style.left = d.x +'px';
this.drogable.style.top = d.y + 'px';
}
}
this.Drag_Begin = function(evt)
{
/*/alert(dd);*/
if (dd)
{
var e = Core.Event(evt);
dd.IsDrag = true;
dd.StartXOffset = e.OX;
dd.StartYOffset = e.OY;
dd.lastbase = null;
/*/this.DragDrop.drogable.style.left = e.pageX - e.offsetX + 'px';
//this.DragDrop.drogable.style.top = e.pageY - e.offsetY + 'px';*/
if (dd.CallBack) dd.CallBack(dd,'begin',null);
}
if (e.stopPropagation)
e.stopPropagation(); else e.cancelBubble=true;
Core.addHandler(Core.B(),'mousemove', dd.Draging);
Core.addHandler(Core.B(),'mouseup',dd.Drop);
return false;
}
this.Draging = function(evt)
{
/*/var dd = this.DragDrop;*/
if (dd)
{
if (dd.IsDrag)
{
var e = Core.Event(evt);
dd.drogable.style.left = e.pageX - dd.StartXOffset + 'px';
dd.drogable.style.top = e.pageY - dd.StartYOffset + 'px';
dd.CheckBase(false);
dd.CheckContainer();
if (dd.CallBack) dd.CallBack(dd,'move',null);
}
}
}
this.CheckBase = function (isdrop)
{
var d = new Rect(Core.X(this.drogable),Core.Y(this.drogable),Core.W(this.drogable),Core.H(this.drogable));
var ok = false;
for (var i in this.bases)
{
if (this.bases[i])
{
var b = new Rect(Core.X(this.bases[i]),Core.Y(this.bases[i]),Core.W(this.bases[i]),Core.H(this.bases[i]));
if (d.Intersect(b)) {
if (isdrop)
{
ok = true;
if (this.CallBack) this.CallBack(this,'drop',this.bases[i]);
} else {
ok = true;
if (this.lastbase!=this.bases[i])
{
if (this.CallBack) this.CallBack(this,'over',this.bases[i]);
this.lastbase = this.bases[i];
} else {
if (this.CallBack) this.CallBack(this,'overmove',this.bases[i]);
}
}
}
}
}
if (!ok) if (this.lastbase) {
if (this.CallBack) this.CallBack(this,'leave',this.lastbase);
this.lastbase = null;
}
if (ok) return true;
}
this.Drop = function(evt)
{
/*/var dd = this.getAttribute('DragDrop');*/
if (dd)
{
if (dd.IsDrag)
{
dd.Draging(evt);
dd.IsDrag=false;
if (!dd.CheckBase(true))
{
if (dd.CallBack) dd.CallBack(dd,'drop',null);
}
Core.removeHandler(Core.B(),'mousemove', dd.Draging);
Core.removeHandler(Core.B(),'mouseup', dd.Drop);
}
}
}
Core.addHandler(this.drogable,'mousedown', this.Drag_Begin);
Core.addHandler(this.drogable,'mousemove', this.Draging);
Core.addHandler(this.drogable,'mouseup',this.Drop);
}
function Scroll(cont,butt,cb)
{
var thisScroll = this;
this.Callback = cb;
this.cont = cont;
this.butt = butt;
this.Max = 100;
this.Min = 0;
this.Value = 0;
this.Vertical = false;
this.CalcValue = function()
{
var c = Core.Rect(this.cont);
var b = Core.Rect(this.butt);
var v = 0;
if (this.Vertical)
{
v = this.Min + parseInt((b.y-c.y) / ((c.h-b.h) / (this.Max - this.Min)));
} else {
v = this.Min + parseInt((b.x-c.x) / ((c.w-b.w) / (this.Max - this.Min)));
}
if (vthis.Max) v =this.Max;
this.Value = v;
}
this.dcallback = function(dd,e,base)
{
switch(e)
{
case "overmove":
thisScroll.CalcValue();
if (thisScroll.Callback) thisScroll.Callback(thisScroll);
break;
}
}
this.FixScroller = function()
{
if (!thisScroll.drag.IsDrag)
{
if (thisScroll.ValuethisScroll.Max) thisScroll.Value=thisScroll.Max;
var c = Core.Rect(thisScroll.cont);
var b = Core.Rect(thisScroll.butt);
/*/alert(c);*/
if (thisScroll.Vertical)
{
thisScroll.butt.style.top = c.y + (c.h-b.h) / (thisScroll.Max-thisScroll.Min)*(thisScroll.Value-thisScroll.Min);
thisScroll.butt.style.left = c.x;
} else {
thisScroll.butt.style.top = c.y;
thisScroll.butt.style.left = c.x + (c.w-b.w) / (thisScroll.Max-thisScroll.Min)*(thisScroll.Value-thisScroll.Min);
}
}
}
window.setInterval(this.FixScroller,10);
this.drag = new DragDrop(this.butt,this.cont,this.dcallback,this.cont);
}
function domReady( f ) {
if ( domReady.done ) {
domReady.done = false;
return f();
}
if ( domReady.timer ) {
domReady.ready.push( f );
} else {
if (window.addEventListener)
window.addEventListener('load',isDOMReady, false);
else if (window.attachEvent)
window.attachEvent('onload',isDOMReady);
domReady.ready = [ f ];
domReady.timer = setInterval( isDOMReady, 13 );
}
}
function isDOMReady(){
if ( domReady.done ) return false;
if ( document && document.getElementsByTagName && document.getElementById && document.body ) {
clearInterval( domReady.timer );
domReady.timer = null;
domReady.done = true;
try {
for ( var i = 0; i < domReady.ready.length; i++ )
{
domReady.ready[i]();
}
} catch (e) {}
domReady.ready = null;
}
}
DOMReady = function(func){
var already = false;
ready = function () {
if (!already) {
func();
already = true;
}
};
try {/*/opera, firefox*/
document.addEventListener("DOMContentLoaded", ready, false);
}
catch (e) { /*/ie*/
timer = setInterval(function(){
if (/loaded|complete/.test(document.readyState)) {
clearInterval(timer);
ready();
}
}, 10);
}
window.onload = function(){
ready();
};
};
DOMReady2 = function(frm,func){
var already = false;
ready = function () {
if (!already) {
func();
already = true;
}
};
try {/*/opera, firefox*/
frm.contentDocument.addEventListener("DOMContentLoaded", ready, false);
}
catch (e) { /*/ie*/
timer = setInterval(function(){
if (/loaded|complete/.test(document.readyState)) {
clearInterval(timer);
ready();
}
}, 10);
}
window.onload = function(){
ready();
};
};
DOMReady3 = function(func){
var already = false;
ready = function () {
if (!already) {
func();
already = true;
}
};
try {//opera, firefox
document.addEventListener("DOMContentLoaded", ready, false);
}
catch (e) { //ie
timer = setInterval(function(){
if (/loaded|complete/.test(document.readyState)) {
clearInterval(timer);
ready();
}
}, 10);
}
window.onload = function(){
ready();
};
};
String.prototype.replaceAll = function(f,m)
{
var nString = new String();
var i;
for (i=0;i(-(_this.parent.Rows_.length*_this.parent.Rows_H-parseInt(_this.parent.UI['ROWS_C'].style.height)))) {
Effects.add(new Effect(_this.parent.UI['ROWS'],200).Morph('top',parseInt(_this.parent.UI['ROWS'].style.top),parseInt(_this.parent.UI['ROWS'].style.top)-_this.parent.Rows_H));
}
}
this.ScrollUp = function()
{
if (parseInt(_this.parent.UI['ROWS'].style.top)<0) {
var nt = parseInt(_this.parent.UI['ROWS'].style.top)+_this.parent.Rows_H;
if (nt>0) nt = 0;
Effects.add(new Effect(_this.parent.UI['ROWS'],200).Morph('top',parseInt(_this.parent.UI['ROWS'].style.top),nt));
}
}
this.onBMouseOver = function(e)
{
_this.UI['SCROLLER'].className = 'fxAjaxTable_Scroller_But_A';
//_this.UI['SCROLLER'].framesSet('ACTIVE');
}
this.onBMouseUp = function(e)
{
_this.UI['SCROLLER'].className = 'fxAjaxTable_Scroller_But_A';
//_this.UI['SCROLLER'].framesSet('ACTIVE');
if (_this.DD_Begin)
{
_this.DD_Begin = false;
Core.removeHandler(_this.UI['SCROLLER'].$,'mousemove',_this.onBMouseMove);
Core.removeHandler(Core.B(),'mousemove',_this.onBMouseMove);
Core.removeHandler(Core.B(),'mouseup',_this.onBMouseUp);
}
}
this.onBMouseMove = function(e)
{
if (_this.DD_Begin)
{
e=Core.Event(e);
if (_this.parent.Rows_.length*_this.parent.Rows_H > parseInt(_this.parent.UI['ROWS_C'].style.height))
{
var t = parseInt(_this.UI['SCROLLER'].$.style.top);
var tn = t + (e.pageY - _this.DD_YOff);
if (tn<17) tn = 17;
var mt = parseInt(_this.$.style.height)-17 - parseInt(_this.UI['SCROLLER'].$.style.height);
if (tn> mt) {
tn =mt;
if (_this.DD_YOff>e.pageY)
{
_this.ScrollUp();
} else {
_this.ScrollDown();
}
} else {
var tt = (parseInt(_this.parent.Rows_.length*_this.parent.Rows_H)-parseInt(_this.parent.UI['ROWS_C'].style.height)) / (mt-17);
var ny = tn * tt
_this.parent.UI['ROWS'].style.top = -ny;
}
_this.UI['SCROLLER'].$.style.top = tn;
_this.DD_YOff = e.pageY;
}
}
}
this.onBMouseDown = function(e)
{
e = Core.Event(e);
if (!_this.DD_Begin)
{
_this.DD_Begin = true;
_this.DD_XOff = e.pageX;
_this.DD_YOff = e.pageY;
Core.addHandler(_this.UI['SCROLLER'].$,'mousemove',_this.onBMouseMove);
Core.addHandler(Core.B(),'mousemove',_this.onBMouseMove);
Core.addHandler(Core.B(),'mouseup',_this.onBMouseUp);
}
_this.UI['SCROLLER'].className = 'fxAjaxTable_Scroller_But_P';
//_this.UI['SCROLLER'].framesSet('PRESSED');
}
this.onBMouseOut = function(e)
{
_this.UI['SCROLLER'].className = 'fxAjaxTable_Scroller_But';
//_this.UI['SCROLLER'].framesSet('NORMAL');
}
this.onResize = function()
{
try {
if (this.parent.PAGER_Count_==0)
{
this.$.style.left = this.parent.getWidth()-17;
if (this.parent.UI['COLUMBS'].style.display=='block') {
this.$.style.top = 20;
this.$.style.height = this.parent.getHeight()-20;
} else {
this.$.style.top = 0;
this.$.style.height = this.parent.getHeight();
}
this.UI['SCROLLER'].$.style.left = 0;
this.UI['SCROLLER'].$.style.top = 17;
this.UI['S_DOWN'].$.style.top = parseInt(this.$.style.height) - 17;
this.UI['BACKIMG'].style.height = this.$.style.height;
} else {
this.$.style.left = this.parent.getWidth()-17;
if (this.parent.UI['COLUMBS'].style.display=='block') {
this.$.style.height = this.parent.getHeight()-60;
this.$.style.top = 40;
} else {
this.$.style.height = this.parent.getHeight()-40;
this.$.style.top = 20;
}
this.UI['SCROLLER'].$.style.left = 0;
this.UI['SCROLLER'].$.style.top = 17;
this.UI['S_DOWN'].$.style.top = parseInt(this.$.style.height) - 17;
this.UI['BACKIMG'].style.height = this.$.style.height;
}
} catch (e) {}
}
this._init = this._init(parent);
}
function fxTableRow(parent,data)
{
var _this = this;
this._init = function(parent,data)
{
var _this = this;
this.data = data;
this.parent = parent;
var w = parent.getWidth();
this.$ = Core.New('DIV' ,
{
s_position : 'absolute',
s_width : _this.parent.getWidth(),
s_height : _this.parent.Rows_H,
s_left : 0,
s_top : 0,
className: 'fxAjaxTable_Row'
} );
this.parent.UI['ROWS'].appendChild(this.$);
this.UI = new Array();
this.UI['Cells'] = new Array();
this._initCells();
Core.addHandler(this.$,'mouseover',this.onMouseOver);
Core.addHandler(this.$,'mouseout',this.onMouseOut);
Core.addHandler(this.$,'click',this.onClick);
Core.addHandler(this.$,'dblclick',this.onDblClick);
Core.addHandler(this.$,'contextmenu',this.onContext);
}
this.onDblClick = function(e)
{
_this.parent.CallBack(_this.parent,'rowdblclick',_this.data);
}
this.onContext = function(e)
{
if (_this!=_this.parent.SelectedRow)
{
if (_this.parent.SelectedRow)
{
_this.parent.SelectedRow.$.className='fxAjaxTable_Row';
}
_this.parent.SelectedRow = _this;
_this.$.className='fxAjaxTable_Row_S';
_this.parent.CallBack(_this.parent,'rightclick',_this.data);
return false;
}
}
this.onClick = function(e)
{
//var params = new Array();
//alert('click');
if (_this!=_this.parent.SelectedRow)
{
if (_this.parent.SelectedRow)
{
_this.parent.SelectedRow.$.className='fxAjaxTable_Row';
}
_this.parent.SelectedRow = _this;
_this.$.className='fxAjaxTable_Row_S';
_this.parent.CallBack(_this.parent,'rowclick',_this.data);
} else {
_this.onDblClick(e);
}
}
this.onMouseOver = function(e)
{
if (_this.parent.SelectedRow == _this)
{
_this.$.className='fxAjaxTable_Row_S';
} else {
_this.$.className='fxAjaxTable_Row_A';
}
}
this.onMouseOut = function(e)
{
if (_this.parent.SelectedRow == _this)
{
_this.$.className='fxAjaxTable_Row_S';
} else {
_this.$.className='fxAjaxTable_Row';
}
}
this.onResize = function()
{
try {
var i;
this.$.style.width = this.parent.getWidth();
for (i in this.UI['Cells'])
{
this.UI['Cells'][i][0].style.left = this.parent.Columbs_[i].$.style.left;
this.UI['Cells'][i][0].style.width = this.parent.Columbs_[i].$.style.width;
this.UI['Cells'][i][1].style.width = this.UI['Cells'][i][0].style.width;
}
} catch (e) { }
}
this._initCells = function()
{
var _this = this;
for (i in this.UI['Cells'])
{
this.$.removeChild(this.UI['Cells'][i][0]);
}
for (i in this.data)
{
//alert(this.parent.Columbs_[i]);
this.UI['Cells'][i] = new Array();
this.UI['Cells'][i][0] = Core.New('DIV',
{ s_position : 'absolute',
s_left : (_this.parent.Columbs_[i].$.style.left),
s_top : 0,
s_width : (_this.parent.Columbs_[i].$.style.width),
s_height : _this.parent.Rows_H,
s_borderRight : '1px dotted #AAAAAA',
s_overflow : 'hidden'
} );
this.UI['Cells'][i][1] = Core.New('DIV',
{
s_position : 'absolute',
s_left : 0,
s_top : 0,
s_width : (_this.parent.Columbs_[i].$.style.width),
s_height: _this.parent.Rows_H,
s_lineHeight: _this.parent.Rows_H + 'px',
s_verticalAlign: 'top',
s_paddingLeft : 4,
s_paddingTop : 2,
s_fontSize : '10pt'} );
this.UI['Cells'][i][1].innerHTML = this.data[i];
this.UI['Cells'][i][0].appendChild(this.UI['Cells'][i][1]);
this.$.appendChild(this.UI['Cells'][i][0]);
}
}
this._init = this._init(parent,data);
}
function fxTableColumb(key,caption,width,type,parent)
{
var _this = this;
this.key = key;
this.caption = caption;
this.type = type;
this.sort = 'up';
this.width = width;
this.$ = null;
this.parent = parent;
this.setState = function(s)
{
}
this.onMouseDown = function(e)
{
_this.$.className="fxAjaxTable_Columb_A";
_this.setState('PRESSED');
}
this.onMouseUp = function(e)
{
_this.$.className="fxAjaxTable_Columb_S";
_this.setState('NORMAL');
}
this.onMouseOver = function(e)
{
_this.$.className="fxAjaxTable_Columb_S";
_this.setState('ACTIVE');
}
this.onMouseOut = function(e)
{
_this.$.className="fxAjaxTable_Columb";
_this.setState('NORMAL');
}
this.hideSArrow = function()
{
this.UI['S_UP'].style.display='none';
this.UI['S_DOWN'].style.display='none';
}
this.onClick = function(e)
{
_this.hideSArrow();
if (_this.sort=='up')
{
_this.sort='down';
_this.UI['S_DOWN'].style.display='block';
} else {
_this.sort='up';
_this.UI['S_UP'].style.display='block';
}
_this.parent.Sort(_this);
}
this.getWidth = function()
{
var w;
if (this.width)
{
w = parseInt(this.width);
if (this.width.indexOf("%")!=-1)
{
w = this.parent.width / 100 * (parseInt(this.width));
}
} else {
w = this.parent.getWidth();
var i;
for (i in this.parent.Columbs_)
{
if (this.parent.Columbs_[i]!=this)
{
var ww = this.parent.Columbs_[i].getWidth();
if (ww) w=w-ww;
}
}
}
return parseInt(w);
}
this.onResize = function()
{
try {
var w = this.getWidth();
this.$.style.width = w;
this.UI['S_UP'].style.left = w - 15;
this.UI['S_DOWN'].style.left = w-15;
} catch (e) {}
}
this.Init = function(parentdiv)
{
//Вычисляем ширину колонки
var w = this.getWidth();
this.$ = Core.New('DIV',
{
s_position : 'absolute',
s_width : w,
s_height : 20,
s_top : 0,
s_left : 0,
s_overflow : 'hidden',
className : 'fxAjaxTable_Columb'
} );
this.UI = new Array();
this.UI['Caption'] = Core.New('DIV', {
s_position : 'absolute',
s_width : w,
s_height: 20,
s_top : 0,
s_left : 0,
s_paddingLeft : '4px',
s_fontSize : '10pt',
s_lineHeight: '20px',
s_verticalAlign: 'middle'
} );
this.UI['Caption'].innerHTML = this.caption;
this.UI['S_UP'] = Core.New('IMG', {
s_position : 'absolute',
s_top : 6,
s_left : w - 15,
s_display : 'none',
src : 'http://21200.ru/js/fxLib/themedef/fxTable/up.gif' } );
this.UI['Caption'].appendChild(this.UI['S_UP']);
this.UI['S_DOWN'] = Core.New('IMG', {
s_position : 'absolute',
s_top : 6,
s_left : w - 15,
s_display : 'none',
src : 'http://21200.ru/js/fxLib/themedef/fxTable/down.gif' } );
this.UI['Caption'].appendChild(this.UI['S_DOWN']);
this.$.appendChild(this.UI['Caption']);
//this.$.appendChild(document.createTextNode(this.caption));
parentdiv.appendChild(this.$);
Core.addHandler(this.$,'mouseover',this.onMouseOver);
Core.addHandler(this.$,'mouseout',this.onMouseOut);
Core.addHandler(this.$,'mousedown',this.onMouseDown);
Core.addHandler(this.$,'mouseup',this.onMouseUp);
Core.addHandler(this.$,'click',this.onClick);
}
}
function fxAjaxTable(x,y,w,h,p,cb,params)
{
var _this = this;
this._extend = make_extend(this,new fxControl(x,y,w,h,p,cb));
this.Size_ = this.Size;
this.Size = function(w,h)
{
this.Size_(w,h);
this.onResize();
}
this.Columbs_ = new Array();
this.SelectedRow = null;
this.Rows_ = new Array();
this.Rows_H = (params && params['Rows_H']) ? params['Rows_H'] : 40 ;
this.Rows_Add = function(data)
{
var nr = new fxTableRow(this,data);
nr.$.style.top = this.Rows_.length * this.Rows_H;
this.Rows_.push(nr);
}
this.Rows_Clear = function()
{
var i;
for (i in this.Rows_)
{
this.UI['ROWS'].removeChild(this.Rows_[i].$);
}
this.Rows_ = new Array();
this.SelectedRow = null;
this.UI['ROWS'].style.top = '0px';
}
this.COLUMB_Clear = function()
{
var i;
for (i in this.Columbs_)
{
if (this.Columbs_[i]) this.UI['COLUMBS'].removeChild(this.Columbs_[i].$);
}
this.Columbs_ = new Array();
}
this.COLUMB_Add = function(key,caption,width,type)
{
var nc = new fxTableColumb(key,caption,width,type,this);
nc.Init(this.UI['COLUMBS']);
this.Columbs_.push(nc);
this.onResize();
}
this.Sort_Spl = function(r1,r2)
{
var r2t = this.Rows_[r2];
this.Rows_[r2] = this.Rows_[r1];
this.Rows_[r1] = r2t;
}
this.Sort_Down = function(i,i1,i2)
{
switch(this.Columbs_[i].type)
{
case "NUMBER":
if (parseFloat(this.Rows_[i1].data[i])parseFloat(this.Rows_[i2].data[i]))
{
this.Sort_Spl(i1,i2);
}
break;
case "TEXT":
if (this.Rows_[i1].data[i]>this.Rows_[i2].data[i])
{
this.Sort_Spl(i1,i2);
}
break;
}
}
this.Sort = function(col)
{
var i;
var ii;
for (ii in this.Columbs_)
{
if (this.Columbs_[ii]==col) {
i=ii;
} else {
this.Columbs_[ii].hideSArrow();
}
}
var i1;
var i2;
for (i1 in this.Rows_)
{
for (i2 in this.Rows_)
{
if (this.Columbs_[i].sort=='up')
{
this.Sort_Up(i,i1,i2);
} else {
this.Sort_Down(i,i1,i2);
}
}
}
this.onResize();
}
this.PAGER_Count_ = 0;
this.PAGER_GETCOUNT = function() { return this.PAGER_Count_; }
this.PAGER_SETCOUNT = function(c)
{
this.PAGER_Count_ = c;
var b = null;
if (this.UI['PAGER_UP_BUTTONS'].length>c)
{
for (var i = c;i>0;i--)
{
b=this.UI['PAGER_UP_BUTTONS'].pop;
Core.removeHandler(b.$,'click',this.onPager);
this.UI['PAGER_UP'].removeChild(b.$);
b=this.UI['PAGER_DOWN_BUTTONS'].pop;
Core.removeHandler(b.$,'click',this.onPager);
this.UI['PAGER_DOWN'].removeChild(b.$);
}
} else {
var is = this.UI['PAGER_UP_BUTTONS'].length;
for (var i = is;i0)
{
for(var i = 0;i0) _this.DOM_All_r(arr,p.childNodes.item(i),tag);
}
}
}
}
this.delTempNodes = function()
{
var nodes = new Array();
var alls = _this.DOM_All(_this.iDoc,"STYLE");
if (alls.length>0)
{
for (var i=0;i0)
{
for (var i=0;i0)
{
for (var i=0;i0)
{
for (var i=0;i0) {
var c;
if (Core.isIE)
{
c = nodes[i].innerText;
} else {
c = nodes[i].textContent;
}
for (var j=0;j0)
{
for (var i=0;i0)
{
for (var i=0;i0)
{
for (var i=0;i0) && (p.childNodes.item(i-1)==n)) return p.childNodes.item(i);
}
}
return false;
}
this.DOM_Next = function(n)
{
var p = n.parentNode;
if (p.childNodes)
{
for(var i=0;i 0 ? s.getRangeAt(0) : (s.createRange ? s.createRange() : _this.iDoc.createRange());
}
} catch (ex) {}
if (!r)
r = Core.isIE ? _this.iDoc.body.createTextRange() : _this.iDoc.createRange();
return r;
}
this.nodeList = function (parentNode, list, level)
{
var i, node, count;
if (!list) list = new Array();
level++;
for (i = 0; i < parentNode.childNodes.length; i++) {
node = parentNode.childNodes[i];
if (node.nodeType != 1) continue;
count = list.length;
list[count] = new Array();
list[count][0] = node;
list[count][1] = level;
_this.nodeList(node, list, level);
}
return list;
}
this.rgbNormal = function(color)
{
color = color.toString();
var re = /rgb\((.*?)\)/i;
if(re.test(color))
{
compose = RegExp.$1.split(",");
var hex = ['0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'];
var result = "#";
for (var i = 0; i < compose.length; i++)
{
rgb = parseInt(compose[i]);
result += hex[parseInt(rgb / 16)] + hex[rgb % 16];
}
return result;
} else return color;
}
this.execCommandImitation = function(start, end)
{
_this.execCommand("ForeColor", false, "#f5F856");
var allNodes = this.nodeList(this.iDoc.body, false, 0);
var maxLevel = 0;
for (i = 0; i < allNodes.length; i++)
{
maxLevel = allNodes[i][1] > maxLevel ? allNodes[i][1] : maxLevel;
}
var node, newnode, color, parent;
for (j = maxLevel; j >= 1; j--)
{
for (i = 0; i < allNodes.length; i++)
{
if (allNodes[i][1] != j) continue;
node = allNodes[i][0];
sname = node.nodeName.toLowerCase();
color = node.color ? _this.rgbNormal(node.color) : _this.rgbNormal(node.style.color);
if (color) color = color.toLowerCase();
if (sname == "font" || sname == "span" && color == "#f5f856")
{
try {
node.innerHTML = start + node.innerHTML + end;
} catch(e) {}
parent = node.parentNode;
while (node.childNodes.length > 0) parent.insertBefore(node.firstChild, node);
parent.removeChild(node);
}
}
}
_this.SetFocus();
}
this.getSelection = function ()
{
if (Core.isIE)
{
return _this.iDoc.selection;
} else {
return _this.iWin.getSelection();
}
}
this.saveSelection = function()
{
if (Core.isIE)
_this.savedSelection = _this.iDoc.selection.createRange();
}
this.restoreSelection = function()
{
if (Core.isIE)
if (_this.savedSelection) _this.savedSelection.select();
}
this.insertHTML = function(nhtml)
{
_this.SetFocus();
if (Core.isIE)
{
try {
var oRng = _this.iDoc.selection.createRange();
oRng.pasteHTML(nhtml);
oRng.collapse(false);
oRng.select();
} catch(e){}
} else {
try {
_this.iDoc.execCommand('insertHTML', false, nhtml);
} catch(e) {}
}
}
this.cssAdd = function (text)
{
var css = _this.iDoc.createElement('STYLE');
css.src = text;
_this.iDoc.body.appendChild(css);
}
this.setHTML = function (nhtml)
{
_this.iDoc.body.innerHTML = nhtml;
_this.onHandlers();
}
this.getHTML = function ()
{
return _this.iDoc.body.innerHTML;
}
this.SetFocus = function ()
{
if(_this.iWin.focus) _this.iWin.focus();
_this.iDoc.body.focus();
}
this.Bold = function()
{
_this.execCommand('bold', null, "");
}
this.Italic = function()
{
_this.execCommand('italic',null,'');
}
this.Underline = function()
{
_this.execCommand('underline',null,'');
}
this.FontName = function(name)
{
_this.execCommand('FontName',null,name);
}
this.FontSize = function(size)
{
_this.execCommand('FontSize',null,size);
}
this._initHTML = this._initHTML();
}function fxToolBarButton(params)
{
var _this = this;
this.params = params;
this.parent = null;
this.$ = Core.New('DIV', {
s_position: 'absolute',
s_padding : '0px',
s_margin : '0px',
s_top: '0',
s_left: '0' } );
switch (this.params['type'])
{
case "s":
this.$.style.width = '10';
this.$.className = 'fxToolBarButton_S';
this.$.style.backgroundImage = "url("+Core.CI_Get('fxToolbar_s').src+")";
break;
case "b":
this.$.style.width = '28';
this.$.className = 'fxToolBarButton_B_N';
this.$.style.backgroundImage = "url("+Core.CI_Get('fxToolbar_n').src+")";
if (this.params['img'])
{
this.img = Core.New('IMG',
{
s_position : 'absolute',
s_top: 4,
s_left : 4,
src : _this.params['img'] } );
this.$.appendChild(this.img);
}
Core.addHandler(this.$,'mouseover', function (e)
{
e = Core.Event(e);
_this.$.className='fxToolBarButton_B_A';
_this.$.style.backgroundImage = "url("+Core.CI_Get('fxToolbar_a').src+")";
if (_this.params['tooltip'])
{
Core.PopupTooltip(_this.$,0,30,_this.params['tooltip']);
}
} );
Core.addHandler(this.$,'mousedown', function(e)
{
_this.$.style.backgroundImage = "url("+Core.CI_Get('fxToolbar_p').src+")";
} );
Core.addHandler(this.$,'mouseup', function (e)
{
_this.$.style.backgroundImage = "url("+Core.CI_Get('fxToolbar_a').src+")";
} );
Core.addHandler(this.$,'mouseout',function (e)
{
e = Core.Event(e);
_this.$.className = 'fxToolBarButton_B_N';
_this.$.style.backgroundImage = "url("+Core.CI_Get('fxToolbar_n').src+")";
} );
Core.addHandler(this.$,'click', function (e)
{
e = Core.Event(e);
if (_this.type != 's')
{
if (_this.params['CallBack'])
{
_this.params['CallBack'](_this,'click');
} else
if (_this.parent)
{
if(_this.parent.CallBack)
{
_this.parent.CallBack(_this.parent,'click',_this.params['id']);
}
}
}
} );
break;
}
}
function fxToolbar(x,y,w,h,p,cb)
{
var _this = this;
make_extend(this,new fxControl(x,y,w,h,p,cb));
//Кеширование рисунков
Core.CI_Add('http://21200.ru/js/fxLib/themedef/fxToolbar/bg.jpg','fxToolbar_bg');
Core.CI_Add('http://21200.ru/js/fxLib/themedef/fxToolbar/sep.jpg','fxToolbar_s');
Core.CI_Add('http://21200.ru/js/fxLib/themedef/fxToolbar/n.jpg','fxToolbar_n');
Core.CI_Add('http://21200.ru/js/fxLib/themedef/fxToolbar/a.jpg','fxToolbar_a');
Core.CI_Add('http://21200.ru/js/fxLib/themedef/fxToolbar/p.jpg','fxToolbar_p');
this.buttons = new Array();
this.getRect = function(id)
{
for (var i in this.buttons)
{
if (this.buttons[i].params)
{
if ((this.buttons[i].params['id']) && (this.buttons[i].params['id']==id))
{
if (this.buttons[i].$)
{
return new AB_( {x : Core.X(this.buttons[i].$), y : Core.Y(this.buttons[i].$)} );
}
}
}
}
}
this.addBut = function(newBut)
{
if (newBut)
{
newBut.parent = _this;
_this.$.appendChild(newBut.$);
_this.buttons.push(newBut);
}
_this.onResize();
}
this.onResize = function()
{
var i;
var bf=true;
var ip = null;
var tx = 0;
for (i in _this.buttons)
{
if (_this.buttons[i])
{
_this.buttons[i].$.style.left = tx;
tx = tx + Core.W(_this.buttons[i].$);
}
}
}
this._Size = this.Size;
this.Size = function(w,h)
{
this._Size(w,h);
}
this.initHTML_ = function()
{
this.$.style.backgroundImage = "url("+Core.CI_Get('fxToolbar_bg').src+")";
this.$.className = 'fxToolBar';
this.UI = new Array();
this.parent.$.appendChild(this.$);
}
this.initHTML_ = initHTML(this);
}
function fxListBox(x,y,w,h,p,cb)
{
//Кешируем изображение
Core.CI_Add('http://21200.ru/js/fxLib/themedef/fxListBox/skin.gif','fxListBox');
Core.CI_Add('http://21200.ru/js/fxLib/themedef/fxListBox/ui.gif','fxListBoxUI');
var _this = this;
make_extend(this,new fxControl(x,y,w,h,p,cb));
this.items = new Array();
this.items_active = null;
this.popupList = function()
{
var dmenuDiv = Core.OS_New('fxListBoxDmenuDiv', function ()
{
var ret = Core.New('DIV',
{
s_display: 'block',
s_position: 'absolute',
s_left : 0,
s_top : 0
} );
if (_this.items && _this.items.length>0)
{
for (var i in _this.items)
{
var t_fontFamily = 'Arial';
var t_fontSize = '10pt';
if (_this.items[i].fontFamily) t_fontFamily = _this.items[i].fontFamily;
if (_this.items[i].fontSize) t_fontSize = _this.items[i].fontSize;
var t = Core.New('DIV',
{
s_fontFamily : t_fontFamily,
s_fontSize : t_fontSize,
className : 'DropMenuItem'
} );
t.appendChild(document.createTextNode(_this.items[i].Text));
t._index = i;
Core.addHandler(t,'mouseover', function (e)
{ e=Core.Event(e);
e.target.className = 'DropMenuItem_a'; });
Core.addHandler(t,'mouseout', function (e)
{ e = Core.Event(e);
e.target.className = 'DropMenuItem'; } );
Core.addHandler(t,'click', function (e)
{
e=Core.Event(e);
_this.items_active = _this.items[e.target._index];
_this.SetText(_this.items_active.Text);
_this.CallBack(_this,'select',_this.items[e.target._index]);
var o = Core.OS_Get('fxListBox_bg_popup');
var d = Core.OS_Get('fxListBoxDmenuDiv');
if (o)
{
Core.XBODY().removeChild(o);
Core.OS_Del('fxListBox_bg_popup');
}
if (d) {
d.style.display = 'none';
Core.XBODY().removeChild(d);
Core.OS_Del('fxListBoxDmenuDiv');
}
} );
ret.appendChild(t);
}
}
return ret;
} );
var bg_popup = Core.OS_New('fxListBox_bg_popup',function()
{
var ret = Core.New('DIV',
{
s_display : 'block',
s_position : 'absolute',
s_background : '#FFFFFF',
s_left : 0,
s_top : 0,
s_width : Core.W(Core.XBODY()),
s_height : Core.H(Core.XBODY()) });
Core.addHandler(ret,'click', function()
{
var o = Core.OS_Get('fxListBox_bg_popup');
var d = Core.OS_Get('fxListBoxDmenuDiv');
if (o)
{
Core.XBODY().removeChild(o);
Core.OS_Del('fxListBox_bg_popup');
}
if (d) {
d.style.display = 'none';
Core.XBODY().removeChild(d);
Core.OS_Del('fxListBoxDmenuDiv');
}
} );
return ret;
});
dmenuDiv.style.left = Core.X(_this.$);
dmenuDiv.style.top = Core.Y(_this.$)+_this.height;
bg_popup.style.zIndex = Core.MaxZOrder();
dmenuDiv.style.zIndex = Core.MaxZOrder();
dmenuDiv.style.display = 'block';
Core.XBODY().appendChild(bg_popup);
Effects.setOpacity(bg_popup,0.1);
Core.XBODY().appendChild(dmenuDiv);
}
this.items_clear = function()
{
_this.items = new Array();
}
this.items_add = function(newItem)
{
if (_this.items) {
_this.items.push(newItem);
} else { _this.items_clear(); }
}
this.items_del = function(index)
{
if (_this.items)
{
if (_this.items[index])
{
var titems = new Array();
for (var i in _this.items)
{
if (i!=index) titems.push(_this.items[i]);
}
_this.items = titems;
}
}
}
this.SetText = function(newText)
{
_this.UI['text'].innerHTML = newText;
}
this._Size = this.Size;
this.Size = function(w,h)
{
this._Size(w,h);
this.UI['ui'].$.style.left = this.width - 20;
with (this.UI['text'].style)
{
top = 0;
left = 0;
width = this.width;
height = this.height;
}
}
this.UICallBack = function (elm,event,param)
{
if (elm == _this.UI['ui'])
{
if (event=='mouseover') _this.UI['ui'].SetFrame('ACTIVE');
if (event=='mouseout') _this.UI['ui'].SetFrame('NORMAL');
if (event=='mousedown') _this.UI['ui'].SetFrame('PRESSED');
if (event=='mouseup') _this.UI['ui'].SetFrame('ACTIVE');
if (event=='click')
{
if (_this.CallBack) _this.CallBack(_this,'dropmenu');
}
}
}
//this.$.style.background = 'none';
this.initHTML_ = function()
{
this.UI = new Array();
this.UI['left_1'] = Core.New('IMG',
{
s_display: 'block',
s_border: 'none',
s_position: 'absolute',
s_left : 0,
s_width : 600,
s_top : 0,
border : 0,
src : Core.CI_Get('fxListBox').src } );
this.$.appendChild(this.UI['left_1']);
this.UI['left_2'] = Core.New('IMG',
{
s_display: 'none',
s_border: 'none',
s_position: 'absolute',
s_left : 0,
s_width : 600,
s_top : 0,
border : 0,
src : Core.CI_Get('fxListBox').src } );
this.$.appendChild(this.UI['left_2']);
this.UI['text'] = Core.New('DIV',
{
s_position: 'absolute',
s_left: 0,
s_top: 0,
s_fontSize : '10pt',
s_color: '#000000',
s_width: _this.width,
s_height: _this.height,
s_paddingLeft : 10,
s_paddingTop : 2,
s_minHeight: _this.height,
s_verticalAlign: 'middle' } );
this.UI['text'].appendChild(document.createTextNode('tst'));
this.$.appendChild(this.UI['text']);
this.UI['ui'] = new fxIButton(_this.width-20,0,20,21,_this,_this.UICallBack,Core.CI_Get('fxListBoxUI').src);
with (this.UI['ui'])
{
AddFrame('NORMAL',0,0);
AddFrame('ACTIVE',0,21);
AddFrame('PRESSED',0,42);
SetFrame('NORMAL');
}
this.parent.$.appendChild(this.$);
Core.addHandler(this.$,"mouseover",this.mouseover);
Core.addHandler(this.$,"mouseout",this.mouseout);
Core.addHandler(this.$,"mousedown",this.mousedown);
Core.addHandler(this.$,"mouseup",this.mouseup);
Core.addHandler(this.$,"click",this.click);
}
this.UIFrame = 0;
this.StateChange = function(state)
{
var nTop = 0;
switch (state)
{
case "active":
nTop = -21;
break;
case "normal":
nTop = 0;
break;
case "pressed":
nTop = -42;
break;
}
if (this.UIFrame == 0)
{
this.UI['left_1'].style.top = nTop;
this.UIFrame = 1;
return true;
}
if (this.UIFrame == 1)
{
this.UI['left_2'].style.top = nTop;
if (Core.isMSIE)
{
this.UI['left_1'].style.display='none';
this.UI['left_2'].style.display='block';
} else {
Effects.add(new Effect(this.UI['left_1'],500).Opacity(1,0));
Effects.add(new Effect(this.UI['left_2'],500).Opacity(0,1));
}
this.UIFrame = 2;
return true;
}
if (this.UIFrame == 2)
{
this.UI['left_1'].style.top = nTop;
if (Core.isMSIE)
{
this.UI['left_2'].style.display='none';
this.UI['left_1'].style.display='block';
} else {
Effects.add(new Effect(this.UI['left_2'],500).Opacity(1,0));
Effects.add(new Effect(this.UI['left_1'],500).Opacity(0,1));
}
this.UIFrame = 1;
return true;
}
}
this.mousemove = function() {if (_this.CallBack) _this.CallBack(_this,"mousemove");}
this.mouseover = function()
{
if (_this.CallBack) _this.CallBack(_this,"mouseover");
_this.StateChange("active");
}
this.mouseout = function()
{
if (_this.CallBack) _this.CallBack(_this,"mouseout");
_this.StateChange("normal");
}
this.mousedown = function()
{
if (_this.CallBack) _this.CallBack(_this,"mousedown");
_this.StateChange("pressed");
}
this.mouseup = function()
{
if (_this.CallBack) _this.CallBack(_this,"mouseup");
_this.StateChange("active");
}
this.click = function()
{
if (_this.CallBack) _this.CallBack(_this,"click");
}
this.initHTML_ = initHTML(this);
}
function fxDraw(x,y,w,h,p,cb)
{
var _this = this;
make_extend(this,new fxControl(x,y,w,h,p,cb));
this.DrawColor = '#DDDDDD';
this.DrawSize = 1;
this.Line = function(x1,y1,x2,y2)
{
var lx = x2-x1;
var ly = y2-y1;
var l = Math.sqrt(lx*lx + ly*ly);
var sx= ly/l;
var sy= lx/l;
var x = x2;
var y = y2;
for (var i=0;i0)
{
for (var i =0;i