jQuery(document).ready(function() {
    Cufon.replace('h1')('h2.title')('#side h3');

    $('label.overlabel').overlabel();
    $('.q_hidde, .schovej').hide();
    $('.cluetip').cluetip({
	splitTitle: '|', 
	cluezIndex: "101"
    });
    $('li.ojete-vozy a').click( function() {
	window.open(this.href);
	return false;
    });
  

    $("#head .menu > li a").click(function() {
	$("ul.nabidka").hide();
	var urlko = $(this).attr("href");
	var url_ven = $(this).attr("id");
	var nazev = $(this).text();
	$(this).after("<ul class='nabidka'><li><a href='"+urlko+"'>Zobrazit skladové vozy</a></li><li><a href='"+eval(url_ven)+"'>Oficiální stránky "+nazev+"</a></li></ul>");
	return false;
    });

    $('input#predvadecka').change(
	function() {
	    if($(this).is(":checked")) {
		$("label.datovka").show();		
	    }
	    else {
		$("label.datovka").hide();
	    };
	}).change();

});


$.fn.clearForm = function() {
    return this.each(function() {
	var type = this.type, tag = this.tagName.toLowerCase();
	if (tag == 'form')
	    return $(':input',this).clearForm();
	if (type == 'text' || type == 'password' || tag == 'textarea')
	    this.value = '';
	else if (type == 'checkbox' || type == 'radio')
	    this.checked = false;
	else if (tag == 'select')
	    this.selectedIndex = -1;
    });
};
