function g(id, parentNode)
{
if (typeof id == 'string')
return document.getElementById(id);
else
return id;
}
function ShowHide(visible, id, parentNode)
{
parentNode = g(parentNode);
var elem = g(id, parentNode);
if (elem)
{
if (visible)
elem.style.display = 'block';
else
elem.style.display = 'none';
}
}
function ShowHideClass(visible, className, parentNode)
{
parentNode = g(parentNode);
all = parentNode.getElementsByTagName('*');
for (var i = 0; i < all.length; i++)
{
tag = all[i];
if (tag.className == className)
ShowHide(visible, tag);
}
}
function SelectPromo(button, index)
{
var sel_button = g('selected', 'promo_1');
sel_button.id = '';
ShowHideClass(false, 'promo_content', 'promo_1');
ShowHide(true, 'promopage' + index, 'promo_1');
button.id = 'selected';
current_promo_index = index;
}
function replaceImage(img, id) {
img1 = g(id);
if( img1 ) {
img1.src=img;
return false;
}
else {
return true;
}
}
function activateTab(id, tabs) {
if( tabs ) {
for(i = 0; i < tabs.length; i++) {
link = g('link_' + tabs[i]);
if(link) {
link.className = '';
}
div = g('div_' + tabs[i]);
if(div) {
div.style.display = 'none';
}
}
link = g('link_' + id);
if(link) link.className = 'active';
div = g('div_' + id);
if(div) div.style.display = 'block';
}
return false;
}
var ns_tt = document.createElement("div");
function AddTT(tt_text)
{
if (!tt_text || tt_text == '')
return;
document.body.appendChild(ns_tt);
ns_tt.id = "ns_tt";
ns_tt.innerHTML = tt_text;
}
function RemoveTT()
{
var o = document.getElementById("ns_tt");
if (o)
document.body.removeChild(o);
}
function setHintXY(e)
{
m = mousePageXY(e);
l = m.x;
t = m.y;
ns_tt.style.left = l + "px";
ns_tt.style.top = t + "px";
return true;
}
function mousePageXY(e, topparam)
{
var posx = 0, posy = 0;
if (!e)
e = window.event;
if (!e)
e = global_event;
if (!e)
{
//alert('à?á?àÈàÁàÊàÀ àÏá?àÈ àÎàÏá?àÅàÄàÅàËàÅàÍàÈàÈ àÊàÎàÎá?àÄàÈàÍàÀá? àÌá?á?àÈ!');
return {"x": 0, "y": 0};
}
if (e.pageX || e.pageY) {
posx = e.pageX;
posy = e.pageY;
}
else if (e.clientX || e.clientY) {
posx = e.clientX + document.body.scrollLeft
+ document.documentElement.scrollLeft;
posy = e.clientY + document.body.scrollTop
+ document.documentElement.scrollTop;
}
return {"x": posx, "y": posy};
}
function onload()
{
tags = document.getElementsByTagName('*');
for (var i = 0; i < tags.length; i++)
{
tag = tags[i];
if (tag.title && typeof(tag.title)=='string' && tag.title != "" && !tag.onfocus)
{
tag.onmouseover = function() { AddTT(this.title); this.title = ''; };
tag.onmouseout = function() { if(g('ns_tt')) this.title = g('ns_tt').innerHTML; RemoveTT(); };
}
}
}
var current_promo_index = 1;
var can_change = true;
function AutoSelectPromo()
{
if (!can_change)
{
setTimeout('AutoSelectPromo()', 8000);
return;
}
var blist = g('buttons');
if (!blist) return;
var bh = blist.getElementsByTagName('a');
if (bh.length < 2) return;
current_promo_index += 1;
if (bh.length < current_promo_index) current_promo_index = 1;
SelectPromo(bh[current_promo_index - 1],current_promo_index);
setTimeout('AutoSelectPromo()', 8000);
}
setTimeout('AutoSelectPromo()', 8000);
document.onmousemove = function(event)
{
global_event = event;
m = mousePageXY();
global_x = m.x;
global_y = m.y;
setHintXY(event);
}
window.onload = onload;
document.onload = onload;
function ShowSelects(show, elem)
{
var select = null;
if (!elem)
elem = document;
var select_list = elem.getElementsByTagName('select');
for (var i = 0; i < select_list.length; i++)
{
select = select_list[i];
select.style.visibility = show ? 'visible' : 'hidden';
}
}
function ShowForm(wrapper_id, form_title, h)
{
//if (!h) h = 350;
var html = '';
var tag = null;
var b = g('blackscreen');
var c = g('centerscreen');
if (wrapper_id) tag = g(wrapper_id);
if (tag) html = tag.innerHTML;
if (!html)
{
b.style.display = 'none';
c.style.display = 'none';
ShowSelects(true);
}
else
{
ShowSelects(false);
b.style.display = 'block';
c.getElementsByTagName('*')[0].innerHTML = '' + form_title;
c.getElementsByTagName('span')[0].id = wrapper_id;
c.getElementsByTagName('span')[0].innerHTML = html + '';
c.style.display = 'block';
//c.style.height = h + 'px';
ShowSelects(true, c);
}
}
var scroll_tag = null;
var scroll_direction = 0;
var scroll_step = 10;
function ScrollTimer() {
if (scroll_tag && scroll_direction != 0)
{
if (scroll_direction > 0)
scroll_tag.scrollLeft = parseInt(scroll_tag.scrollLeft) + scroll_step;
else
scroll_tag.scrollLeft = parseInt(scroll_tag.scrollLeft) - scroll_step;
}
setTimeout('ScrollTimer()', 200);
}
ScrollTimer();
function ScrollBlock(tag, direction)
{
if (tag) {
var wrapper = tag.parentNode;
scroll_tag = wrapper.getElementsByTagName('*')[1];
scroll_direction = direction;
} else {
scroll_tag = null;
scroll_direction = 0;
}
}
function EnlargeImage(tag)
{
var small_img = tag.getElementsByTagName('img')[0];
var big_src = small_img.getAttribute('big_src');
if (!big_src) return;
do {
tag = tag.parentNode;
} while (tag.className != 'images');
var big_image = tag.getElementsByTagName('img')[0];
big_image.src = big_src;
big_image.title = small_img.getAttribute('descr');
}
var images_done = false;
startList = function()
{
var left_block_height = parseInt(g('left_block').clientHeight);
var content_block_height = parseInt(g('content_block').clientHeight);
var wrapper_promo_height = parseInt(g('wrapper_promo').clientHeight);
var left_content_height = (g('left_content')) ?parseInt(g('left_content').clientHeight) : 0;
if (left_block_height > content_block_height + wrapper_promo_height - left_content_height - 20)
{
g('content_block').style.height = (left_block_height - wrapper_promo_height + left_content_height + 30) + 'px';
}
var left_content = g('left_content');
if (left_content)
{
var new_top = parseInt(left_content.parentNode.clientHeight) - parseInt(left_content.clientHeight);
left_content.style.marginTop = new_top + 'px';
left_content.style.visibility = 'visible';
}
if (document.all&&document.getElementById)
{
navRoot = document.getElementById("nav");
for (i=0; ià àÀá?á?àÈá?àÅàÍàÍá?àÉ àÏàÎàÈá?àÊàÀ>';
if (tag.className == 'search-input')
{
tag.title = tag.value;
tag.onfocus = function() { if (this.value == this.title) this.value = ''; };
tag.onblur = function() { if (this.value == '') this.value = this.title; };
}
if (tag.className == 'images' && images_done == false)
{
images_done = true;
var list = tag.getElementsByTagName('div')[1];
if (list.className == 'list')
{
var imgs = list.getElementsByTagName('img');
var nextSibling = null;
if (list.nextSibling) nextSibling = list.nextSibling;
tag.removeChild(list);
var list_w = document.createElement('div');
list_w.className = 'list_w';
var list_l = document.createElement('a');
list_l.className = 'list_l';
list_l.href = 'javascript:void(0);';
list_l.onmouseover = function() { ScrollBlock(this,-1); }
list_l.onmouseout = function() { ScrollBlock(0); }
if (imgs.length > 3) list_w.appendChild(list_l);
list_w.appendChild(list);
var list_r = document.createElement('a');
list_r.className = 'list_r';
list_r.href = 'javascript:void(0);';
list_r.onmouseover = function() { ScrollBlock(this,1); }
list_r.onmouseout = function() { ScrollBlock(0); }
if (imgs.length > 3) list_w.appendChild(list_r);
list.style.overflowX = 'hidden';
if (imgs.length > 3)
list.style.width = '230px';
else
list.style.width = '250px';
if (nextSibling)
tag.insertBefore(list_w, nextSibling);
else
tag.appendChild(list_w);
list.id = 'images_list';
for (i = imgs.length - 1; i >= 0; i--)
{
var img = imgs[i];
var a = img.parentNode;
if (a.tagName.toLowerCase() == 'a')
{
a.href = 'javascript: void(0)';
a.onclick = function() { EnlargeImage(this); };
}
}
}
}
}
}
jQuery(document).ready(function() {
//$(".view-filters").append('à àÀá?á?àÈá?àÅàÍàÍá?àÉ àÏàÎàÈá?àÊàÀ>');
startList();
});