
<!--
// Detect if the browser is IE or not.
// If it is not IE, we assume that the browser is NS.
var IE = document.all?true:false

// variables to hold mouse x-y pos.s
var PosX = 0
var PosY = 0
var MaxX = 0
var MaxY = 0

var BoxHeight = 400; //Height of the Floating Box
var BoxWidth = 300; //Width of the Floating Box
var ArrowPosition = BoxHeight/4; //Position of the arrow
var LanguageID = 1; //Language ID 4 for Japanese
					//Language ID 1 for English

var CurrentFabricID = 0;

var H = 0; //Floating Boxis hiding.

function initFloat(Height,Width,Language)
{
	BoxHeight = Height || BoxHeight; //Height of the Floating Box
	BoxWidth = Width || BoxWidth; //Width of the Floating Box
	ArrowPosition = BoxHeight/4; //Position of the arrow
	LanguageID = Language || LanguageID ;
	
	if (document.all)
		document.body.insertAdjacentHTML('beforeEnd','<IFRAME id="FloatFrame" allowtransparency="true" background-color="transparent" style="position:absolute;left:-1000px;top:-1000px;"  width="' + (BoxWidth) + 'px" height="' + (BoxHeight) + 'px" scrolling="no" frameborder="0" SRC="blank.html"><\/IFRAME>');
	else if (document.getElementById) {
		document.body.innerHTML += '<IFRAME id="FloatFrame" allowtransparency="true" background-color="transparent" style="position:absolute;left:-1000px;top:-1000px;"  width="' + (BoxWidth) + 'px" height="' + (BoxHeight) + 'px" scrolling="no" frameborder="0" SRC="blank.html"><\/IFRAME>';
	}
}

function ShowFloat(e,para,flipL) {
  H=0;
  CurrentFabricID = para;
  if (IE) { // grab the x-y pos.s if browser is IE
    PosX = event.clientX + document.body.scrollLeft
    PosY = event.clientY + document.body.scrollTop
    //PosX = event.srcElement.offsetLeft;
    //PosY = event.srcElement.offsetTop;
	MaxX = document.body.clientWidth+document.body.scrollLeft;
	MaxY = document.body.clientHeight+document.body.scrollTop;
	OSX = document.body.scrollLeft;
	OSY = document.body.scrollTop;
} else {  // grab the x-y pos.s if browser is NS
    PosX = e.pageX
    PosY = e.pageY
	//PosX = e.target.offsetLeft;
    //PosY = e.target.offsetTop;
	MaxX = window.innerWidth+window.pageXOffset;
	MaxY = window.innerHeight+window.pageYOffset;
	OSX = window.pageXOffset;
	OSY = window.pageYOffset;
  }  
  
  if (PosX < 0){PosX = 0}
  if (PosY < 0){PosY = 0}
	
//	document.Show.MouseX.value = PosX;
//	document.Show.MouseY.value = PosY;
//	document.Show.MX.value = MaxX;
//	document.Show.MY.value = MaxY;
//	document.Show.OX.value = OSX;
//	document.Show.OY.value = OSY;
//	document.Show.Para.value = para;

	//alert(PosX);
//hardcode due to iFrame
//	MaxY = 800;
	ArrowPosition = BoxHeight/4;


	if (PosY - OSY - ArrowPosition < 0){
		ArrowPosition = PosY - OSY;
	}
	if (MaxY - PosY < (BoxHeight - ArrowPosition) + 15 ){
		ArrowPosition = BoxHeight - (MaxY - PosY) + 3;
	}
	
//	if (PosX  < 327){
	//	flipL=1;
//	}
//	else
//	{
//		flipL=0;
//	}
	
	//document.getElementById("FloatFrame").src = 'frame.asp?para='+para+'&ArrowPos='+ArrowPosition+'&MaxHeight='+BoxHeight+'&MaxWidth='+BoxWidth;
	document.getElementById("FloatFrame").src = 'fabricwindow.asp?LanguageID='+LanguageID+'&fabricid='+para+'&ArrowPos='+ArrowPosition+'&MaxHeight='+BoxHeight+'&MaxWidth='+BoxWidth+'&L='+flipL;
	//document.getElementById("FloatFrame").src = 'fabricwindow2.asp?fabricid='+para;
	if (flipL==1) {
//		document.getElementById("FloatFrame").style.left = PosX+20+'px';
		if (PosX<190){
			document.getElementById("FloatFrame").style.left = (Math.floor(PosX/10)+1)*10+1+'px';
		}else
		{
			document.getElementById("FloatFrame").style.left = 210+'px';
		}
	}
	else
	{
//		document.getElementById("FloatFrame").style.left = PosX-BoxWidth-60+'px';
		document.getElementById("FloatFrame").style.left = Math.floor((PosX-BoxWidth)/10)*10-1+'px';
	}
	document.getElementById("FloatFrame").style.top = PosY-ArrowPosition+'px';
	
return true
}

function HideFloat(FabricID)
{
	if (CurrentFabricID == FabricID)
	{
		if ( H == 0)
		{
			H = 1;
			//alert('Original'+FabricID);
			setTimeout("HideFloatAssist('"+FabricID+"')",900);
		}
	}
	return true;
}

function HideFloatAssist(FabricID)
{
	//alert('Assistant '+FabricID + ' VS ' + CurrentFabricID);
	if ( (H==1) && (CurrentFabricID == FabricID) ){
		document.getElementById('FloatFrame').style.left = '-1000px';
		document.getElementById("FloatFrame").src = 'blank.html';
		H = 0;
	}
	return true;
}

function CancelHide(FabricID)
{
	//alert('Assistant '+FabricID + ' VS ' + CurrentFabricID);
	if (CurrentFabricID == FabricID) {
		H = 0;
	}
	return true;
}

//solve Safari mouseout problem
//function MouseSet()
//{
//var W3CDOM = (document.createElement && document.getElementsByTagName);
//var Links = document.getElementsByTagName('a');
//for (var i=0;i<Links.length;i++)
//	{
		//Links[i].onmouseout = HideFloat;
		//Links[i].onblur = HideFloat;
		//Links[i]['onmouseout'] = HideFloat;
//		document.write (Links[i].offsetTop+' ')
//		document.write (Links[i].offsetLeft+' ')
//	}
//}

//-->
