').insertBefore($(obj).parent().parent());
//$(obj).parent().parent().parent().prepend('
');
$('#mc-'+imgid).append('
');
//deal with the variable height of div.legend
$('#mc-'+imgid).css({
bottom: function(index, value) {
return parseFloat($(obj).parent().parent().height())+20;
}
});
mapit(obj);
}
function remove_map(imgid) {
$('#mc-'+imgid).remove();
}
//############ Document.ready events ##############
$(document).ready(function(){
//set up click events for map button
$('.map-link').click( function() {
imgid = $(this).attr('data-imgid');
if ($('#mc-'+imgid).is(":visible")) {
remove_map(imgid);
} else {
create_map($(this));
}
return false;
});
var $ele = $('#slides').children();
var $curr = 0;
$(document).bind('keydown', function (e) {
var code = e.which;
switch (code) {
case 39:
if ($curr <= $ele.size()) {
$.scrollTo($ele[$curr], 800 );
$curr++;
}
break;
case 37:
if ($curr > 0) {
$curr--;
var $now = $curr;
$now--;
$.scrollTo($ele[$now], 800 );
}
break;
}
return;
});
});