/* slider-config */
var slider01_config = {
		speed: 1000,
		interval: 10000,
		next_speed: 200,
		prev_speed: 200,
		image_speed: 100};

// JavaScript Document

$(document).ready(function(){
	$(".nav-box1").hover(function(){
   	$(this).addClass("nav-box1-hover");
 },function(){
   	$(this).removeClass("nav-box1-hover");
 });
$(".nav-box2").hover(function(){
   	$(this).addClass("nav-box2-hover");
 },function(){
   	$(this).removeClass("nav-box2-hover");
 });
 $(".nav-box3").hover(function(){
   	$(this).addClass("nav-box3-hover");
 },function(){
   	$(this).removeClass("nav-box3-hover");
 });
 $(".nav-box4").hover(function(){
   	$(this).addClass("nav-box4-hover");
 },function(){
   	$(this).removeClass("nav-box4-hover");
 });
 
  $('#pop-up-wrapper').show();
 $('#pop-close span').click(function() {
  $(this).parent().parent().parent().hide();
  
});



//form
    $(".verify").attr("value","verified");
   
    $(".contact-form1").bind('submit',function(){
        var insert_post = $(this).serialize(); //metoda serialize vytvoří post z aktuálního formuláře
        insert_post += '&submitted=1'; //kpostu přilepím potvrzovací hodnotu
        $.post($(this).attr('action'),insert_post, function(data) { // Ajax volá url které je jako ACTION ve FORMU a vrací data
           
            var jdata = eval("(" + data + ")");
               
            if (jdata.status == 'true'){//vykonají se funkce dle návratových dat
                window.location.href=jdata.url;
               
            }
            else{

                $('.error_message').attr('style','display:true');
               
            };
        });
        return false;
    });	
    
    
    $('#pop-up-wrapper').show();
	
	var out=true;
	$('#pop-cont').bind('mouseout', function() {
		out = true;
	});
	
	$('#pop-cont').bind('mouseover', function() {
		out = false;
	});
	
	$('#pop-up-wrapper').click(function() {
	  if(out){$(this).hide();}
	});
	
	$('#close-img').click(function() {
	  $('#pop-up-wrapper').hide();
	  $('#pop-up-wrapper2').hide();
	});
	
	
	
	
	$('#pop-up-wrapper2').show();
	
	
	$(".subject-yes").bind('click',function() {
	  $('#subject').show();
	});
	
	$(".subject-no").bind('click',function() {
	  $('#subject').hide();
	});
	


});

