﻿var s_domain_path="http://www.manekynka.sk/";

// Top menu

var disappeardelay=0  //menu disappear speed onMouseout (in miliseconds)
var enableanchorlink=0 //Enable or disable the anchor link when clicked on? (1=e, 0=d)
var hidemenu_onclick=1 //hide menu when user clicks within menu? (1=yes, 0=no)

/////No further editting needed

var ie5=document.all
var ns6=document.getElementById&&!document.all

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function showhide(obj, e, visible, hidden){
if (ie5||ns6) {
dropmenuobj.style.left=dropmenuobj.style.top=-500
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover") {
obj.visibility=visible
}
else if (e.type=="click") {
obj.visibility=hidden
}
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie5 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie5 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie5 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function dropdownmenu(obj, e, dropmenuID){
	if (window.event) {
			event.cancelBubble=true
		}
	else if (e.stopPropagation) {
			e.stopPropagation()
		}
	if (typeof dropmenuobj!="undefined") { //hide previous menu
			dropmenuobj.style.visibility="hidden"
			dropstyleOut()
		}
	// nobg()
	clearhidemenu()
	if (ie5||ns6){
		obj.onmouseout=delayhidemenu
		dropmenuobj=document.getElementById(dropmenuID)
		dropstyleOver(obj.id)
		if (hidemenu_onclick) {
			dropmenuobj.onclick=function(){dropmenuobj.style.visibility='hidden'}
		}
		dropmenuobj.onmouseover=clearhidemenu
		dropmenuobj.onmouseout=ie5? function(){ dynamichide(event)} : function(event){ dynamichide(event)}
		showhide(dropmenuobj.style, e, "visible", "hidden")
		dropmenuobj.x=getposOffset(obj, "left")
		dropmenuobj.y=getposOffset(obj, "top")
		dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
		dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
	}
	return clickreturnvalue()
}

function clickreturnvalue(){
if ((ie5||ns6) && !enableanchorlink) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie5&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()

}

function delayhidemenu(){
delayhide=setTimeout("dropmenuobj.style.visibility='hidden'",disappeardelay)
delayhide2=setTimeout("dropstyleOut()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
if (typeof delayhide2!="undefined")
clearTimeout(delayhide2)
}

function dropstyleOver (which) {
thisMenu=document.getElementById(which).style
OutId=which
OutStyleBak=thisMenu.backgroundColor
OutStyleBor=thisMenu.borderColor
thisMenu.backgroundColor = "white"
thisMenu.borderColor = "#dadada"
}
function dropstyleOut () {
if (typeof OutId!="undefined" && typeof OutStyleBak!="undefined") {
	document.getElementById(OutId).style.backgroundColor=OutStyleBak
	}
if (typeof OutId!="undefined" && typeof OutStyleBor!="undefined") {
	document.getElementById(OutId).style.borderColor=OutStyleBor
	}
}

function nobg(){
document.getElementById("rankings-b").style.background="none"
}


//Dropdown quick search

var obj_array_dropdowns =

 [

  new fnc_o_dropdown('ddl_modelky','ddl_modelky','quick_search'),

  new fnc_o_dropdown('ddl_agentury','ddl_agentury','quick_search'),

  new fnc_o_dropdown('ddl_prehliadky','ddl_prehliadky','quick_search')
 ,new fnc_o_dropdown('ddl_komunita','ddl_komunita','quick_search')

 ];

function fnc_selectChangedValue(s_dropdownName)

{

    var s_id=document.getElementById(s_dropdownName).id;

    var i_selectedIndex=document.getElementById(s_dropdownName).selectedIndex;

    var s_value= document.getElementById(s_dropdownName)[i_selectedIndex].value;

    var s_group;

    for (i=0;i< obj_array_dropdowns.length; i++)

    {

        if(obj_array_dropdowns[i].s_id==s_id)

        {

            s_group=obj_array_dropdowns[i].s_group;

        }

    }

   

    for(i=0;i< obj_array_dropdowns.length; i++)

    {

        if(obj_array_dropdowns[i].s_group==s_group)

        {

            document.getElementById(obj_array_dropdowns[i].s_id).selectedIndex=0;

        }

    }
    document.getElementById(s_id).selectedIndex=i_selectedIndex;
}

function fnc_o_dropdown(s_id,s_name,s_group)
{

    this.s_id=s_id;

    this.s_name=s_name;

    this.s_group=s_group;

}


function fnc_returnImagePath(s_Value,s_style)
{
    
    var s_returnValue="";
    
    for (j=0;j< obj_array_aplphabet.length; j++)
    {
        if ((obj_array_aplphabet[j].s_digit==s_Value)&&(obj_array_aplphabet[j].s_digitStyle==s_style))
        {
            s_returnValue=obj_array_aplphabet[j].s_path;
            break;
        }
    }

    return s_returnValue;
}



function tgl(id){
		
var l =['r0','r2','r3'];
		
for(var i=0;i<l.length;i++){
			
var d = document.getElementById(l[i]);
			
if(id == l[i]){
				
d.style.display = 'block';
			
}else{ d.style.display ='none'; }
		
}
}



   function fnc_tabs(id){
		
    var l =['tb0','tb2','tb3'];
    

		
    for(var i=0;i<l.length;i++){
			
    var d = document.getElementById(l[i]);
    var first_tab=document.getElementById("first_tab");
    var second_tab=document.getElementById("second_tab");
    var third_tab=document.getElementById("third_tab");
			
    if(id == l[i]){
				
    d.style.display = 'block'; 
        if (id==l[0]) {
           first_tab.style.border="1px solid #CECECE";
           first_tab.style.borderBottom="0px solid";
           second_tab.style.border="1px solid #CECECE";
           second_tab.style.borderTop="0px solid";
           second_tab.style.borderRight="0px solid";
           second_tab.style.borderLeft="0px solid";
       //    third_tab.style.border="1px solid #CECECE";
       //    third_tab.style.borderLeft="1px solid #CECECE";
       //    third_tab.style.borderRight="0px solid";
       //    third_tab.style.borderLeft="0px solid";
       //    third_tab.style.borderTop="0px solid";
        }
       if (id==l[1]) {
           second_tab.style.border="1px solid #CECECE";
           second_tab.style.borderBottom="0px solid";
           first_tab.style.border="1px solid #CECECE";
           first_tab.style.borderLeft="0px solid";
           first_tab.style.borderRight="0px solid";
           first_tab.style.borderTop="0px solid";
    //       third_tab.style.border="1px solid #CECECE";
    //       third_tab.style.borderRight="0px solid";
    //       third_tab.style.borderLeft="0px solid #CECECE";
    //       third_tab.style.borderTop="0px solid #CECECE";
          
        }
  /*     if (id==l[2]) {
           third_tab.style.border="1px solid #CECECE ";
           third_tab.style.borderBottom="0px solid";
           first_tab.style.border="1px solid #CECECE ";
           first_tab.style.borderLeft="0px solid";
           first_tab.style.borderRight="0px solid";
           first_tab.style.borderTop="0px solid";
           second_tab.style.border="1px solid #CECECE ";
           second_tab.style.borderLeft="0px solid";
           second_tab.style.borderRight="0px solid";
           second_tab.style.borderTop="0px solid";
        } */
    
			
    }
    else{ d.style.display ='none'; }
		
    }
	}

    function addBookmark(title, url) {

    if (window.sidebar) { // firefox

    window.sidebar.addPanel(title, url,"");

    } else if( document.all ) { //MSIE

    window.external.AddFavorite( url, title);

    } else {

    alert("Press Control+D in your Browser");

    }

    }

