ck=false;
$(document).ready(function() {
$('#movin').css({display: 'none', position: 'absolute'});
  $('#innocent_group').click(function () {
		var position = {};
		$('#innocent_group').position(position);
		//alert(position.left);
		if ($('#movin').css('display') == 'none'){
			$('#movin').fadeIn("normal", function(){ck=true;});
		}else{
			$('#movin').fadeOut("fast", function(){ck=false;});
		}
		$('#movin').css('left', position.left);
		$('#movin').css('top', position.top - $('#movin').height());
	});
  $('#baseblock').click(function () {
    if(ck)$('#movin').fadeOut("normal",function(){ck=false;});
  });
//swap img
var conf = {
    className : 'btn',
    postfix : 'on'
  };
  var image_cache = new Object();
  $('img.'+conf.className).each(function(i) {
    var imgsrc = this.src;
    var dot = this.src.lastIndexOf('.');
    var imgsrc_on = this.src.substr(0, dot) +  conf.postfix + this.src.substr(dot, 4);
    image_cache[this.src] = new Image();
    image_cache[this.src].src = imgsrc_on;
    $(this).hover(
      function() { this.src = imgsrc_on; },
      function() { this.src = imgsrc; });
  });
});