﻿<!--
function imgposit(x,y){ 
  var obj = document.getElementById("Imgbox") ;
  obj.style.posLeft = event.clientX + x  + document.body.scrollLeft;
  obj.style.posTop = event.clientY + y + document.body.scrollTop;
} 
     
function imgset(str){ 
  var obj = document.getElementById("Imgbox") ;
  var text;
  //text ='<div style="filter:progid:DXImageTransform.Microsoft.Shadow(color=#C0C0C0,Direction=135,Strength=4)">';
  //text += '<div style="background-color:#dddddd;padding: 2px;border: 1px solid #999999;line-height: 16px;text-align:left;width:150px">' + str + '</div></div>';
  text = '<div style="background-color:#dddddd;padding: 2px;border: 1px solid #999999;line-height: 16px;text-align:left;width:150px">' + str + '</div>';
  obj.innerHTML=text;
} 

function imghide(){ 
  var obj = document.getElementById("Imgbox") ;
  obj.innerHTML='';
} 
//-->

var KeywordInterval;
function HideKeywordDiv(){
	var oDiv = document.getElementById('divKeyword');
	
	oDiv.style.display = 'none';
	
	CancelHideKeywordDivInterval();
}

function CancelHideKeywordDivInterval(){
	if(KeywordInterval != null){
		clearInterval(KeywordInterval);
		KeywordInterval = null;
	}
}

function StartHideKeywordDivInterval(DisplayTime){
	if(KeywordInterval != null){
		clearInterval(KeywordInterval);
		KeywordInterval = null;
	}
	
	KeywordInterval = window.setInterval("HideKeywordDiv();", DisplayTime);
}




//關鍵字詳細內容
var doc = document;
var alb_CO = null;
function show_KeyWord( str, obj, enabled) {
	if (enabled == false) {
		return;
	}
	  
	if (alb_CO != null) {
		hide_KeyWord(alb_CO);
	}

	var obj2 = document.getElementById('divKeyword');

	if (obj2 != null) {
		try {
		var rect = obj.getBoundingClientRect();
		var left = rect.left;
		var top = rect.top;
		var right = rect.right ;
		var bottom = rect.bottom;

		obj2.style.pixelTop = bottom + doc.body.scrollTop;
		obj2.style.pixelLeft = (left - 3) + doc.body.scrollLeft;
	      
			var text;
			text = '<div style="border: 1px solid #999999;">' + str + '</div>';
			obj2.innerHTML=text;
			
		} catch(e) {
			var left = obj.x;
			var top = obj.y-(300-obj.height);
			obj2.style.left = left;
			obj2.style.top = top;
		}
		obj2.style.display = '';
		alb_CO = obj2;
	} else {
		alert(obj.id);
	}
	
	StartHideKeywordDivInterval(3000);
}

function hide_KeyWord(obj, enabled) {
	if (enabled == false) {
		return;
	}
	obj.style.display = 'none';
	alb_CO = null;
}
