$(document).ready(function(){
	
	$('div[class^=gallery_] a:has(img)').addClass('galleryItem').attr('rel', 'lightbox[gal]').each(function(){
		$(this).attr('title', $('img', this).attr('title'));
		//$(this).append('<span>'+$('img',this).attr('title')+'</span>');
	});
	$('div[class^=gallery_] img').addClass('dropshadow');
	
	$("table.imgpopisek img").addClass('dropshadow');
	
	$("img.dropshadow").dropShadow({left:0,top:0,blur:4});
	
	$('.gallery_cs a:has(img)').prettyPhoto({opacity: 0.5, theme: 'facebook', wmode: 'transparent', overlay_gallery: false});
	$('.gallery_en a:has(img)').prettyPhoto({opacity: 0.5, theme: 'facebook', wmode: 'transparent', overlay_gallery: false});
	
	if (document.forms['search']) {
		if (window.location.href.indexOf('/cs/')>-1) {
			$(document.forms['search'].query).val('Hledat');
		} else {
			$(document.forms['search'].query).val('Search');
		}
		$(document.forms['search'].query).one('focus', function(e){
			$(this).val('');
		});
	}
});

//GA
try {
	var pageTracker = _gat._getTracker("UA-12430917-1");
	pageTracker._trackPageview();

} catch(err) {}
	
bName = navigator.appName;
bVer = parseInt(navigator.appVersion);
if (bName == "Netscape" && bVer >= 3) ver = "n3";
else if (bName == "Netscape" && bVer == 2) ver = "n2";
else if (bName == "Microsoft Internet Explorer" && bVer >= 2 && bVer < 4) ver = "e3";
else if (bName == "Microsoft Internet Explorer" && bVer >= 4) ver = "n3";
function checkIt() {
        if (navigator.appVersion.indexOf("(X11") != -1 || navigator.appVersion.indexOf("(Mac") != -1) return 1
        else return 0
        }
function nove_okno(stranka, sirka, vyska, scroll, tool, stat) {
    if (scroll != "1" && scroll != "0") scroll = "0";
    if (tool != "1" && tool != "0") tool = "0";
    if (stat != "1" && stat != "0") stat = "0";
        detailer = window.open(stranka, '', 'toolbar='+tool+',location=no,directories=no,status='+stat+',menubar=no,scrollbars='+scroll+',resizable=yes,copyhistory=no,width='+sirka+',height='+vyska+',top=10,left=50');
        if (checkIt() == 1 ) window.open(stranka, '');
        if (document.images && bName == "Netscape") detailer.focus();
}	
