//javascript_document
var search_button = document.getElementById("search_button");

//google stats code
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-18084023-1']);
_gaq.push(['_setDomainName', '.pes-portal.sk']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

//otvorenie nového okna popup
function popUp(URL) {
 day = new Date();
 id = day.getTime();
 eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=500,left = 590,top = 275');");
}

//zobrazí div akonáhle sa začne uploadovať
function loading1() {
element=document.getElementById('loading1');
if (element.style.display=='none')
{
element.style.display='';
}
}     

//zobrazí formuulár na pridanie komentára
function comment_show(stay){
button = document.getElementById('comment_button_hide');
element = document.getElementById('comment_hide');
if (element.style.display=='none')
{
button.style.display='none';
element.style.display='';
}else{
button.style.display='';
element.style.display='none';
}
}

//pripojí nový file k dokumentu
function attach_file( p_script_url ) {
script = document.createElement( 'script' );
script.src = p_script_url;
document.getElementsByTagName( 'head' )[0].appendChild( script );
}

//ochrana proti nekorektnému načítaniu pri malých monitoroch
function image_popup(id,album) {
var screen_height = screen.availHeight;
if(screen_height <= '1000'){
var simple = '<a href=\"http://pes-portal.sk/fotoalbum/' + album + ':' + id + '\" class=\"fotka\"><img src=\"http://pes-portal.sk/fotoalbumy/tool/cropp/makeimage.php?img=' + album + '/' + id + '\" width=\"160\"></a>';
return simple;
}else{
var popup = '<a href=\"javascript:void;\" onclick=\"TINY.box.show({url:\'http://pes-portal.sk/fotoalbum/' + album + '-' + id + '\'})\" class=\"fotka\"><img src=\"http://pes-portal.sk/fotoalbumy/tool/cropp/makeimage.php?img=' + album + '/' + id + '\" width=\"160\"></a>';
return popup;
}
}
