$(document).ready(function () {
selected();
$('div#map svg path,div#map svg circle').hover(function () {
var a = iftag(this);
if (typeof this.innerHTML !== 'undefined') {
var title = $(this).children('title').html();
$(this).html(title);
$('body').append('' + $(this).html() + '');
}
if (this.tagName == 'path') {
if (this.classList[0] == 'not_fill' || this.classList[1] == 'not_fill') {
$(this).css({
'fill': color_fill.path_hover_not_fill
});
} else {
$(this).css({
'fill': color_fill.path_hover_fill
});
}
} else {
$(this).css({
'fill': color_fill.circle_hover_fill,
'stroke': color_fill.circle_hover_stroke
});
}
}, function () {
if (typeof this.innerHTML !== 'undefined') {
// var title = $(this).html();
$('.help').remove();
$('.help1').remove();
// $(this).html('
' + title + '');
}
if ($(this).attr('class') != 'selected') {
if (this.tagName == 'path') {
if (this.classList[0] == 'not_fill' || this.classList[1] == 'not_fill') {
$(this).css({
'fill': color_fill.path_not_fill
});
} else {
$(this).css({
'fill': color_fill.path_fill
});
}
} else {
$(this).css({
'fill': color_fill.circle_fill,
'stroke': color_fill.circle_stroke
});
}
}
selected();
}).bind('mousemove mouseenter', function (e) {
var a = iftag(this);
$('.help' + a).css({
left: e.pageX + 10,
top: e.pageY + 20
});
});
});
var iftag = function (obj) {
if (obj.tagName == 'circle') {
a = '1';
} else {
a = '';
}
return a;
}, over = function (klas, val) {
var k = klas == 'grad' ? 'circle' : 'path';
if (k == 'circle') {
$('circle#' + val).css({
'fill': color_fill.circle_hover_fill,
'stroke': color_fill.circle_hover_stroke
});
} else {
$('path#' + val).css({
'fill': color_fill.path_hover_fill
});
}
}, over_off = function (klas, val) {
var k = klas == 'grad' ? 'circle' : 'path';
if (k == 'circle') {
if (parseInt($('path#' + val).index()) >= 0) {
if ($('circle#' + val).attr('class').split(' ')[0] != 'selected') {
$('circle#' + val).css({
'fill': color_fill.circle_fill,
'stroke': color_fill.circle_stroke
});
} else {
$('circle#' + val).css({
'fill': color_fill.circle_hover_fill,
'stroke': color_fill.circle_hover_stroke
});
}
}
} else {
if (parseInt($('path#' + val).index()) >= 0) {
if ($('path#' + val).attr('class').split(' ')[0] != 'selected') {
$('path#' + val).css({
'fill': color_fill.path_fill
});
} else {
$('path#' + val).css({
'fill': color_fill.path_hover_fill
});
}
}
}
}, kv_over = function (val) {
$('path#' + val).css({
'fill': color_fill.path_hover_fill
});
}, kv_over_off = function (val) {
$('path#' + val).css({
'fill': color_fill.path_fill
});
}, selected = function () {
$('path.selected').css({
'fill': color_fill.path_hover_fill
});
$('circle.selected').css({
'fill': color_fill.circle_hover_fill,
'stroke': color_fill.circle_hover_stroke
});
};