function opop(path){ newWindow = window.open("opop.php?path="+path,"foto","height=400,width=500,top=0,left=50,status=no,menubar=no,resizable=yes,scrollbars=yes,toolbar=no"); return false;}
function isOk(el)
{ if(el.type=='checkbox')
return (el.checked?true:false); var val = el.value; if(val == '' || val == 0 || val == '0000-00-00' || val == '0000-00-00 00:00:00')
return false; if(el.name.indexOf('email') > -1){ var emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/; return emailPattern.test(val);}
return true;}
function validateform(form, required){ var first = 0; var form = document.forms[form]; var elm = form.elements; var to = required.length; checkit(form, required); for(i=0;i<to;i++){ if(!elm[required[i]])
continue; if(!isOk(elm[required[i]])){ first = (first == 0 ? i : first); if(elm[required[i]].type == 'checkbox')
elm[required[i]].parentNode.className = 'rqrd'; else
elm[required[i]].className = 'inp rqrd';}
elm[required[i]].onchange = elm[required[i]].onkeyup = function(){ if(this.type == 'checkbox')
this.parentNode.className = (isOk(this) ? '' : 'rqrd'); else
this.className = (isOk(this) ? 'inp' : 'inp rqrd'); checkit(this.form, required);}
}
}
function checkit(form, required){ var fck = false; var elm = form.elements; form.onsubmit = function(){return true}; for(i=0;i<required.length;i++){ if(!isOk(elm[required[i]])){ form.onsubmit = function(){alert('ProsĂ­m vyplĹte vĹˇechna pole oznaÄŤÂŤenĂˇ hvÄ›zdiÄŤÂŤkou!');return false;}; return;}
}
$(form).unbind('submit');}
function getJS(url, callback)
{ $.ajax({ type: "GET", cache: true, url: url, async: false, dataType: "script", success: callback
});}
jqUIloaded=false; function getJQUI(callback, css)
{ if(jqUIloaded){ callback(); return true;}
jqUIloaded = true; $(function (){ if(css)
$('head').append('<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/ui-darkness/jquery-ui.css" type="text/css" />'); getJS('http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js', callback);})
}
function photosEdit()
{ $('.photoedit .del').live('click', function (){ if(!confirm('Are You sure?'))
return false; var $this = $(this); $.get(this.href, function (s){if(s == '1'){$this.parent().fadeOut('slow');}})
return false;})
$(function (){ getJQUI(function (){ $('#photos').sortable({ placeholder: 'ui-state-highlight', update: function(event, ui) { $.post( document.location.href, { op: 'order', order: $('#photos').sortable('serialize').replace(/&?b\[\]=/g, ',').replace(/b_/g, '').substr(1)
}, function (s)
{ $('#tmpmsg').show(); $('#tmpmsg span').html(s); window.setTimeout(function (){$('#tmpmsg').fadeOut('slow');}, 500);}
)
}
});})
});}
$(function (){ var lboxes = $('.lb'); if(lboxes.length < 1)
return; $('head').append('<scr'+'ipt type="text/javascript" src="js/lightbox/lightbox.js"></sc'+'ript>').append('<li'+'nk rel="stylesheet" type="text/css" href="js/lightbox/lightbox.css" media="screen" />'); lboxes.lightBox({ imageLoading: '/js/lightbox/loading.gif', imageBtnClose: '/js/lightbox/close.gif', imageBtnPrev: '/js/lightbox/prev.gif', imageBtnNext: '/js/lightbox/next.gif', containerResizeSpeed: 0
}); if(!$.support.noCloneEvent)
$('.menu li').hover(function(){$(this).addClass('sfhover')},function(){$(this).removeClass('sfhover')});});