function initNav(){
	$('li:first a', $('.department_countries_nav')).addClass('first');
	$('li:last a', $('.department_countries_nav')).addClass('last');
	$('.department_nav').hover(function() {
			if (obj) {
				obj.find('ul').css('display', 'none');
				obj.removeClass('hover');
				obj.children('a').removeClass('hover');
				obj = null;
			}
			$(this).addClass('hover');
			$(this).find('ul').css('display', 'block');
			$(this).children('a').addClass('hover');
		}, function() {
			obj = $(this);
			setTimeout('checkHover()', 400);
	});
}
var obj = null;
function checkHover() {
	if (obj) {
		obj.removeClass('hover');
		obj.find('ul').css('display', 'none');
		obj.children('a').removeClass('hover');
	}
}
function initSearchForm(){
	$('#search input:checkbox').css('display', 'none');
	var check_boxes_lis = $('#search input:checkbox').parent();
	for(var i=0; i<check_boxes_lis.length; i++){
		$(check_boxes_lis[i]).prepend('<a class="custom_check_box" href="javascript:void(0)">&nbsp;<\/a>');
		$('a', check_boxes_lis[i]).click(function(){
			if($('input:checkbox', $(this).parent()).attr('checked')){
				$('input:checkbox', $(this).parent()).removeAttr('checked');
				$(this).css('background-position', 'top left');
			}else{
				$('input:checkbox', $(this).parent()).attr('checked', 'checked');
				$(this).css('background-position', '0 -12px');
			}
		});
	}
}
function initMK(){
	$('#mediakit img').tooltip({
		bodyHandler: function() {
			var imgURL = $(this).attr('src')
			imgURL = imgURL.substr(0, imgURL.length-4) + '_large.jpg';
			console.log(imgURL);
			var content = '<img src="';
			content += imgURL;
			content += '">';
			return content;
		},
		extraClass:'mediakitTT',
		showURL:false
	});
}
