// JavaScript Document
var objLiHovered = null;

function checkHover() {
  if(objLiHovered/* && !lSubIn*/) {
    objLiHovered.find('ul').fadeOut('fast');
    objLiHovered = null;
  }
}

$(document).ready(
		function(){
			
			$('#header_pics ul').fadeIn(200);
		  
			$('div#header_pics ul').innerfade({
				speed: 'slow',
				timeout: 5000,
				type: 'sequence',
				containerheight: '190px'
			});
			
			$('jqtip *').tooltip({ delay: 0});
			
			$('.menu li').hover(function() {
				
				if ($(this).find('ul') != null) {
					$(this).find('ul').fadeIn('fast');
					objLiHovered = null;
				}
			}, function() {
			  if ($(this).find('ul') != null) {
					$(this).find('ul').fadeOut('fast');
				}
			});
			
			$('.comp_pic').hover(function() {
			
				$(this).find('img').fadeIn('fast');
				
			}, function() {
			  $(this).find('img').fadeOut('fast');
			});
			
			$('#logo').fadeIn(600);
			
			$("#searchRight").focus( function() {
			  if ($(this).attr("value") == "Hledat...")
			    $(this).attr("value", "");}
			);
			
			$("#searchRight").blur( function() {
			  if($(this).attr("value") == "")
			    $(this).attr("value", "Hledat...");
			});
		}
	);

// maximalni delka textarea
function ismaxlength(obj){
  var mlength = obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : 500;
  if (obj.getAttribute && obj.value.length>mlength)
    obj.value=obj.value.substring(0,mlength)
}

function reactOnBlurField(obj) {
  var lField = document.getElementById('email1');
  lField.value = "hehe" + obj.value + "haha";
}
