var cur_X = 1; var cur_Y = 1; function GetBodyWidth() { if (document.all) return body.offsetWidth; else return parent.window.innerWidth; } function GetBodyHeight() { if (document.all) return body.offsetHeight; else return parent.window.innerHeight; } function GetCursorPos(e) { cur_X=event.clientX+document.body.scrollLeft; cur_Y=event.clientY+document.body.scrollTop; return true; } function GoTo(url) { window.location = url; } function T_upMenu_Add(name, url, x, width) { this.items.push(name); this.urls.push(url); this.posX.push(x); this.width.push(width); } function T_upMenu_AddChl(parent,name, url, type) { var i = 0; for (i = 0; i < this.items.length; i++) { if (this.items[i] == parent) { this.chlParents.push(i); this.chlitems.push(name); this.chlurls.push(url); this.chltypes.push(type); break; } } } function T_upMenu_Create() { var i; var j; var str = ''; this.body = document.getElementById(this.id); this.clickBody = document.getElementById(this.id+'Check'); this.clickBody2 = document.getElementById(this.id+'Check2'); for (i = 0; i < this.items.length; i++) { str += ''; } this.body.innerHTML = str; } function T_upMenu_GetX(id) { var i; for (i = 0; i < this.items.length; i++) if (this.items[i] == id) return this.posX[i]; } function T_upMenu_Open(id,type) { if (type && upmenu.tmpId == id) { this.move(); this.body.style.display = 'none'; if (this.curItem != null) { document.getElementById(this.curItem).style.display = 'none'; } this.curItem = id; document.getElementById(this.curItem).style.display = 'block'; this.body.style.left = this.getX(id); this.body.style.display = 'block'; this.clickBody.style.height = (GetBodyHeight()-110); this.clickBody.style.display = this.clickBody2.style.display = 'block'; this.clickBody.style.height = '200'; } if (!type) { //alert(id); upmenu.tmpId = id; window.setTimeout(this.objName+'.open("'+id+'",1)', 1); } } function T_upMenu_Close() { if (this.curItem != null) { this.body.style.display = 'none'; document.getElementById(this.curItem).style.display = 'none'; this.clickBody.style.display = this.clickBody2.style.display = 'none'; this.curItem = null; } } function T_upMenu_Move(id) { var d = new Date(); this.time = d.getSeconds(); } function T_upMenu(id, name) { this.body; this.clickBody; this.clickBody2; this.id = id; this.objName = name; this.time = -1; this.timeHide = 5; this.curItem = null; this.mouseOut = null; this.tmpId = null; this.items = new Array(); this.urls = new Array(); this.width = new Array(); this.posX = new Array(); this.chlParents = new Array(); this.chlitems = new Array(); this.chlurls = new Array(); this.chltypes = new Array(); this.addchl = T_upMenu_AddChl; this.add = T_upMenu_Add; this.create = T_upMenu_Create; this.getX = T_upMenu_GetX; this.open = T_upMenu_Open; this.close = T_upMenu_Close; this.move = T_upMenu_Move; } function PopUp(page, width, height, scrollbars, resizable) { if (busy) return false; var str = ''; if (document.all) { var bHeight = document.body.offsetHeight; var bWidth = document.body.offsetWidth; } else { var bWidth = window.innerWidth; var bHeight = window.innerHeight; } str += 'width='+width+''; str += ', height='+height+''; str += ', location=no'; str += ', menubar=no'; str += ', resizable=' + (!resizable || resizable=='yes'?'yes':'no'); str += ', scrollbars=' + (!scrollbars || scrollbars=='yes'?'yes':'no'); str += ', status=no'; str += ', titlebar=yes'; str += ', toolbar=no'; str += ', top='+parseInt((bHeight-height)/2)+''; str += ', left='+parseInt((bWidth-width)/2)+''; window.open(page,'_blank', str); } function T_SYSMSG_Print() { var str = ''; var i,j; this.body = document.getElementById(this.name+'_body'); this.text = document.getElementById(this.name+'_text'); if (this.body && this.arr.length) { j = 1; for (i in this.arr) { if (!this.arr[i][0]) continue; else if (j == 4) break; str += ' ' + this.arr[i][0] + ' |'; j++; } str = str.substr(0,str.length-30); this.text.innerHTML = str; if (str) this.body.style.display = 'block'; } else { this.body.style.display = 'none'; } } function T_SYSMSG_Add(str, url) { this.arr.push(new Array(str, url)); } function T_SYSMSG(name) { this.arr = new Array(); this.name = name; this.body = null; this.text = null; this.print = T_SYSMSG_Print; this.add = T_SYSMSG_Add; } function ShowHint(name) { if (name) PopUp('/lat/popup/hint?sess.id=5e367090c9d3b2015950f683d184c1fc&hint.name='+name,650,550,'yes','no'); } var busy = false; function T_Stek_Push(str) { this.arr.push(str); return true; } function T_Stek_Pop() { if (this.arr.length > 0) { if (document.getElementById('stek_busy')) { this.snowDiv(); } busy = true; return this.arr.shift(); } else return false; } function T_Stek_SnowDiv() { if (!$("#stek_busy")) return false; var showY = cur_Y; var showX = cur_X; var pageYOffset; var pageXOffset; var bWidth; var bHeight; var menuWidth = 250; var menuHeight = 40; if (document.all) { bWidth = document.body.offsetWidth; bHeight = document.body.offsetHeight; pageYOffset = document.body.scrollTop; pageXOffset = document.body.scrollLeft; } else { bWidth = window.innerWidth; bHeight = window.innerHeight; pageYOffset = window.pageYOffset; pageXOffset = window.pageXOffset; } if (((cur_Y-pageYOffset) + menuHeight) > bHeight) { showY = cur_Y - (((cur_Y-pageYOffset) + menuHeight) - bHeight); } if (((cur_X-pageXOffset) + menuWidth) > bWidth) { showX = cur_X - (((cur_X-pageXOffset) + menuWidth) - bWidth+20); } $("#stek_busy").css( { top: pageYOffset, left: showX-15, top: showY-10 } ); //this.body.style.left = showX-15; //this.body.style.top = showY-10; //obj.style.display = 'block' $("#stek_busy").fadeIn("fast"); //document.getElementById('stek_busy').style.left = cur_X-25; //document.getElementById('stek_busy').style.top = cur_Y-25; } function T_Stek_Run() { if (!busy && this.arr.length > 0) { eval(this.pop()); this.doncloseBar = false; } else if (busy) { if (document.getElementById('stek_busy')) { this.snowDiv(); } } else if (document.getElementById('stek_busy') && $("#stek_busy").css("display") == 'block') { //document.getElementById('stek_busy').style.display = 'none'; $("#stek_busy").hide("fast"); } window.setTimeout(this.name + '.run()', 50); } function T_Stek_Test() { alert('Test'); } function T_Stek(name) { this.name = name; this.snowDiv=T_Stek_SnowDiv; this.arr = new Array(); this.push = T_Stek_Push; this.pop = T_Stek_Pop; this.run = T_Stek_Run; this.test = T_Stek_Test; } function T_StayOnline_Run() { var time = 3599000; if (time > (1000 * 60 * 15)) { //window.setTimeout('online.run()', time); //document.getElementById('system_frame').src = '/lat/system/stayonline?sess.id=5e367090c9d3b2015950f683d184c1fc&type=1&unix=' + Math.random(); } } function T_StayOnline(name) { this.name = name; this.run = T_StayOnline_Run; window.setTimeout('online.run()', 3599000); } var stek = new T_Stek('stek'); stek.run(); var SYSMSG = new T_SYSMSG('sysmsg'); function GoToAlbums() { busy = false; stek.push('GoTo(\'/lat/albums/?sess.id=5e367090c9d3b2015950f683d184c1fc\')'); } var upmenu = new T_upMenu('upMenu', 'upmenu'); upmenu.add('orders','/lat/orders/?sess.id=5e367090c9d3b2015950f683d184c1fc', 146, 200); upmenu.addchl('orders', 'Noformēt pasūtījumu', 'GoTo(\'/lat/orders/?sess.id=5e367090c9d3b2015950f683d184c1fc\')', 1); upmenu.addchl('orders', '', '', 3); upmenu.addchl('orders', 'Tekošie pasūtījumi', 'GoTo(\'/lat/orders/curorders?sess.id=5e367090c9d3b2015950f683d184c1fc\')', 1); upmenu.addchl('orders', '', '', 3); upmenu.addchl('orders', 'Pasūtījumu arhīvs', 'GoTo(\'/lat/orders/archive?sess.id=5e367090c9d3b2015950f683d184c1fc\')', 1); upmenu.addchl('orders', '', '', 3); upmenu.addchl('orders', 'Cenas', 'GoTo(\'/lat/orders/price?sess.id=5e367090c9d3b2015950f683d184c1fc&type=1&price.id=11\')', 1); upmenu.addchl('orders', '', '', 3); upmenu.addchl('orders', 'Adreses', 'GoTo(\'/lat/orders/addr?sess.id=5e367090c9d3b2015950f683d184c1fc\')', 1); upmenu.addchl('orders', '', '', 3); upmenu.addchl('orders', 'Pasūtījumu parametri', 'GoTo(\'/lat/settings/orders?sess.id=5e367090c9d3b2015950f683d184c1fc\')', 1); upmenu.addchl('orders', '', '', 4); upmenu.addchl('orders', 'Palīdzība', 'GoTo(\'/lat/help/?sess.id=5e367090c9d3b2015950f683d184c1fc\')', 2); upmenu.add('albums','/lat/albums/?sess.id=5e367090c9d3b2015950f683d184c1fc',287, 210); upmenu.addchl('albums', 'Mani albumi', 'GoToAlbums()', 1); upmenu.addchl('albums', '', '', 3); upmenu.addchl('albums', 'Izveidot albumu', 'GoTo(\'/lat/albums/newalbum?sess.id=5e367090c9d3b2015950f683d184c1fc\')', 1); upmenu.addchl('albums', '', '', 3); upmenu.addchl('albums', 'Albumu iestatījumi', 'GoTo(\'/lat/settings/albums?sess.id=5e367090c9d3b2015950f683d184c1fc\')', 1); upmenu.addchl('albums', '', '', 4); upmenu.addchl('albums', 'Palīdzība', 'GoTo(\'/lat/help/?sess.id=5e367090c9d3b2015950f683d184c1fc\')', 2); upmenu.add('main','/lat/orders/?sess.id=5e367090c9d3b2015950f683d184c1fc', 5, 200); upmenu.addchl('main', 'Par interneta vietni', 'GoTo(\'/lat/main/about?sess.id=5e367090c9d3b2015950f683d184c1fc\')', 1); upmenu.addchl('main', '', '', 3); upmenu.addchl('main', 'Jaunumi', 'GoTo(\'/lat/main/news?sess.id=5e367090c9d3b2015950f683d184c1fc\')', 1); upmenu.addchl('main', '', '', 3); upmenu.addchl('main', 'Cenas', 'GoTo(\'/lat/main/price?sess.id=5e367090c9d3b2015950f683d184c1fc&type=1&price.id=11\')', 1); upmenu.addchl('main', '', '', 3); upmenu.addchl('main', 'Adreses', 'GoTo(\'/lat/main/addr?sess.id=5e367090c9d3b2015950f683d184c1fc\')', 1); upmenu.addchl('main', '', '', 3); upmenu.addchl('main', 'Akcijas', 'GoTo(\'/lat/actions/?sess.id=5e367090c9d3b2015950f683d184c1fc\')', 1); upmenu.addchl('main', '', '', 4); upmenu.addchl('main', 'Palīdzība', 'GoTo(\'/lat/help/?sess.id=5e367090c9d3b2015950f683d184c1fc\')', 2); upmenu.add('friends','/lat/orders/?sess.id=5e367090c9d3b2015950f683d184c1fc', 468, 200); upmenu.addchl('friends', 'Lietotāju saraksts', 'GoTo(\'/lat/userslist/?sess.id=5e367090c9d3b2015950f683d184c1fc\')', 1); upmenu.addchl('friends', '', '', 3); upmenu.addchl('friends', 'Meklēt lietotāju', 'GoTo(\'/lat/userslist/search?sess.id=5e367090c9d3b2015950f683d184c1fc\')', 1); upmenu.addchl('friends', '', '', 4); upmenu.addchl('friends', 'Palīdzība', 'GoTo(\'/lat/help/?sess.id=5e367090c9d3b2015950f683d184c1fc\')', 2);