$.fn.delay = function(time, callback){
    // Empty function:
    jQuery.fx.step.delay = function(){};
    // Return meaningless animation, (will be added to queue)
    return this.animate({delay:1}, time, callback);
}

$(document).ready(function(){  

// DEALER MENU

    $(".city").live("click", function(){
		$(".showed_child_diler").slideUp("fast");
		$(".showed_child_diler").attr("class", "hidden_child_diler");
		$(".city_visited").attr("class", "city");

		$(this).next(".hidden_child_diler").attr("class", "showed_child_diler");
		$(".showed_child_diler").slideDown("fast");
		$(this).attr("class", "city_visited");
	});

	$(".city").mouseover(function(){
		$(this).css('background','#eeeeee');
	}).mouseout(function(){
		$(this).css('background','transparent');
	});

    $(".city_visited").live("click", function(){
		$(".showed_child_diler").slideUp("fast");
		$(".showed_child_diler").attr("class", "hidden_child_diler");
		$(".city_visited").attr("class", "city");		
	});

	$(".diler_show_all").live("click", function() {
		var d = $(this).attr("id");
		$("#diler_list").fadeOut("fast");
		setTimeout(function(){$.post("http://fiskars.com.ua/ajax.php", {diler_show_all: d}, function(data){ $("#diler_list").delay(400).fadeIn("fast").html(data); }); },200); 
	});

	$(".diler_show_all").mouseover(function(){
		$(this).css('background','#eeeeee').css('text-decoration','underline');
    }).mouseout(function(){
		$(this).css('background','transparent').css('text-decoration','none');
    });

//

// TOP MENU

    $("#top_menu li").mouseover(function(){
        $(this).children('.hoverMenu').css('display','block');
    }).mouseout(function(){
        $(this).children('.hoverMenu').css('display','none');
    });

	$("#top_menu a.returnFalse").click(function(){
		return false;
	});

	
//


    $(".section3").mouseover(function(){
        $(this).children('.hoverMenu2').css('display','block');
    }).mouseout(function(){
        $(this).children('.hoverMenu2').css('display','none');
    });

// убираем последний border в таблице
	$(".border td:not(:last-child)").css({ "border-right":"1px solid #cccccc" });
	$(".border td").css({ "border-bottom":"1px solid #cccccc" });

});



function light_on(obj,color) {
	obj.style.backgroundColor="#cccccc";
}

function light_off(obj) {
	obj.style.backgroundColor="transparent";
}

var ns6=document.getElementById&&!document.all?1:0 
var head="display:''" 
var folder='' 
function expandit(curobj){ 
	folder=ns6?curobj.nextSibling.nextSibling.style:document.all[curobj.sourceIndex+1].style 
		if (folder.display=="none") {
			folder.display="" 
		}else {
			folder.display="none" 
		}
}
function show_hide_text(divObj) {
    var div = divObj.parentNode.getElementsByTagName('div')[1];
    if (div.style.display == 'none') {
        div.style.display = 'block';
    } else {
        div.style.display = 'none';
    }
} 
