$(document).ready(function(){
      $("#content form input[type=text]").focus(function(event){
       $(this).prev("label").addClass("active");
       $(this).addClass("active");
      });
      $("#content form textarea").focus(function(event){
       $(this).prev("label").addClass("active");
       $(this).addClass("active");
      });

      $("#content form input[type=text]").blur(function(event){
       $(this).removeClass("active");
       $(this).prev("label").removeClass("active");
      });

      $("#content form textarea").blur(function(event){
       $(this).removeClass("active");
       $(this).prev("label").removeClass("active");
      });

      $("#content form input[type=password]").focus(function(event){
       $(this).addClass("active");
       $(this).prev("label").addClass("active");
      });
      $("#content form input[type=password]").blur(function(event){
       $(this).removeClass("active");
       $(this).prev("label").removeClass("active");
      });

      $("#searchvalue").focus(function(event){
        if($(this).val() == 'Vyhledávání na webu') {
            $(this).val('');
        }
      });
      $("#searchvalue").blur(function(event){
        if($(this).val() == '') {
            $(this).val('Vyhledávání na webu');
        }
      });

	  $(".external-link-new-window").attr('target','_blank');
  });

$(function(){jQuery('.coming ul').jScrollPane({scrollbarWidth:16});});

function resultPollClick(id) {
	xajax.$('tx_rsdynamicpoll_pi1_preloader').style.display="block";
	xajax_submitProcess('',id);
	return false;
}

function resultPollSubmit(data) {
	xajax.$("tx_rsdynamicpoll_pi1_preloader").style.display="block";
	xajax_submitProcess(data);
	return false;
}

function getData4Ic(ic)
{
    $.ajax({
       type: "GET",
       url: "/fileadmin/scripts/akce_get_firm_data.php?ic=" + ic,
       success: getData4IcResult
    });
}

function getData4IcResult(xml)
{
    $(xml).find('item').each(function(){
        $("#" + $(this).attr('id')).val($(this).attr('value'));
        var $radios = $('input:radio[name=' + $(this).attr('id') + ']');
        $radios.filter('[value=' + $(this).attr('value') + ']').attr('checked', true);
    })
}

