

// -----------------------------
// Отображаем с такими координатами.
// -----------------------------

function ShowLayer(lName, x, y, Showing)
{

var skin;

if(lName=='') return;

skin=document.getElementById(lName);

if(skin==null) return;

skin.style.left = x;
skin.style.top  = y;

skin.style.zIndex=2;
if(Showing) skin.style.visibility="visible"; else skin.style.visibility="hidden";

}


// -----------------------------
// Переход на URL
// -----------------------------

function GotoUrl(Url)
{

location.href = Url;

}


// -----------------------------
// Прячем слой.
// -----------------------------

function HideLayer(lName)
{

var skin;

if(lName=='') return;

skin=document.getElementById(lName);

if(skin==null) return;

//skin.style.zIndex=2;
skin.style.visibility="hidden";

}


// -----------------------------
// Загружаем слой
// -----------------------------

function LoadLayer(lName, LoadFrom)
{

var link = LoadFrom + "&rand=" + Math.random();
var old_s = document.getElementById('dataloader');
if (old_s)
    {
    old_s.parentNode.removeChild(old_s);            
    }

var s = document.createElement('script');
s.setAttribute('type', 'text/javascript');
s.src = link;
s.id = 'dataloader';
document.getElementsByTagName('head')[0].appendChild(s);        
}
//--------------------------
// show/hide layer (z - short function name)
//--------------------------
function z(id)
{
if(document.getElementById('s_'+id) == null)
    {
    return;
    }
if(document.getElementById('s_'+id).style.display=='block')
    {
    document.getElementById('s_'+id).style.display='none';
    if(document.getElementById('pm_'+id))
        document.getElementById('pm_'+id).src = 'p/pm_1.png';
    if(document.getElementById('pm_a'+id))
        document.getElementById('pm_a'+id).src = 'p/pm_a1.png';
    }
else
    {
    document.getElementById('s_'+id).style.display='block';
    if(document.getElementById('pm_'+id))
        document.getElementById('pm_'+id).src = 'p/pm_2.png';
    if(document.getElementById('pm_a'+id))
        document.getElementById('pm_a'+id).src = 'p/pm_a2.png';
    }
}
//-------------------------------------
// Open new window with some image 
//----------------------------------
function OpenImg(id, width, height, name)
{
PopupWin = window.open('', 'galery_'+id+'', 'width='+width+',height='+height+',tytlebar,top='+(320-(height/2))+',left='+(540-(width/2))+'');
PopupWin.focus();
PopupWin.window.document.writeln('<head><title>├рыхЁх . '+name+'</title><meta http-equiv="Content-Type" content="text/html; charset=windows-1251" /><link rel="stylesheet" href="css/styles.css" type="text/css" /></head><body><table width=100% height=100% border=0 cellspacing=0 cellpadding=0><tr><td align=center valign=middle><div class=menudeactive style="text-align: center;">'+name+'</div><img src=galery/img/'+id+'.jpg alt="'+name+'"/></td></tr></table></body></html>')
}

function show_flash(object) 
{ 
document.write(object); 
}

