function swap(A_obr, B_obr)
{
document.images[A_obr].src=B_obr;
}

function f_show(a)
{
document.getElementById(a).style.visibility='visible';
}


function f_hide(a)
{
document.getElementById(a).style.visibility='hidden';
}

function f_show_mpos(event,a,b)
{
x=event.clientX+b;
y=event.clientY;
document.getElementById(a).style.visibility='visible';
document.getElementById(a).style.top=y;
document.getElementById(a).style.left=x;
}


function isjs()
{
document.getElementById('adv_search').style.visibility='hidden';
document.getElementById('adv_search_js').style.visibility='visible';
document.getElementById('top_nav_orderby').style.visibility='hidden';
document.getElementById('top_nav_orderby_js').style.visibility='visible';
set_position();
}


function hover_menu(a)
{
if(navigator.appName=='Microsoft Internet Explorer')
{
document.getElementById(a).style.width='105px';
document.getElementById(a).style.height='auto';
document.getElementById(a).style.backgroundColor='transparent';
document.getElementById(a).style.backgroundImage='URL(images/menu_hover.png)';
document.getElementById(a).style.backgroundRepeat='no-repeat';
document.getElementById(a).style.backgroundPositionX='1px';
document.getElementById(a).style.backgroundPositionY='0px';
document.getElementById(a).style.borderLeftStyle='solid';
document.getElementById(a).style.borderLeftColor='#BCBCBC';
document.getElementById(a).style.borderLeftWidth='1px';
document.getElementById(a).style.paddingLeft='1px';
document.getElementById(a).style.overflow='visible';
}
}

function unhover_menu(a)
{
if(navigator.appName=='Microsoft Internet Explorer')
{
document.getElementById(a).style.width='105px';
document.getElementById(a).style.height='44';
document.getElementById(a).style.backgroundImage='none';
document.getElementById(a).style.overflow='hidden';
}
}

function div_select(a)
{
if(document.getElementById(a).style.visibility=='visible')
{
document.getElementById(a).style.visibility='hidden';
document.getElementById(a).style.zIndex='2';
}

else
{
if(navigator.appName=='Microsoft Internet Explorer')
{
if(a=="advs_div2")
{
document.getElementById(a).style.height='78px';
}
else
{
document.getElementById(a).style.height='130px';
}
document.getElementById(a).style.overflow='auto';
document.getElementById(a).style.zIndex='4';
document.getElementById(a).style.visibility='visible';
}
else
{
document.getElementById(a).style.height='auto';
document.getElementById(a).style.maxHeight='400px';
document.getElementById(a).style.overflow='auto';
document.getElementById(a).style.zIndex='4';
document.getElementById(a).style.visibility='visible';
}
}
}

function sel_a(a)
{
document.forms[1].elements[0].value=a;
}

function sel_b(a)
{
document.forms[1].elements[1].value=a;
}

function sel_c(a)
{
document.forms[1].elements[2].value=a;
}

function sel_o(a)
{
document.forms[4].elements[0].value=a;
}

function clear_topsearch()
{
if(document.forms[0].elements[0].value=='Hľadať')
{
document.forms[0].elements[0].value='';
}
}

function submit_advs()
{
if(document.forms[1].elements[0].value=="--------- Typ nehnuteľností --------")
{
document.forms[1].elements[0].value="";
}

if(document.forms[1].elements[1].value=="----------- Typ ponuky ----------")
{
document.forms[1].elements[1].value="";
}

if(document.forms[1].elements[2].value=="------- Lokalita (kraj – okres) ------")
{
document.forms[1].elements[2].value="";
}

document.forms[1].submit();
}

function set_position()
{
var content_height = document.getElementById("content").offsetHeight;

if(content_height < 922)
{
content_height = 922;
document.getElementById("content").style.height = 922;
}

var pos_difference = content_height - 922;
var new_bottom_top = document.getElementById("bottom").offsetTop + pos_difference;
var new_bottom_panel_top = document.getElementById("bottom_panel").offsetTop + pos_difference;
var new_bottom_nav_top = document.getElementById("bottom_nav").offsetTop + pos_difference;
var new_bottom_nav_span_top = document.getElementById("bottom_nav_span").offsetTop + pos_difference;
var new_back_on_top_top = document.getElementById("back_on_top").offsetTop + pos_difference;

document.getElementById("bottom").style.top = new_bottom_top;
document.getElementById("bottom_panel").style.top = new_bottom_panel_top;
document.getElementById("bottom_nav").style.top = new_bottom_nav_top;
document.getElementById("bottom_nav_span").style.top = new_bottom_nav_span_top;
document.getElementById("back_on_top").style.top = new_back_on_top_top;

document.getElementById("main").style.height = content_height + 837;
}
