slider_pos = 0; slider_stop = 0; sliding = 0; // Main images preload and turning img = Array('/img_main/02.jpg','/img_main/08.jpg','/img_main/03.jpg','/img_main/06.jpg','/img_main/07.jpg','/img_main/15.jpg','/img_main/05.jpg','/img_main/10.jpg','/img_main/14.jpg','/img_main/00.jpg','/img_main/11.jpg','/img_main/09.jpg','/img_main/12.jpg','/img_main/04.jpg','/img_main/13.jpg'); counter = 1; b=0; function menu_find_ul(what) { for(x in what.childNodes) { if(what.childNodes[x].nodeName=="UL") { ul = what.childNodes[x]; return ul; } } } function menu_make() { m = document.getElementById('topmenu'); for(x in m.childNodes) { if(m.childNodes[x].nodeName=="DIV") { div = m.childNodes[x]; for(y in div.childNodes) { if(div.childNodes[y].nodeName=="UL") { div.childNodes[y].style.display = "none"; } } } } } function menu_show(what, type) { // Oznacime vsechny modre m = document.getElementById('topmenu'); for(x in m.childNodes) { if(m.childNodes[x].nodeName=="DIV" && m.childNodes[x].id!="selected_slider" ) { //m.childNodes[x].style.backgroundColor = "#0261a3"; m.childNodes[x].style.color = "white"; } } // Smazeme spodni podmenu document.getElementById('topmenu2').innerHTML = ""; // Cislo menu str = ""+what; num = str.substring(str.length-1,str.length); slider_stop = (-1*(8-num)*96); place_slider(num, type); what = document.getElementById(what); what.style.color = "#0C5b92"; ul = menu_find_ul(what); for(y in ul.childNodes) { if(ul.childNodes[y].nodeName=="LI") { li = ul.childNodes[y]; li_href = ul.childNodes[y].title; for(z in li.childNodes) { if(li.childNodes[z].nodeName=="#text") { li_text = li.childNodes[z].data; } } //alert(href+":"+text); href = document.createElement('a'); href_text = document.createTextNode(""+li_text); href.className = "topmenu2_item"; href.href = li_href; href.onmouseover = function() { this.style.color = "#db0006"} href.onmouseout = function() { this.style.color = "#0C5b92"} // Zjistime jestli href obsahuje aktualni location tmp1 = "" + li_href; tmp2 = "" + document.location; if(tmp2.indexOf(tmp1)>0) { //href.style.color="#db0006"; //href.style.fontWeight="bold"; } href.appendChild(href_text); document.getElementById('topmenu2').appendChild(href); } } } function place_slider(num, type) { slider = document.getElementById('selected_slider'); if(type) if(type==1) { slider.style.left = slider_stop+"px"; slider_pos = slider_stop; return false; } //slider_pos = slider_stop; rozdil = Math.abs( Math.abs(slider_pos)-Math.abs(slider_stop) ); if(rozdil >250) { if(slider_pos>slider_stop) { c = -240; } else { c = 240; } slider.style.left = slider_pos+c+"px"; slider_pos = slider_pos+c; // slider_pos = slider_stop; setTimeout("place_slider()",50); } else { slider.style.left = slider_stop+"px"; slider_pos = slider_stop; } } // Main images load and turn function main_images_start() { preload(); setTimeout("change2(1);",5000); } function change2(type) { return true; if(type==1) { if(b<=1) { document.getElementById('img_main2').style.opacity = ""+b; b = b+0.05; setTimeout("change2(1);",10); } else { ++counter; if(counter>img.length-1) counter = 0; document.getElementById('img_main1').src = img[counter]; setTimeout("change2(0);",7000); } } if(type==0) { if(b>=0) { document.getElementById('img_main2').style.opacity = ""+b; b = b-0.05; setTimeout("change2(0);",10); } else { ++counter; if(counter>img.length-1) counter = 0; document.getElementById('img_main2').src = img[counter]; setTimeout("change2(1);",5000); } } } function preload(){ for(x=1; x' ; } function hide_actions(e) { div.style.display = "none"; } // Gallery slide gallery_position = 0; gallery_stop = 0; gallery_total = 0; gallery_actual = 0; gallery_stoped = 1; function gallery_slide_left() { if(sliding==0) return; if(gallery_position<0) { gallery_stop += 200; gallery_position += 200; slider = document.getElementById('gallery_thumb_list'); slider.style.left = gallery_position+"px"; //g = document.getElementById('gallery_thumb_list') //g.style.left = gallery_position+"px"; //gallery_slide(); } if(sliding==1) setTimeout("gallery_slide_left();", 200) } function gallery_slide_right() { if(sliding==0) return; if(gallery_position > -1*totalWidth) { gallery_stop -= 200; gallery_position -= 200; slider = document.getElementById('gallery_thumb_list'); slider.style.left = gallery_position+"px"; //gallery_slide(); //g = document.getElementById('gallery_thumb_list') //g.style.left = gallery_position+"px"; } if(sliding==1) setTimeout("gallery_slide_right();", 200) } function gallery_stop_slide() { sliding = 0; } function gallery_slide(num, type) { if(gallery_stop>0) gallery_stop=0; if(gallery_stop<-1*totalWidth) gallery_stop=-1*totalWidth; window.status = Math.random(); //slider_pos = slider_stop; rozdil = Math.abs( Math.abs(gallery_position)-Math.abs(gallery_stop) ); if(rozdil >100) { if(gallery_position>gallery_stop) { c = -50; if(type==1) c = -200; if(type==2) c = -1*0.5*10; } else { c = 50; if(type==1) c = 200; if(type==2) c = 0,5.; } slider.style.left = gallery_position+c+"px"; gallery_position += c; if(type==1) { setTimeout("gallery_slide(0,1)",10); } if(type==2) { setTimeout("gallery_slide(0,2)",10); } if(!type) { setTimeout("gallery_slide()",10); } } else { slider.style.left = gallery_stop+"px"; gallery_position = gallery_stop; } } function gallery_show(what, title, num) { what = what+".jpg"; document.getElementById('photo').src = "ukaz_fotku.php?url="+what; document.getElementById('title').style.display = "none"; if(title) { x = document.getElementById('photo').offsetTop; document.getElementById('title').innerHTML = title; document.getElementById('title').style.display = "inline"; document.getElementById('title').style.top = 5+x+"px"; document.getElementById('title').style.left = "35px"; } document.getElementById('gallery_photo_num').innerHTML = (parseInt(num)+1) + " z " + gallery_total+" "; gallery_actual = num; } last = 0; function gallery_init() { totalWidth = 0; gallery_show(galleryFirstPhoto, galleryFirstTitle,0); for(x=0; x