$(document).ready(function(){
$('.eu-cookies button').click(function() {
var date = new Date();
date.setFullYear(date.getFullYear() + 10);
document.cookie = 'eu-cookies=1; path=/; expires=' + date.toGMTString();
$('.eu-cookies').hide();
});
// Odeslání kontakt ------------------------------------
$("#produkt-dotaz").bind('submit', function(e){
e.preventDefault();
$("select,textarea,input,select", "#produkt-dotaz").removeClass('error');
$("#message, #error").html("").hide();
$("#loading").fadeIn();
$("#posli-dotaz").attr('disabled','disabled');
$.ajax({
type: "POST",
url: "_produkt-dotaz.php",
data: $("#produkt-dotaz").serialize(),
timeout: 60000,
success: function(data, textStatus, jqXHR){
switch(data.status) {
case 'success':
for( var x = 0; x < data.msg.length ; x++ ) {
$("#message").append(data.msg[x] + "
");
};
$('input[type="text"], select, textarea').each(function(){
$(this).val('');
});
$('input[type="checkbox"]').each(function(){
$(this).removeAttr('checked');
});
$("#message").fadeIn();
break;
case 'error':
for( var x = 0; x < data.msg.length ; x++ ) {
$("#error").append(data.msg[x] + "
");
};
for( var x = 0; x < data.inputs.length ; x++ ) {
$("#"+ data.inputs[x]).addClass('error');
};
$("#error").fadeIn();
break;
}
},
error: function(jqXHR, textStatus, errorThrown ) {
$("#error").html("Nastal problém při odesílání, zkuste to později.");
$("#error").fadeIn();
},
complete: function(jqXHR, textStatus ) {
$("#loading").hide();
$("#posli-dotaz").removeAttr('disabled');
},
dataType: 'json'
});
});
$("#technicke-parametry").hide();
$("#souvisejici").hide();
$("#popis-produktu #popis-produktu-a").click(function() {
$("#popis-produktu a").removeClass("active");
$(this).addClass("active");
$("#technicke-parametry").hide();
$("#souvisejici").hide();
$("#popis").show();
return false;
});
$("#popis-produktu #technicke-parametry-a").click(function() {
$("#popis-produktu a").removeClass("active");
$(this).addClass("active");
$("#technicke-parametry").show();
$("#souvisejici").hide();
$("#popis").hide();
return false;
});
$("#popis-produktu #souvisejici-produkty-a").click(function() {
$("#popis-produktu a").removeClass("active");
$(this).addClass("active");
$("#technicke-parametry").hide();
$("#souvisejici").show();
$("#popis").hide();
return false;
});
$("#prihlaseni a").bind("click", function() {
$('html, body').scrollTop( 300 );
$("#login-dialog").load("_login-form.php");
$("#login-dialog").dialog({
modal: true,
closeText: '',
position: ['center',145]
});
return false;
});
$("#login-dialog").delegate("#zavrit", "click", function() {
$("#login-dialog").dialog("close");
return false;
});
Cufon.replace($("h2.cufon"));
Cufon.replace($("h3.cufon"));
Cufon.replace($("#uvod-text h2"));
});
function mycarousel_initCallback(carousel)
{
$('#slider-nav a.slide-cont').bind('click', function() {
carousel.scroll($.jcarousel.intval($(this).attr("id")));
return false;
});
carousel.clip.hover(function() {
carousel.stopAuto();
}, function() {
carousel.startAuto();
});
};
function trigger(carousel)
{
var item = carousel.first%6;
switch (item) {
case 0:
item = 6;
break;
case -1:
item = 5;
break;
case -2:
item = 4;
break;
case -3:
item = 3;
break
case -4:
item = 2;
break
case -5:
item = 1;
break
}
$("#slider-nav a.slide-cont").removeClass("active");
$("#slider-nav a.slide-cont#"+item).addClass("active");
delete item;
}