function fancybox_installPDF(pdf) {
var $pdflinks;
pdf = pdf || "a[href$=PDF],a[href$=pdf]";
$pdflinks = $(pdf);
if (/iPad/i.test(navigator.userAgent)) {
// existuje reseni, ale to mi nefunguje pri mobilnim vzhledu,
// protoze iPad da prednost vnejsimu skrolu (a to navic nepravidelne!) !
//
// $pdflinks.fancybox({
// type:'iframe',
// width:'90%', height:'90%',
// iframeheight:10000,
// iframewidth:"100%",
// 'overlayOpacity' : 0.8,
// 'overlayColor' : '#000'
// });
// + #fancybox-content{overflow: auto;-webkit-overflow-scrolling:touch;}
} else if(/Android/i.test(navigator.userAgent)) {
// nefunkncnost fancyboxu na androidech
} else {
// ie 7, ie 8, ie 11, chrome, firefox, safari
$pdflinks.fancybox({
type:'iframe',
width:'90%', height:'90%',
iframeheight:10000,
iframewidth:"100%",
'overlayOpacity' : 0.8,
'overlayColor' : '#000'
});
}
}
// bgimage, prevSlide, nextSlide, speed
function superbg_installSlideNow($bg, $l, $r) {
var s = superbgoptions.speed;
$($l).click(function(){
superbgoptions.speed = 5;
$($bg).prevSlide();
setTimeout(function() {superbgoptions.speed = s;}, 5);
})
$($r).click(function(){
superbgoptions.speed = 5;
$($bg).nextSlide();
setTimeout(function() {superbgoptions.speed = s;}, 5);
})
}
// [e]vent je na prvku ci jeho potomku?
function event_is_on(e, selector){
return $(e.target).parents(selector).size() || $(e.target).is(selector);
}
// Otevri [html] Fancyboxem. Vytvori se docasne prvek s [id].
// - Fancybox si totiz presune to [html] v [id] bokem a po zavreni fancyboxu jej smaze.
function fancyboxHtml(id, html) {
$('
' + html + '
').appendTo("body");
$.fancybox({
'href' : '#' + id,
'titleShow' : false,
'transitionIn' : 'elastic',
'transitionOut' : 'elastic'
});
}
//only number input
function numbersonly(e, decimal) {
var key;
var keychar;
if (window.event) {
key = window.event.keyCode;
}
else if (e) {
key = e.which;
}
else {
return true;
}
keychar = String.fromCharCode(key);
if ((key==null) || (key==0) || (key==8) || (key==9) || (key==13) || (key==27) ) {
return true;
}
else if ((("0123456789").indexOf(keychar) > -1)) {
return true;
}
else if (decimal && (keychar == ".")) {
return true;
}
else
return false;
}
//-----------------------------------------------------------------
// COOKIES
$(function(){
$.fn.cookieconfirmB = function( options ) {
return;
var settings = {
'confirmtext' : 'This website uses cookies to ensure you get the best experience on our website.',
'buttonlabel' : 'OK',
'policylink' : '',
'background' : 'rgba(0,0,0,0.6)',
'cookiename' : 'cookiesapproved',
'cookievalue' : 'confirm'
};
if ( options ) { $.extend( settings, options );}
var cookiesconfirmok;
cookiesconfirmok = Cookies.get(settings.cookiename);
if( cookiesconfirmok != settings.cookievalue ){
var button = $('' + settings.buttonlabel + '')
.css({
'display':'inline-block',
'padding':'0.3em 0.5em',
'box-sizing':'border-box',
'margin':'0 0 0 0.3em',
'background':'#fff',
'color':'#000',
'font-size':'0.9em',
'font-weight':'bold',
'cursor':'pointer'
});
var cookietopcontent = $('' + settings.confirmtext + settings.policylink + '
')
.css({
'display':'none',
'position':'relative',
'bottm':'0px',
'left':'0px',
'z-index':'1001',
'max-width':'1200px',
'padding':'0.5em 1em',
'box-sizing':'border-box',
'margin':'0 auto',
'background':settings.background,
'color':'#fff',
'text-align':'center',
'font-size':'1.2em',
'line-height':'150%'
})
.fadeIn(3000)
.append(button);
$('').appendTo('body')
.css({
'position':'fixed',
'bottom':'0px',
'left':'0px',
'z-index':1000,
'width':'100%'
}).append(cookietopcontent);
$('body').on('click','#cookiesconfirmbtn', function(){
var t = $(this);
var tp = t.parent();
Cookies.set(settings.cookiename, settings.cookievalue, { expires: 365 });
tp.fadeOut(1500);
});
}
}
});
////////////////////////////////
(function( $ ){
$.fn.antispam = function( options ) {
var settings = {'emailname' : 'i','emaildomain' : 'd','emailltd' : 'c'};
if ( options ) { $.extend( settings, options );}
this.each(function(){
aemail = $(this).html().split(',');
if( aemail[0] == undefined ){ aemail[0] = settings.emailname; }
if( aemail[1] == undefined ){ aemail[1] = settings.emaildomain; }
if( aemail[2] == undefined ){ aemail[2] = settings.emailltd; }
$(this).attr( 'href','mailto: ' + aemail[0] + '@' + aemail[1] + '.' + aemail[2] );
if( aemail[3] == undefined ){
$(this).html( aemail[0] + '@' + aemail[1] + '.' + aemail[2] );
}else{
$(this).html( aemail[3] );
}
});
};
})( jQuery );
/*
$('a.mail').antispam({
'emailname' : 'info','emaildomain' : 'empemont','emailltd' : 'cz'
});
*/
////////////////////////////////////
////////////////////////////////
(function( $ ){
$.fn.inputAlterText = function( options ) {
this.each(function(){
var o = $(this);
var a;
var t = o.attr('title');
o.val(t);
o.addClass('empty');
o.focus(function(){
a = ( o.val()=="" || o.val()==t ? '' : o.val() );
if( a == t ){ o.addClass('empty'); }else{ o.removeClass('empty'); }
o.val(a);
});
o.blur(function(){
a = ( o.val()=="" ? t : o.val() );
if( a == t ){ o.addClass('empty'); }else{ o.removeClass('empty'); }
o.val(a);
});
});
};
})( jQuery );
$(function() {
// Options for SuperBGImage
$.fn.superbgimage.options = {
};
});
function superbgimage_show(img){
//$('#prevbgslide,#nextbgslide').hide();
if( $.superbg_imgIndex>2 ){
//$('#prevbgslide,#nextbgslide').fadeIn(500);
$('#image_title').fadeIn('slow').html( $('#image_list a' + "[rel='" + img + "']").attr('title') );
//$('.imagecount').html( img + '/' + $.superbg_imgIndex )
};
}
function superbgimage_hide(img){
$('#image_title').fadeOut('slow',function(){});
}
function content_home_open(){
// if(!$("body.resize_full").length) return;
$('#content_home_container').stop().fadeIn(1000);
$("#content_home_show").parents(".footer_item").addClass("current");
}
function disableScroller(){
var jsp = $("#text_w").data('jsp');
if (jsp) {
jsp.destroy();
}
}
function callScroller(){
if( $("#text_w") && $("#text_w").data('jsp')) {
$("#text_w").data('jsp').reinitialise();
}else{
$('#text_w').jScrollPane({
//showArrows:true//,
verticalDragMinHeight: 80,
verticalDragMaxHeight: 80
// animateScroll:true
});
}
}
function map_adjust(){
$('#map_container').css({
'position' : 'fixed',
'top' : $('#top_nav').height() + 'px',
'left' : 0 + 'px',//$('#content').width()
'z-index' : 50,
'width' : $('#middle').width() + 'px',// - $('#content').width()
'height' : $('#middle_in').height()// - $('#top').height() - $('#menu_line').height() - $('#footer').height() + 'px'
});
}
// Numeric only control handler
jQuery.fn.ForceNumericOnly =
function()
{
return this.each(function()
{
$(this).keydown(function(e)
{
var key = e.charCode || e.keyCode || 0;
// allow backspace, tab, delete, arrows, numbers and keypad numbers ONLY
return (
key == 8 ||
key == 9 ||
key == 46 ||
(key >= 37 && key <= 40) ||
(key >= 48 && key <= 57) ||
(key >= 96 && key <= 105));
});
});
};
function validateEmail( email ) {
var reg = /^([A-Za-z0-9_+\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
var address = email;
if(reg.test(address) == false) {
return false;
}
return true;
}
/*
validatePhone("+420 123 456 789") // CZ
validatePhone(" 089-12345678") // DE
validatePhone("0151/1234567") // DE
validatePhone("089-12345-123") // DE?
validatePhone("(0231)123456") // DE?
*/
function validatePhone( phone ) {
//var reg = /^\+\d{3}\s{1}\d{3}\s{1}\d{3}\s{1}\d{3}$/;
// var reg = /^[\+\s\d]+$/;//
var reg = /^[\+\s\dx\-/()]+$/;
var lengthMax = "+420 123 456 789".length;
if(reg.test(phone) == false) {
return false;
}
phone = phone.replace(/\s+/g,' ');
phone = phone.replace(/^\s+/,'').replace(/\s+$/,''); // trim
if(phone.length > lengthMax) {
return false;
}
return true;
}
function validateInput(name) {
var val = $("input[name=" + name + "]").val();
return typeof(val) != "undefined" && // nevyplneny atribut [value]
val != 0; // "", " " ...
}
function home_offers_hide() {
if ($("body").hasClass("resize_small")) {
$(".home_offers_content").hide();
} else {
// fadeout :
$(".home_offers_content").stop().animate({"opacity":0}, function (){ $(this).css({"display":"none"}) });
}
}
function content_home_close(){
if ($("body").hasClass("resize_small")) {
$('#content_home_container #text_wrap').hide();
} else {
$('#content_home_container').stop().fadeOut(1000);
$("#content_home_show").parents(".footer_item").removeClass("current");
}
}
function viewport() {
if ('innerWidth' in window) {
return [window.innerWidth, window.innerHeight];
} else if('client' in window) {
return [client.width, client.height];
} else {
return [document.documentElement.clientWidth, document.documentElement.clientHeight];
}
}