var link = document.createElement("link");
link.href = "/stylesheets/site-js.css";
link.media = "screen,projection";
link.rel = "stylesheet";
link.type = "text/css";
document.getElementsByTagName("head")[0].appendChild(link);
if($.browser.msie && parseInt($.browser.version) === 6)
{
/**
* DD_belatedPNG: Adds IE6 support: PNG images for CSS background-image and HTML
.
* Author: Drew Diller
* Email: drew.diller@gmail.com
* URL: http://www.dillerdesign.com/experiment/DD_belatedPNG/
* Version: 0.0.8a
* Licensed under the MIT License: http://dillerdesign.com/experiment/DD_belatedPNG/#license
**/
var DD_belatedPNG={ns:"DD_belatedPNG",imgSize:{},delay:10,nodesFixed:0,createVmlNameSpace:function(){if(document.namespaces&&!document.namespaces[this.ns]){document.namespaces.add(this.ns,"urn:schemas-microsoft-com:vml")}},createVmlStyleSheet:function(){var b,a;b=document.createElement("style");b.setAttribute("media","screen");document.documentElement.firstChild.insertBefore(b,document.documentElement.firstChild.firstChild);if(b.styleSheet){b=b.styleSheet;b.addRule(this.ns+"\\:*","{behavior:url(#default#VML)}");b.addRule(this.ns+"\\:shape","position:absolute;");b.addRule("img."+this.ns+"_sizeFinder","behavior:none; border:none; position:absolute; z-index:-1; top:-10000px; visibility:hidden;");this.screenStyleSheet=b;a=document.createElement("style");a.setAttribute("media","print");document.documentElement.firstChild.insertBefore(a,document.documentElement.firstChild.firstChild);a=a.styleSheet;a.addRule(this.ns+"\\:*","{display: none !important;}");a.addRule("img."+this.ns+"_sizeFinder","{display: none !important;}")}},readPropertyChange:function(){var b,c,a;b=event.srcElement;if(!b.vmlInitiated){return}if(event.propertyName.search("background")!=-1||event.propertyName.search("border")!=-1){DD_belatedPNG.applyVML(b)}if(event.propertyName=="style.display"){c=(b.currentStyle.display=="none")?"none":"block";for(a in b.vml){if(b.vml.hasOwnProperty(a)){b.vml[a].shape.style.display=c}}}if(event.propertyName.search("filter")!=-1){DD_belatedPNG.vmlOpacity(b)}},vmlOpacity:function(b){if(b.currentStyle.filter.search("lpha")!=-1){var a=b.currentStyle.filter;a=parseInt(a.substring(a.lastIndexOf("=")+1,a.lastIndexOf(")")),10)/100;b.vml.color.shape.style.filter=b.currentStyle.filter;b.vml.image.fill.opacity=a}},handlePseudoHover:function(a){setTimeout(function(){DD_belatedPNG.applyVML(a)},1)},fix:function(a){if(this.screenStyleSheet){var c,b;c=a.split(",");for(b=0;bn.H){i.B=n.H}d.vml.image.shape.style.clip="rect("+i.T+"px "+(i.R+a)+"px "+i.B+"px "+(i.L+a)+"px)"}else{d.vml.image.shape.style.clip="rect("+f.T+"px "+f.R+"px "+f.B+"px "+f.L+"px)"}},figurePercentage:function(d,c,f,a){var b,e;e=true;b=(f=="X");switch(a){case"left":case"top":d[f]=0;break;case"center":d[f]=0.5;break;case"right":case"bottom":d[f]=1;break;default:if(a.search("%")!=-1){d[f]=parseInt(a,10)/100}else{e=false}}d[f]=Math.ceil(e?((c[b?"W":"H"]*d[f])-(c[b?"w":"h"]*d[f])):parseInt(a,10));if(d[f]%2===0){d[f]++}return d[f]},fixPng:function(c){c.style.behavior="none";var g,b,f,a,d;if(c.nodeName=="BODY"||c.nodeName=="TD"||c.nodeName=="TR"){return}c.isImg=false;if(c.nodeName=="IMG"){if(c.src.toLowerCase().search(/\.png$/)!=-1){c.isImg=true;c.style.visibility="hidden"}else{return}}else{if(c.currentStyle.backgroundImage.toLowerCase().search(".png")==-1){return}}g=DD_belatedPNG;c.vml={color:{},image:{}};b={shape:{},fill:{}};for(a in c.vml){if(c.vml.hasOwnProperty(a)){for(d in b){if(b.hasOwnProperty(d)){f=g.ns+":"+d;c.vml[a][d]=document.createElement(f)}}c.vml[a].shape.stroked=false;c.vml[a].shape.appendChild(c.vml[a].fill);c.parentNode.insertBefore(c.vml[a].shape,c)}}c.vml.image.shape.fillcolor="none";c.vml.image.fill.type="tile";c.vml.color.fill.on=false;g.attachHandlers(c);g.giveLayout(c);g.giveLayout(c.offsetParent);c.vmlInitiated=true;g.applyVML(c)}};try{document.execCommand("BackgroundImageCache",false,true)}catch(r){}DD_belatedPNG.createVmlNameSpace();DD_belatedPNG.createVmlStyleSheet();
}
$(document).ready(function() {
$(".with_default").each(function(index) {
if ($(this).val().length == 0) {
$(this).val($(this).attr('dv'));
}
var that = this;
$(this).parents('form').each(function() {
$(this).submit(function() {
if ($(that).val()==$(that).attr('dv')) { $(that).val(""); }
});
});
});
$(".with_default").blur(function () {
if ($(this).val().length == 0) {
$(this).val($(this).attr('dv'));
}
});
$(".with_default").focus(function () {
if ($(this).val() == $(this).attr('dv')) {
$(this).val("");
}
});
});
/*
* jQuery history plugin
*
* Copyright (c) 2006 Taku Sano (Mikage Sawatari)
* Licensed under the MIT License:
* http://www.opensource.org/licenses/mit-license.php
*
* Modified by Lincoln Cooper to add Safari support and only call the callback once during initialization
* for msie when no initial hash supplied.
* API rewrite by Lauris Bukðis-Haberkorns
*/
(function($) {
function History()
{
this._curHash = '';
this._callback = function(hash){};
};
$.extend(History.prototype, {
init: function(callback) {
this._callback = callback;
this._curHash = location.hash;
if($.browser.msie) {
// To stop the callback firing twice during initilization if no hash present
if (this._curHash == '') {
this._curHash = '#';
}
// add hidden iframe for IE
$("body").prepend('');
var iframe = $("#jQuery_history")[0].contentWindow.document;
iframe.open();
iframe.close();
iframe.location.hash = this._curHash;
}
else if ($.browser.safari) {
// etablish back/forward stacks
this._historyBackStack = [];
this._historyBackStack.length = history.length;
this._historyForwardStack = [];
this._isFirst = true;
this._dontCheck = false;
}
this._callback(this._curHash.replace(/^#/, ''));
setInterval(this._check, 100);
},
add: function(hash) {
// This makes the looping function do something
this._historyBackStack.push(hash);
this._historyForwardStack.length = 0; // clear forwardStack (true click occured)
this._isFirst = true;
},
_check: function() {
if($.browser.msie) {
// On IE, check for location.hash of iframe
var ihistory = $("#jQuery_history")[0];
var iframe = ihistory.contentDocument || ihistory.contentWindow.document;
var current_hash = iframe.location.hash;
if(current_hash != $.history._curHash) {
location.hash = current_hash;
$.history._curHash = current_hash;
$.history._callback(current_hash.replace(/^#/, ''));
}
} else if ($.browser.safari) {
if (!$.history._dontCheck) {
var historyDelta = history.length - $.history._historyBackStack.length;
if (historyDelta) { // back or forward button has been pushed
$.history._isFirst = false;
if (historyDelta < 0) { // back button has been pushed
// move items to forward stack
for (var i = 0; i < Math.abs(historyDelta); i++) $.history._historyForwardStack.unshift($.history._historyBackStack.pop());
} else { // forward button has been pushed
// move items to back stack
for (var i = 0; i < historyDelta; i++) $.history._historyBackStack.push($.history._historyForwardStack.shift());
}
var cachedHash = $.history._historyBackStack[$.history._historyBackStack.length - 1];
if (cachedHash != undefined) {
$.history._curHash = location.hash;
$.history._callback(cachedHash);
}
} else if ($.history._historyBackStack[$.history._historyBackStack.length - 1] == undefined && !$.history._isFirst) {
// back button has been pushed to beginning and URL already pointed to hash (e.g. a bookmark)
// document.URL doesn't change in Safari
if (location.hash.indexOf('#') >= 0) {
$.history._callback(location.hash.split('#')[1]);
} else {
$.history._callback('');
}
$.history._isFirst = true;
}
}
} else {
// otherwise, check for location.hash
var current_hash = location.hash;
if(current_hash != $.history._curHash) {
$.history._curHash = current_hash;
$.history._callback(current_hash.replace(/^#/, ''));
}
}
},
isKonqueror: function() {
return /KHTML|Konqueror/.test(navigator.userAgent);
},
load: function(hash) {
var newhash;
if ($.browser.safari) {
newhash = hash;
} else {
newhash = (this.isKonqueror() ? '' : '#') + hash;
location.hash = newhash;
}
this._curHash = newhash;
if ($.browser.msie) {
var ihistory = $("#jQuery_history")[0]; // TODO: need contentDocument?
var iframe = ihistory.contentWindow.document;
iframe.open();
iframe.close();
iframe.location.hash = newhash;
this._callback(hash);
}
else if ($.browser.safari) {
this._dontCheck = true;
// Manually keep track of the history values for Safari
this.add(hash);
// Wait a while before allowing checking so that Safari has time to update the "history" object
// correctly (otherwise the check loop would detect a false change in hash).
var fn = function() {$.history._dontCheck = false;};
window.setTimeout(fn, 200);
this._callback(hash);
// N.B. "location.hash=" must be the last line of code for Safari as execution stops afterwards.
// By explicitly using the "location.hash" command (instead of using a variable set to "location.hash") the
// URL in the browser and the "history" object are both updated correctly.
location.hash = newhash;
}
else {
this._callback(hash);
}
}
});
jQuery.validator.addMethod("default_value_required", function(value, element) {
return($(element).attr('defaultvalue') == value || value == '') ? false : true;
//return true;
}, "Lamo");
$(document).ready(function() {
$.history = new History(); // singleton instance
afterRenderCallback();
});
})(jQuery);
jQuery.fn.DefaultValue = function(text){
return this.each(function(){
//Make sure we're dealing with text-based form fields
if(this.type != 'text' && this.type != 'password' && this.type != 'textarea')
return;
//Store field reference
var fld_current=this;
$(this).attr("defaultvalue", $(this).val());
//Set value initially if none are specified
if(this.value=='') {
this.value=text;
} else {
//Other value exists - ignore
return;
}
//Remove values on focus
$(this).focus(function() {
if(this.value==text || this.value=='')
this.value='';
});
//Place values back on blur
$(this).live("blur",function() {
if(this.value==text || this.value=='')
this.value=text;
});
//Capture parent form submission
//Remove field values that are still default
$(this).parents("form").each(function() {
//Bind parent form submit
$(this).submit(function() {
if(fld_current.value==text) {
fld_current.value='';
}
});
});
});
};
function setDefaultValues() {
var $name_register = $("#register-form input[name='name_register']"),
$company = $("#register-form input[name='company']"),
$city = $("#register-form input[name='city']"),
$email_register = $("#register-form input[name='email_register']"),
$phone = $("#register-form input[name='phone']");
$name = $("#contact-us-form input[name='name']"),
$city = $("#contact-us-form input[name='city']"),
$phone = $("#contact-us-form input[name='phone']"),
$email = $("#contact-us-form input[name='email']"),
$description = $("#contact-us-form textarea[name='description']"),
$bname = $("#contact-us-form input[name='test_drive_request[name]']"),
$bcity = $("#contact-us-form input[name='test_drive_request[city]']"),
$bphone = $("#contact-us-form input[name='test_drive_request[phone]']"),
$bemail = $("#contact-us-form input[name='test_drive_request[email]']"),
$binquiry = $("#contact-us-form input[name='test_drive_request[inquiry]']");
$cname = $("#sendSpecsBoxForm input[name='cname']"),
$cemail = $("#sendSpecsBoxForm input[name='cemail']"),
$cdescription = $("#sendSpecsBoxForm textarea[name='cdescription']");
$sfyemail = $("#sendToFriend input[name='sfyemail']"),
$sffemail = $("#sendToFriend input[name='sffemail']"),
$sfdescription = $("#sendToFriend textarea[name='sfdescription']");
if($name_register.length>0) $name_register.DefaultValue("Vaše jméno");
if($company.length>0) $company.DefaultValue("Společnost");
if($city.length>0) $city.DefaultValue("Město");
if($email_register.length>0) $email_register.DefaultValue("Email");
if($phone.length>0) $phone.DefaultValue("Telefon");
if($name.length>0) $name.DefaultValue($name.attr('dv'));
if($email.length>0) $email.DefaultValue($email.attr('dv'));
if($description.length>0) $description.DefaultValue($description.attr('dv'));
if($bname.length>0) $bname.DefaultValue($bname.attr('dv'));
if($bcity.length>0) $bcity.DefaultValue($bcity.attr('dv'));
if($bphone.length>0) $bphone.DefaultValue($bphone.attr('dv'));
if($bemail.length>0) $bemail.DefaultValue($bemail.attr('dv'));
if($binquiry.length>0) $binquiry.DefaultValue($binquiry.attr('dv'));
if($cname.length>0) $cname.DefaultValue($cname.attr('dv'));
if($cemail.length>0) $cemail.DefaultValue($cemail.attr('dv'));
if($cdescription.length>0) $cdescription.DefaultValue($cdescription.attr('dv'));
if($sfyemail.length>0) $sfyemail.DefaultValue($sfyemail.attr('dv'));
if($sffemail.length>0) $sffemail.DefaultValue($sffemail.attr('dv'));
if($sfdescription.length>0) $sfdescription.DefaultValue($sfdescription.attr('dv'));
}
$(document).ready(function () {
setDefaultValues();
$(".advExpandBoxToggleButton a").click(function () {
var $p = $(this).parents('.advExpandBox');
var $d = $(".advExpandBoxContentHidden",$p);
if($d.is(":visible")) {
$(this).removeClass('close');
$d.slideUp('fast');
} else {
$(this).addClass('close');
$d.slideDown('fast');
}
});
function activeService(that) {
noactiveService();
$(".top",that).css({"background-image":"url(./images/content/active-expnd-top.gif)","height":"7px"});
$(".middle-inner",that).css({"background-color":"#adadad"});
$(".bottom",that).css({"background-image":"url(./images/content/active-expnd-bottom.gif)"});
}
function noactiveService() {
$(".expandbox .top").removeAttr("style");
$(".expandbox .middle-inner").removeAttr("style");
$(".expandbox .bottom").removeAttr("style");
}
$(".expandbox").hover(function () {
var index = $(".expandbox").index(this);
$("#maps img:eq("+index+")").css({"z-index":"1"});
if($.browser.msie && $.browser.version.substr(0,1) === "6") {
activeService(this);
}
},function () {
$("#maps img").css({"z-index":"1"});
});
$(".marker").mouseover(function () {
var index = $(".marker").index(this);
var id = $(this).attr("id");
$(this).attr({"id":id+"-active"}).addClass("marker-active");
$(this).attr({"noactiveId":id});
$("#maps img:eq("+index+")").css({"z-index":"1"});
activeService($(".expandbox").eq(index));
}).mouseout(function (){
$(this).attr({"id":$(this).attr("noactiveId")}).removeClass("marker-active");
$("#maps img").css({"z-index":"1"});
var index = $(".marker").index(this);
noactiveService($(".expandbox").eq(index));
}).click(function () {
var index = $(".marker").index(this);
$(".expandbox .advExpandBoxToggleButton a").eq(index).trigger('click');
});
});
jQuery(function($) {
/* ----------------------------------------------------------------
toggle_container
---------------------------------------------------------------- */
$(".toggle_container").hide();
$(".crumbs").click(function() {
if ($(this).next().is(':visible')) {
$(this).removeClass("active");
} else {
$(this).addClass("active");
}
return false;
});
/*
$('#icon2').click(function() {
if ($("#servicebox2 .crumbs").hasClass("active")) {
$("#servicebox2 .crumbs").removeClass("active");
} else {
$("#servicebox2 .crumbs").addClass("active");
}
return false;
});
// below
*/
$("#maps .boxMap").click(function() {
var id = $(this).attr("id").replace("icon", "");
if ($("#servicebox"+id+" .crumbs").hasClass("active")) {
$("#servicebox"+id+" .crumbs").removeClass("active");
} else {
$("#servicebox"+id+" .crumbs").addClass("active");
}
return false;
});
/*
$('#icon2').hover(function() {
$('#servicebox2').addClass('hover');
}, function() {
$('#servicebox2').removeClass('hover');
}
);
// below
*/
$("#maps .boxMap").hover(function() {
var id = $(this).attr("id").replace("icon", "");
$("#servicebox"+id).addClass("hover");
}, function() {
$(".expandbox").removeClass("hover");
});
/*
$('#servicebox2').hover(function() {
$('#icon2').addClass('hover');
}, function() {
$('#icon2').removeClass('hover');
}
);
// below
*/
$(".expandbox").hover(function() {
var id = $(this).attr("id").replace("servicebox", "");
$("#icon"+id).addClass("hover");
}, function() {
$("#maps .boxMap").removeClass("hover");
});
/*
$("#servicebox2 .crumbs, #icon2").click(function () {
$("#servicebox2 .toggle_container").toggle("fast");
});
// below
*/
$(".expandbox .crumbs, #maps .boxMap").click(function() {
var id = $(this).attr("id").replace("icon", "");
// ak sa jedna o click na expadbox crumb tak riadok vyssie neplati, pretoze crumb nema toto id, musi sa teda zistit inak
// ked je teda id pradzne lebo sa vyssie nezistilo z crumb
if (id == "") {
// tak sa ide smerom k parentom crumbu k tomu ktory ma class .expandbox a zisti sa jeho id ktore uz existuje
id = $(this).parents(".expandbox").attr("id").replace("servicebox", "");
}
$("#servicebox"+id+" .toggle_container").toggle("fast");
});
});
function afterRenderCallback() {
$fotoN = $('#index .boxPadding2 .rada-n'),
$fotoF = $('#index .boxPadding2 .rada-f'),
$wallpapers = $('#index .boxPadding2 .tapety'),
$allItems = $('#index .boxPadding li'),
$keStazeniActive = $(".tabboxMenu li a").eq(0).hasClass("active"),
$galerieActive = $(".tabboxMenu li a").eq(1).hasClass("active"),
$serviceBanner = $(".servicesBanner a"),
$specF = $('#index .boxPadding .specF.active'),
$specN = $('#index .boxPadding .specN.active'),
$catF = $('#index .boxPadding .catF.active'),
$catN = $('#index .boxPadding .catN.active'),
$video = $('.videoOverlay');
$("a.blank").live("click", function() {
this.target = "_blank";
});
$(".overlay-close").live("click",function () {
$.closeDOMWindow();
});
var overlaySettings = {
// eventType:'click',
width: 780,
height: 650,
borderSize:0,
windowPadding: 0,
windowBGColor:'transparent',
windowSource: 'ajax',
windowSourceURL: '/fotogalerie',
modal: 0,
loader:1,
loaderImagePath:'/images/animationProcessing.gif',
loaderHeight:16,
loaderWidth:17
};
/*
$video.click(function (e) {
// alert($video);
// e.target.showDOMWindow(overlaySettings);
$video.openDOMWindow(overlaySettings);
e.preventDefault();
alert('click');
}
); */
overlaySettings = $.extend(overlaySettings,{eventType: 'click'});
if($video.length>0) {
overlaySettings = $.extend(overlaySettings,{windowSourceURL: '/video'});
$video.openDOMWindow(overlaySettings);
}
// Specification - CZ
if($specF.length>0 && $keStazeniActive) {
overlaySettings = $.extend(overlaySettings,{windowSourceURL: '/lighSpec-F-cz.html'});
$specF.openDOMWindow(overlaySettings);
}
if($specN.length>0 && $keStazeniActive) {
overlaySettings = $.extend(overlaySettings,{windowSourceURL: '/lighSpec-N-cz.html'});
$specN.openDOMWindow(overlaySettings);
}
if($catF.length>0 && $keStazeniActive) {
overlaySettings = $.extend(overlaySettings,{windowSourceURL: '/lighCat-F-cz.html'});
$catF.openDOMWindow(overlaySettings);
}
if($catN.length>0 && $keStazeniActive) {
overlaySettings = $.extend(overlaySettings,{windowSourceURL: '/lighCat-N-cz.html'});
$catN.openDOMWindow(overlaySettings);
}
// Foto N
if($fotoN.length>0 && $galerieActive) {
overlaySettings = $.extend(overlaySettings,{windowSourceURL: '/fotogalerie/foto-n'});
$fotoN.openDOMWindow(overlaySettings);
}
// Foto F
if($fotoF.length>0 && $galerieActive) {
overlaySettings = $.extend(overlaySettings,{windowSourceURL: '/fotogalerie/foto-f'});
$fotoF.openDOMWindow(overlaySettings);
}
// Wallpapers
if($wallpapers.length>0 && $galerieActive) {
overlaySettings = $.extend(overlaySettings,{windowSourceURL: '/fotogalerie/wallpapers'});
$wallpapers.openDOMWindow(overlaySettings);
}
/*if($allItems.length>0 && $novinkyActive) {
overlaySettings = $.extend(overlaySettings,{windowSourceURL: '/novinky'});
$allItems.openDOMWindow(overlaySettings);
}*/
if($serviceBanner.length>0) {
overlaySettings = $.extend(overlaySettings,{windowSourceURL: '/podminky.html'});
$serviceBanner.openDOMWindow(overlaySettings);
}
delete overlaySettings;
}
// PageLoad function
// This function is called when:
// 1. after calling $.historyInit();
// 2. after calling $.historyLoad();
// 3. after pushing "Go Back" button of a browser
function pageload(hash) {
// hash doesn't contain the first # character.
if(hash) {
// restore ajax loaded state
$(".tabbox .box").html("");
$("#load").load("ziskej-tab?tab="+hash,function () {
afterRenderCallback();
});
var tpClass = $(".tabbox").attr("class").split(" ");
if(typeof tpClass[2] != "undefined") {
$(".tabbox").removeClass(tpClass[2]);
}
$(".tabbox").addClass(hash+"TabBox");
$(".tabboxMenu a").removeClass("active");
$(".tabboxMenu a[href='#"+hash+"']").addClass("active");
}
}
$(function() {
var $bannersA = $("#banners > a"),
$bannersMenu = $("#banners .menu");
if($bannersA.length > 0) {
$bannersA.hide();
$bannersA.first().fadeIn();
$bannersMenu.children("div").click(function () {
var eq = $("div",$bannersMenu).index(this);
$bannersMenu.children("div").filter(".active").removeClass("active");
$(this).addClass('active');
$bannersA.filter(":visible").fadeOut();
$bannersA.eq(eq).fadeIn();
});
} else {
$bannersMenu.hide();
}
if($.browser.msie && parseInt($.browser.version) === 6)
{
DD_belatedPNG.fix('.png_fix');
}
// Initialize history plugin.
// The callback is called at once by present location.hash.
$.history.init(pageload);
// set onlick event for buttons
$("a[rel='history']").click(function(){
//
var hash = this.href;
hash = hash.replace(/^.*#/, '');
// moves to a new page.
// pageload is called at once.
$(".tabbox .box").html("");
$.history.load(hash,function () {
afterRenderCallback();
});
var tpClass = $(".tabbox").attr("class").split(" ");
if(typeof tpClass[2] != "undefined") {
$(".tabbox").removeClass(tpClass[2]);
}
$(".tabbox").addClass(hash+"TabBox");
$(".tabboxMenu a").removeClass("active");
$(".tabboxMenu a[href='#"+hash+"']").addClass("active");
return false;
});
var $contactform = $("#contact-form");
if($contactform.length>0) {
$contactform.validate({
ignore: ':hidden',
onkeyup: false,
focusInvalid: false,
focusCleanup: false,
errorElement : 'span',
errorClass : 'errors-side-error',
errorPlacement: function(error, element) {
$(element).before(error);
},
rules: {
"name2" : {
"default_value_required" : true
},
"phone" : {
"default_value_required" : true,
"number" : true
}
},
messages: {
"name2" : {
"default_value_required" : "Zadejte jméno"
},
"phone" : {
"default_value_required" : "Váš telefon",
"number" : "Nesprávný formát"
}
},
submitHandler: function (form) {
$(form).ajaxSubmit();
$(form).resetForm();
$("#forms .contact-f").addClass('visuallyhidden');
$(form).parents('#forms').children(".thanks").removeClass('visuallyhidden');
setTimeout(function () {
$("#forms .thanks").addClass('visuallyhidden');
$("#forms .introduction").removeClass('visuallyhidden');
},3000);
try {
var pageTracker = _gat._getTracker("UA-396618-16");
pageTracker._trackPageview("/cile/objednani_kontakt.html");
pageTracker._trackEvent('Objednani', 'Kontakt');
} catch(err) {}
}
});
var $name_cf = $("#sidebar_name2",$contactform);
if($name_cf.val().length>0) $name_cf.DefaultValue("Vaše jméno");
var $phone_cf = $("#sidebar_phone",$contactform);
if($phone_cf.val().length>0) $phone_cf.DefaultValue("Váš telefon");
var $city_cf = $("#sidebar_city",$contactform);
if($city_cf.val().length>0) $city_cf.DefaultValue("Vaše město");
}
$("input").bind("focus",function () {
if($(this).val() == $(this).attr("defaultvalue")) $(this).val('');
})
.bind("blur",function () {
if($(this).val() == '') $(this).val($(this).attr("defaultvalue"));
});
var $tripform = $("#trip-form");
if($tripform.length>0) {
$tripform.validate({
ignore: ':hidden',
onkeyup: false,
focusInvalid: false,
focusCleanup: false,
errorElement : 'span',
errorClass : 'errors-side-error',
errorPlacement: function(error, element) {
$(element).before(error);
},
rules: {
"name" : {
"default_value_required" : true
},
"email" : {
"default_value_required" : true,
"email" : true
}
},
messages: {
"name" : "Zadejte jméno",
"email" : {
"default_value_required" : "Váš E-mail",
"email" : "Nesprávný formát"
}
},
submitHandler: function (form) {
$(form).ajaxSubmit();
$(form).resetForm();
$("#forms .trip-f").addClass('visuallyhidden');
$("#forms .trip-f-en").addClass('visuallyhidden');
$(form).parents('#forms').children(".thanks").removeClass('visuallyhidden');
setTimeout(function () {
$("#forms .thanks").addClass('visuallyhidden');
$("#forms .introduction").removeClass('visuallyhidden');
},3000);
try {
var pageTracker = _gat._getTracker("UA-396618-16");
pageTracker._trackPageview("/cile/objednani_jizdy.html");
pageTracker._trackEvent('Objednani', 'Jizdy');
} catch(err) {}
}
});
var $name_tf = $("#sidebar_name",$tripform);
$email_tf = $("#sidebar_email",$tripform);
$phone_tf = $("#sidebar_phone",$tripform);
$city_tf = $("#sidebar_city");
if($name_tf.val().length>0) {
$name_tf.DefaultValue("Vaše jméno");
}
if($email_tf.val().length>0) {
$email_tf.DefaultValue("Váš email");
}
if($phone_tf.val().length>0) {
$phone_tf.DefaultValue("Váš telefon");
}
if($city_tf.val().length>0) {
$city_tf.DefaultValue("Vaše město");
}
}
if($("#register-form form").length>0) {
$("#register-form form").validate({
ignore: ':hidden',
onkeyup: false,
focusInvalid: false,
focusCleanup: false,
errorElement : 'span',
errorClass : 'errors',
errorPlacement: function(error, element) {
$(element).before(error);
},
rules: {
"type_register": "required",
"name_register" : "required",
"company" : "required",
"city" : "required",
"email_register" : {
"required" : true,
"email" : true
},
"phone" : "required"
},
messages: {
"type_register": "Zvolte 1 možnost",
"name_register": "Vaše jméno",
"company" : "Zadejte společnost",
"city" : "Zadejte město",
"email_register" : {
"required" : "Váš email",
"email" : "Nesprávný formát"
},
"phone" : "Váš telefon"
},
submitHandler: function (form) {
$(form).ajaxSubmit();
$(form).resetForm().hide();
$(form).parent().children("#register-form-thanks").show();
$('body').append('
');
}
});
}
if($('.openOverlay').length>0) {
$('.openOverlay').openDOMWindow({
eventType:'click',
width: 380,
height: 339,
borderSize:0,
windowPadding: 0,
windowBGColor:'transparent',
modal: 1,
loader:1,
loaderImagePath:'/images/animationProcessing.gif',
loaderHeight:16,
loaderWidth:17
});
}
if($("#sendToFriendClose").length>0 && $("#sendToFriendThanks").length>0 && $("#sendToFriendFormWrap").length>0) {
$("#sendToFriendClose").live("click",function () {
if($("#sendToFriendThanks").is(":visible")) {
$("#sendToFriendThanks").hide(function () {
$("#sendToFriendForm, #sendToFriendFormWrap").show();
});
}
$.closeDOMWindow();
$("#sendToFriendFormWrap").resetForm();
setDefaultValues();
});
$("#sendToFriendFormWrap").validate({
ignore: ':hidden',
focusInvalid: false,
focusCleanup: false,
errorElement : 'span',
errorClass : 'errors',
errorPlacement: function(error, element) {
$(element).before(error);
},
rules: {
"sfyemail": {
"required" : true,
"email" : true
},
"sffemail": {
"required" : true,
"email" : true
}
},
messages: {
"sfyemail": {
"required" : "Povinný údaj",
"email" : "Nesprávný formát"
},
"sffemail": {
"required" : "Povinný údaj",
"email" : "Nesprávný formát"
}
},
submitHandler: function (form) {
$(form).ajaxSubmit();
$(form).resetForm().hide();
$(form).parents("#sendToFriendForm").next().show();
}
});
}
if($("#sendSpecsBoxClose").length>0 && $("#sendSpecsBoxThanks").length>0 && $("#sendSpecsBoxFormWrap").length>0) {
$("#sendSpecsBoxClose").live("click",function () {
if($("#sendSpecsBoxThanks").is(":visible")) {
$("#sendSpecsBoxThanks").hide(function () {
$("#sendSpecsBoxForm, #sendSpecsBoxFormWrap").show();
});
}
$.closeDOMWindow();
$("#sendSpecsBoxFormWrap").resetForm();
setDefaultValues();
});
$("#sendSpecsBoxFormWrap").validate({
ignore: ':hidden',
focusInvalid: false,
focusCleanup: false,
errorElement : 'span',
errorClass : 'errors',
errorPlacement: function(error, element) {
$(element).before(error);
},
rules: {
"cname": "required",
"cemail": {
"required" : true,
"email" : true
}
},
messages: {
"cname": "Povinný údaj",
"cemail": {
"required" : "Povinný údaj",
"email" : "Nesprávný formát"
}
},
submitHandler: function (form) {
$(form).ajaxSubmit();
$(form).resetForm().hide();
$(form).parents("#sendSpecsBoxForm").next().show();
}
});
}
/*
$("#popUpClose").live("click",function () {
if($("#hp_banner").is(":visible")) {
$("#hp_banner").hide();
}
$.closeDOMWindow();
});
*/
if($("#window-contact-us-close").length>0 && $("#contact-us-thanks").length>0 && $("#contact-us-form-wrapper").length>0) {
$("#window-contact-us-close").live("click",function () {
if($("#contact-us-thanks").is(":visible")) {
$("#contact-us-thanks").hide(function () {
$("#contact-us-form, #contact-us-form-wrapper").show();
});
}
$.closeDOMWindow();
$("#contact-us-form-wrapper").resetForm();
setDefaultValues();
});
$("#contact-us-form-wrapper").validate({
ignore: ':hidden',
onkeyup: false,
focusInvalid: false,
focusCleanup: false,
errorElement : 'span',
errorClass : 'errors',
errorPlacement: function(error, element) {
$(element).before(error);
},
rules: {
"name": "required",
"city": "required",
"phone": "required",
"email": {
"required" : true,
"email" : true
},
"description" : "required",
"test_drive_request[name]": "required",
"test_drive_request[phone]": "required",
"test_drive_request[email]": {
"required" : true,
"email" : true
}
},
messages: {
"name": "Povinný údaj",
"city": "Povinný údaj",
"phone": "Povinný údaj",
"email": {
"required" : "Povinný údaj",
"email" : "Nesprávný formát"
},
"description": "Povinný údaj",
"test_drive_request[name]": "povinný údaj: Vaše jméno",
"test_drive_request[phone]": "povinný údaj: Váš telefon",
"test_drive_request[email]": {
"required" : "povinný údaj: Váš e-mail",
"email" : "Nesprávný formát"
}
},
submitHandler: function (form) {
$(form).ajaxSubmit();
$(form).resetForm().hide();
$(form).parents("#contact-us-form").next().show();
}
});
}
if($("#step0 #configurator-form form").length>0) {
var $name = $("#name_configurator"),
$email = $("#email_configurator");
if($name.length>0) $name.DefaultValue("Vaše jméno");
if($email.length>0) $email.DefaultValue("Váš email");
$("#step0 #configurator-form form").validate({
ignore: ':hidden',
focusInvalid: false,
focusCleanup: false,
errorElement : 'span',
errorClass : 'errors',
errorPlacement: function(error, element) {
$(element).before(error);
},
rules: {
"name_configurator": "required",
"email_configurator": {
"required" : true,
"email" : true
}
},
messages: {
"name_configurator": "Povinný údaj",
"email_configurator": {
"required" : "Povinný údaj",
"email" : "Nesprávný formát"
}
},
submitHandler: function (form) {
$("#step0").fadeOut(function () {
$(".step").fadeIn();
});
}
});
}
/* global steps */
function setExpandable(d) {
d.bind("click",function () {
if($(".icon",this).hasClass("minus")) {
$(".icon",this).removeClass("minus");
$(this).next().fadeOut();
//$(this).next().next().fadeOut();
d.removeClass("sactive");
} else {
$(".icon",d).removeClass("minus");
$(".substep-content.js-hide",d).fadeOut();
$(".icon",this).addClass("minus");
$(this).next().fadeIn();
//$(this).next().next().fadeIn();
$(this).addClass("sactive");
}
});
}
function unsetExpandable(d) {
d.unbind("click");
}
function getTextPriority(n) {
switch(n) {
case "0":
return "";
break;
case "1":
return "X
";
break;
case "2":
return "XX
";
break;
}
}
function callAjaxForDetails(stepNumber,d,callBack,$sh) {
var $that = $(d),
$business_id = $that.next().val();
var $parent = $(d).parents(".substep-content"),
$loader = $parent.next().next();
$parent.fadeOut(function () {
$sh.unbind("click");
$loader.fadeIn(function () {
var queryString = {
business_id: $business_id,
step: stepNumber
};
$.ajax({
type: "POST",
dataType: "json",
url: "/javascripts/get_info.js",
data: $.param(queryString),
cache: false,
success: function(obj){
var $nextStep = $parent.next();
callBack($nextStep,$that,obj);
$loader.fadeOut(function () {
$nextStep.fadeIn();
});
},error: function (XMLHttpRequest, textStatus, errorThrown) {
alert("Během provádění požadavku nastala chyba. Omlouváme se.");
}
});
});
});
}
/* step 1 */
//var $sh = $(".substep-headline:eq(0)");
//if($sh.length>0) {
//setExpandable($sh);
$("#step1 li label").hover(
function () {
$(this).addClass("over");
},
function () {
$(this).removeClass("over");
}
).click(function () {
$("#step1 li label").removeClass("checked");
$(this).addClass("checked");
/*
$("#h3-chassins-wb-code, .h3-chassins-wb-code, #h3-chassins-wb-code2, #h3-chassins-wb-code3, #h3-body-type, .vertical-line",$sh).fadeIn();
callAjaxForDetails(1,this,function ($nextStepReferences,$that,jsonObj) {
$(".selected-option img",$nextStepReferences).attr("src",$("img",$that).attr("src"));
$(".selected-option h2",$nextStepReferences).text($that.text());
$(".type.head h3",$nextStepReferences).text(jsonObj.type);
$(".type.body img",$nextStepReferences).attr("src","/images/configurator/step1/substep1/body-types/"+jsonObj.type_src);
$(".types.priority.f0 div",$nextStepReferences).html(getTextPriority(jsonObj.wb_code[0]["priority"]));
$(".types.priority.f1 div",$nextStepReferences).html(getTextPriority(jsonObj.wb_code[1]["priority"]));
$(".types.priority.f2 div",$nextStepReferences).html(getTextPriority(jsonObj.wb_code[2]["priority"]));
step2();
},$sh);
*/
});
//}
/* end step1 */
/* step2 */
//function step2() {
//setExpandable($sh2);
$("#step2 label").hover(
function () {
$(this).addClass("over" + $("#step2 label").index(this));
},
function () {
$(this).removeClass("over" + $("#step2 label").index(this));
}
).click(function () {
if(!$(this).hasClass("na")) {
$("#step2 li label .checker").hide();
$(".checker",this).show();
/*
$("#h3-chassins-wb-code, .h3-chassins-wb-code, #h3-chassins-wb-code2, #h3-chassins-wb-code3, #h3-body-type, .vertical-line",$sh2).fadeIn();
callAjaxForDetails(2,this,function ($nextStepReferences,$that,jsonObj) {
$(".selected-option img",$nextStepReferences).attr({
"src":"/images/configurator/step2/payload/"+jsonObj.src,
"alt" : jsonObj.field
});
$(".types.priority.f0 div",$nextStepReferences).html(getTextPriority(jsonObj.type [0]["priority"]));
$(".types.priority.f1 div",$nextStepReferences).html(getTextPriority(jsonObj.type[1]["priority"]));
$(".types.priority.f2 div",$nextStepReferences).html(getTextPriority(jsonObj.type[2]["priority"]));
step3();
},$sh2);
*/
}
});
//}
/* end step2 */
/* step3 */
//function step3() {
//var $sh3 = $(".substep-headline:eq(2)");
//if($sh3.length>0) {
//setExpandable($sh3);
$("#step3 label").hover(
function () {
$(this).addClass("over");
},
function () {
$(this).removeClass("over");
}
).click(function () {
$("#step3 li label .checker").hide();
$(".checker",this).show();
/*
$("#h3-chassins-wb-code, .h3-chassins-wb-code, #h3-chassins-wb-code2, #h3-chassins-wb-code3, #h3-body-type, .vertical-line",$sh3).fadeIn();
callAjaxForDetails(3,this,function ($nextStepReferences,$that,jsonObj) {
$(".selected-option img",$nextStepReferences).attr({
"src":"/images/configurator/step3/special/"+jsonObj.src_final,
"alt" : jsonObj.field
});
$(".types.priority:eq(0) div",$nextStepReferences).html(getTextPriority(jsonObj.type[0]["priority"]));
$(".types.priority:eq(1) div",$nextStepReferences).html(getTextPriority(jsonObj.type[1]["priority"]));
$(".types.priority:eq(2) div",$nextStepReferences).html(getTextPriority(jsonObj.type[2]["priority"]));
$(".types.priority:eq(3) div",$nextStepReferences).html(getTextPriority(jsonObj.type[3]["priority"]));
$(".types.priority:eq(4) div",$nextStepReferences).html(getTextPriority(jsonObj.type[4]["priority"]));
$(".types.priority:eq(5) div",$nextStepReferences).html(getTextPriority(jsonObj.type[5]["priority"]));
step4();
},$sh3);
*/
});
//}
//};
/* end step3 */
/* step4 */
//function step4() {
//var $sh4 = $(".substep-headline:eq(3)");
//if($sh4.length>0) {
//setExpandable($sh4);
$("#step4 #cabin-viewer .cabin:first").show();
$("#step4 label").click(function () {
$("#step4 li label .checker").hide();
$(".checker", this).show();
$("#step4 #cabin-viewer .cabin").hide();
var index = $("#step4 label").index(this);
$(".cabin:eq("+index+")").show();
});
step5();
//}
//};
/* end step4 */
/* step5 */
function step5() {
var $sh5 = $(".substep-headline:eq(4)");
if($sh5.length>0) {
$sh5.bind("click",function (e) {
unsetExpandable($(".substep-headline:eq(3)"));
$(this).addClass("sactive");
$parent = $sh5.parents("#step5").prev();
$loader = $(".substep-content.loader",$parent);
$loader.prev().fadeOut(function () {
$loader.fadeIn(function () {
var qs = $("#configuration-result-step0").formSerialize()+"&"+$("#configuration-result").formSerialize();
$.ajax({
type: "POST",
dataType: "json",
url: "/configuration-result/",
data: qs,
success: function(data){
step6(data);
},
error: function () {
alert("Omlouváme se nastala neočekávaná chyba. Zkuste to prosím později.");
}
});
});
});
e.stopPropagation();
});
}
};
/* end step5 */
/* step6 */
function step6(json) {
window.scrollTo(0,0);
$("#configurator .substep-content, #configurator .step .vertical-line, #configurator .step .vertical-line, #configurator .step #h3-chassins-wb-code, .h3-chassins-wb-code, #h3-chassins-wb-code2, #h3-chassins-wb-code3, #configurator .step #h3-body-type").hide();
$("#configurator .icon.minus").removeClass("minus");
$("#stepLast, #stepLast #topLast, #stepLast .substep-content").show();
$("#stepLast h1 span").text(json.name);
$("#stepLast .final-truck img").attr({"src":"/images/configurator/stepLast/final/" + json.image})
$("#stepLast .download").attr("href",json.specification);
}
/* end step6 */
$("#try-travel").click(function () {
$(this).parents(".form").addClass("visuallyhidden");
$(".trip-f").removeClass("visuallyhidden");
});
$("#try-travel-en").click(function () {
$(this).parents(".form").addClass("visuallyhidden");
$(".trip-f-en").removeClass("visuallyhidden");
});
$("#contact").click(function () {
$(this).parents(".form").addClass("visuallyhidden");
$(this).parents("#forms").children(".contact-f").removeClass("visuallyhidden");
});
$("body").addClass("JSsupport");
// tab is called by clicking the tabbox link
$(".tabboxContent div:eq(0)").show();
$(".tabboxMenu a").live('click',function() {
var d = $(this).attr("href"), s = d+"Tab", a = d.substring(1) + "TabBox", $parent = $(this).parents(".tabbox");
$(".tabboxContent .box:not("+s+")").css("display","none");
$(s).css("display","block");
$(".tabboxMenu a[href!="+ d +"]").removeClass("active");
$(".tabboxMenu a[href="+ d +"]").addClass("active");
var tpClass = $parent.attr("class").split(" ");
if(typeof tpClass[2] != "undefined") {
$parent.removeClass(tpClass[2]);
}
$parent.addClass(a);
});
$("a.blank").click(function(){
this.target = "_blank";
});
});
function loadContent(e) {
$.ajax({
beforeSend: function () {
$("body").addClass("loading");
},
complete: function () {
$("body").removeClass("loading");
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert("Error ocurred\nStatus:" + textStatus + "\nError thrown:" + errorThrown);
},
success: function (data) {
var $novinky = $('#novinky.lightbox');
var $galerie = $('#galerie.lightbox');
var $con = $novinky.length == 0 ? $galerie : $novinky;
$con.fadeOut(function() {
$(this).after(data).remove();
$con.hide().fadeIn();
})
},
timeout: 20000,
type: 'GET',
url: this.href
})
e.stopPropagation();
return false;
}
$(function () {
$(".paging a.prevNoClick").live('click', function(e){return false;});
$(".paging a:not(.prevNoClick)").live('click',loadContent);
// configurator step5 inputs - def vals in elevator.js
$("#confName").val(custNameDef);
$("#confComp").val(custCompDef);
$("#confName, #confComp").focus(function() {
var thisName = $(this).val();
if ( (thisName == custNameDef) || thisName == custCompDef ) {
$(this).val("");
}
});
$("#confName").blur(function() {
var confName = $("#confName").val();
if ( confName == custNameDef || confName == "" ) {
$(this).val(custNameDef);
} else {
$(this).val(confName);
}
});
$("#confComp").blur(function() {
var confComp = $("#confComp").val();
if ( confComp == custCompDef || confComp == "" ) {
$(this).val(custCompDef);
} else {
$(this).val(confComp);
}
});
});
$(document).ready(function(){
$('#boxDown .disabled A').live('click', function(){
return false;
});
// show spec. CZ
$("#cz").live('click',function(){
$("#boxDown").load($(this).attr('href'),function () {
afterRenderCallback();
});
return false;
});
// show spec. SK
$("#sk").live('click',function(){
$(this).attr('href');
$("#boxDown").load($(this).attr('href'),function (rrr) {
afterRenderCallback();
});
return false;
});
// show spec. PL
$("#pl").live('click',function(){
$("#boxDown").load($(this).attr('href'),function () {
afterRenderCallback();
});
return false;
});
});