/*
 * ЭТОТ JS-ФАЙЛ ДОЛЖЕН ВКЛЮЧАТЬСЯ В КОРНЕВОМ ШАБЛОНЕ - main
 */
var cont1 = 'info';
var cont2 = 'support';
var domain = 'mtmteam';

function langset()
{
    contentLang = (/\/en\//).test(window.location.pathname + '') ? 'en' : 'ru';
}

function genderset()
{
    contentGender = (/\/male\/|\/mens\//).test(window.location.pathname + '') ? 'male' : 'female';
}

$(document).ready(function() {
	//init(); // инициализация
	
	// выпадающее под-меню для гендерного меню
	var upperMenus = $('#designerMenu > li');
	upperMenus.click(function(event) {
		$(this)
		    .children('.buttonMenu')
		        .toggle('slide', { direction:'up' }, 'normal')
		    .end()
		    .toggleClass('subMenuIsActive', 'normal');
		
		//Скроем все, кроме выбранного
		$(upperMenus).each(function() {
            if ($(this).data('toggled')) {
		        $(this)
		            .children('.buttonMenu')
		                .slideUp('normal')
		            .end()
		            .toggleClass('subMenuIsActive', 'normal')
		            .data('toggled', false);
		    }
		});
		
		$(this).data('toggled', true);
	})
	.mouseleave(function() {
	    $(this).children('.buttonMenu')
		        .slideUp('normal')
		.end()
		.toggleClass('subMenuIsActive', 'normal');
	});
	
	$('#mail > a').attr('href', 'mailto:'.concat(cont2, '@', domain, '.ru'));
});

//Заглушка для консоли firebug
//Линк с http://stackoverflow.com/questions/2061339/ignore-firebug-console-when-not-installed
//на http://code.google.com/p/fbug/source/browse/branches/firebug1.5/lite/firebugx.js
if (!window.console || !console.firebug)
{
    var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml",
    "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];

    window.console = {};
    for (var i = 0; i < names.length; ++i)
        window.console[names[i]] = function() {}
}

