﻿function doClear(theText) { if (theText.value == theText.defaultValue) { theText.value = "" } }
function doDefault(theText) { if (theText.value == "") { theText.value = theText.defaultValue } }

$(document).ready(function() {
	$("ul.top-menu li").hover(function() {
		$(this).addClass("hover");
		$('> .dir',this).addClass("open");
		$('ul:first',this).css('display', 'block');
	}, function() {
		$(this).removeClass("hover");
		$('.open',this).removeClass("open");
		$('ul:first',this).css('display', 'none');
	});
	$('.foto').tabs();
	$('.right_clip').tabs();

});

jQuery(document).ready(function(){
/* растяжка меню */
resizing();
$(window).bind('resize', resizing);
 
function resizing(){
     var dlina_all_li=0;
     var dlina_ul;
/*  находим и суммируем длину всех li */
   $(".menu-foot ul li").each(
    function(){
        dlina_all_li=dlina_all_li+$(this).width();
     }
    );
/*  длина ul */
dlina_ul=$(".menu-foot ul").width();

/* рассчитываем отступ между li */
$(".menu-foot ul li").css("margin-right",(dlina_ul-50-dlina_all_li)/(($(".menu-foot ul li").size())-1));


/* последнему пункту присваиваем фиксированный отступ  */
$(".menu-foot ul li.last").css("margin-right","0");

}
 /* end растяжка */
});
/**
 * We use the initCallback callback
 * to assign functionality to the controls
 */

		function mycarousel_initCallback(carousel) {
    jQuery('.jcarousel-control a').bind('click', function() {
		$(".jcarousel-control a").removeClass();
        carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text()));
		$(this).addClass("current");
        return false;
    });
    jQuery('#mycarousel-next').bind('click', function() {
        carousel.next();
        return false;
    });

    jQuery('#mycarousel-prev').bind('click', function() {
        carousel.prev();
        return false;
    });
};
	
// Ride the carousel...
jQuery(document).ready(function() {
    jQuery("#mycarousel").jcarousel({
        scroll: 1,
        initCallback: mycarousel_initCallback,
        // This tells jCarousel NOT to autobuild prev/next buttons
        buttonNextHTML: null,
        buttonPrevHTML: null
    });
});


jQuery(document).ready(function() {
$('#mycarousel img').tooltip({

delay: 0,
showURL: false,
fade: 200
});
});

jQuery(document).ready(function() {
$('.otzivi img').tooltip({

delay: 0,
showURL: false,
fade: 200
});
});






