function reCaptcha(el) {
if ( ! el) el = '#captchaImg';
var src = jQuery(el).attr('src');
src += (src.search(/\?/) > 0) ? '&' : '?';
jQuery(el).attr('src', src + 'rnd=' + Math.random());
}
jQuery(function() {
jQuery('body').on('click', '.captchaImg', function() { reCaptcha(this); });
jQuery('body').on('click', '.bookmark', function(){
bookmarkPage(this.href, this.title);
return false;
});
});
function bookmarkPage(url,title) {
if (!url) {url = window.location}
if (!title) {title = document.title}
var browser=navigator.userAgent.toLowerCase();
if (window.sidebar) { // Mozilla, Firefox, Netscape
window.sidebar.addPanel(title, url,"");
} else if( window.external) { // IE or chrome
if (browser.indexOf('chrome')==-1){ // ie
window.external.AddFavorite( url, title);
} else { // chrome
alert('Wciśnij CTRL+D (lub Command+D na Mac) aby dodać stronę do ulubionych.');
}
}
else if(window.opera && window.print) { // Opera - automatically adds to sidebar if rel=sidebar in the tag
return true;
}
else if (browser.indexOf('konqueror')!=-1) { // Konqueror
alert('Wciśnij CTRL+B aby dodać stronę do ulubionych.');
}
else if (browser.indexOf('webkit')!=-1){ // safari
alert('Wciśnij CTRL+B (lub Command+D na Mac) aby dodać stronę do ulubionych.');
} else {
alert('Twoj przeglądarka nie pozwala na dodawanie ulubionych przy użyciu tego odnośnika. Proszę dodać zakładkę ręcznie.')
}
}
/***************************************************************************************
*
* URL IN NEW WINDOW
*
***************************************************************************************/
jQuery(function() {
jQuery('body').on('click', 'a[href^="https://"], .newWindow', function() {
window.open(this.href, '_blank');
return false;
});
});
/***************************************************************************************
*
* URL IN NEW WINDOW
*
***************************************************************************************/
jQuery(function() {
jQuery('.fix_img').find('img').not('[id^="dgmap"] *').each(function() {
var $img = jQuery(this),
h = $img.height(),
w = $img.width(),
src = $img.attr('longdesc'),
alt = $img.attr('alt');
$img.removeAttr('longdesc');
$img.attr('src', '/img/img.php?src='+src+'&w='+w+'&h='+h+'&zc=1');
if (! ($img.parents('a').length && $img.parents('a')[0].href != '') ) {
$img.wrap('');
}
});
jQuery('').appendTo('head');
});
/***************************************************************************************
*
* VIDEO & AUDIO
*
***************************************************************************************/
jQuery(function() {
jQuery('video,audio').mediaelementplayer({videoVolume: 'horizontal'});
});