var aaFlyObj={
  fadeeffect: [false, 300], //enable Fade? [true/false, duration_milliseconds]
  useroffset: [10, 10], //additional x and y offset of tooltip from mouse cursor, respectively
  iebody: null,
  flydiv: null,
  resdiv: null
}

jQuery(document).ready(function(){
	aaFlyObj.iebody=(document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
	aaFlyObj.flydiv=$('<div id=aaFlyObj class=aatooltip></div>').appendTo('body')
	aaFlyObj.resdiv=$('#mdf_compare_list')
})

function flycompare(obj, incode){

  curobj = $(obj)
  var name=$('* .MDL_detail td.marname a.marname').html() + ' ' + $('* .MDL_detail td.name div').html() + ' ' +
            curobj.parent().parent().find('a').filter('[class=name]').html()

  // create new list
  $('#mdf_compare_list').load('/form.php', {mdf: incode, mdfname: name, spentity: 'add_mdf_compare'})
  // fly div to list
  aaFlyObj.flydiv.text(name)

  var os=curobj.offset()
  aaFlyObj.flydiv.css({left: os.left, top: os.top})
  aaFlyObj.flydiv.show()
  var ro=aaFlyObj.resdiv.offset()
  aaFlyObj.flydiv.animate
    ({left: ro.left, top: ro.top}, 1000, function(){
      $(aaFlyObj.flydiv).fadeOut(1000);
    })
  return false // for avoid click actions
}

function flycompare_cmp(obj, incode){

  curobj = $(obj)
  var name= 
            curobj.parent().parent().find('a').filter('[class=mar_name]').html() + ' ' + 
            curobj.parent().parent().find('a').filter('[class=mdl_name]').html() + ' ' +
            curobj.parent().parent().find('a').filter('[class=mdf_name]').html()

  // create new list
  $('#mdf_compare_list').load('/form.php', {mdf: incode, mdfname: name, spentity: 'add_mdf_compare'})
  // fly div to list
  aaFlyObj.flydiv.text(name)

  var os=curobj.offset()
  aaFlyObj.flydiv.css({left: os.left, top: os.top})
  aaFlyObj.flydiv.show()
  var ro=aaFlyObj.resdiv.offset()
  aaFlyObj.flydiv.animate
    ({left: ro.left, top: ro.top}, 1000, function(){
      $(aaFlyObj.flydiv).fadeOut(1000);
    })
  return false // for avoid click actions
}

function removecompare(incode){

  $('#mdf_compare_list').load('/form.php', {mdf: incode, spentity: 'add_mdf_compare'})

  return false // for avoid click actions
}


