/*
test
*/

function gebi(id) {
	return document.getElementById(id)
}

function getObjCoords(obj){
	var obj = typeof(obj) == 'string' ? top.document.getElementById(obj) : obj
	var list={'l':obj.offsetLeft,'t':obj.offsetTop,'w':obj.offsetWidth,'h':obj.offsetHeight}
	while (obj=obj.offsetParent) {
		list.l+=obj.offsetLeft;
		list.t+=obj.offsetTop;
	}
	return list;
}

function get_swf (name) {
  var win = top.window;  // here may be links to other frames
  if (navigator.appName.indexOf("Microsoft") != -1) {
       return win[name];
  } else {
       return win.document[name];
  }
}

function swf_external (name, tar, data) {
	setTimeout("swf_external_apply('"+name+"','"+tar+"','"+data+"')",100);
	/*
	//alert("swf_external('"+name+"','"+tar+"','"+data+"')");
  try {
  	var ret = get_swf(tar).swf_external(name, data);
  	return true;
  } catch (e) {
  	//alert(' cant apply "get_swf("'+tar+'").swf_external("'+name+'", "'+data+'");"');
  	setTimeout("swf_external('"+name+"','"+tar+"','"+data+"')",100);
  }
  return false;
  */
}

function swf_external_apply (name, tar, data) {
	
	//alert("swf_external_apply('"+name+"','"+tar+"','"+data+"')");
  try {
  	var ret = get_swf(tar).swf_external(name, data);
  	return true;
  } catch (e) {
  	//alert(' cant apply "get_swf("'+tar+'").swf_external("'+name+'", "'+data+'");"');
  	setTimeout("swf_external_apply('"+name+"','"+tar+"','"+data+"')",100);
  }
  return false;
	
}

function hint_show (id, label, x, y) {
	show_hint(id, label, x, y, 1)
}

function hint_hide(){
	if( top.hint_object!=null && top.hint_object.parentNode){
		try{
			get_swf('fl_hint').hide()
		}catch (e){
			setTimeout("hint_hide()",70)
		}
		return false
	}
}

function hint_pos (id, x, y) {
	if (hint_object != null) {
		hint_object.style.left = x+15+10;
		hint_object.style.top = y+10+10;
	}
}

function hint_size(w, h) {
	//alert('hint_size ' + w + ' ' + h);
	if(hint_object == null)
		return false
	hint_object.style.width = w+10
	hint_object.style.height = h+10
}

function hint_kill(){
	//alert('hint_kill');
	if(top.hint_object && top.hint_object.parentNode){
		top.hint_object.style.left = 1
		top.hint_object.style.top = 1
		hint_size(1,1)
	}
}

function hint_label(label){
	if(top.hint_object == null)
		return false
	try{
		get_swf('fl_hint').show(label);
	}catch (e){
		//alert(e)
		setTimeout("hint_label('"+label+"')",70);
	}
}

var timer = null

if(top.hint_object == null || !top.hint_object) {
	top.hint_object = top.document.getElementById('hint_object');
}

function show_hint (id, label, x, y, show) {
	if(navigator.appName.indexOf('Opera')!=-1)
		return false;
	if(label == '')
		return false

	if(top.hint_object == null){
		top.hint_object = top.document.getElementById('hint_object')
   }

  hint_label(label)
  //var holder = gebi(id+'_html')
	//var coords = getObjCoords(holder)
	hint_pos(id, x, y)
}
