// JavaScript Document
var clear;
var old_image_name = false;
var isNN = document.layers ? true : false;
var isIE = document.all ? true : false;
var mouseX, mouseY, divCode;
var status=true;
document.onmousemove=GetCursor;
function show(width,height,imageName,id,productName,productDescription)
{
	if(old_image_name != imageName)
	{
		loading();
	}	
	old_image_name = imageName;
	var obj=document.getElementById('anh');
	var newHTML;
	newHTML = '<div class="product_name1" align="center" style="width:200px;font-weight:bold;text-align:center;color:#ff0000;">'+productName+'</div>';
	newHTML+= '<div id="'+id+'" style="boder:1px solid #000000;display:block;">';
	newHTML+= '<img onload="javascript:remove_loading();" src="' + imageName + '" border="0"  style="width:'+  width + 'px;height:'+ height+ 'px"></div>';	
	newHTML+= '</div>';
	newHTML+= '<div class="product_description" style="width:270px;padding-top:10px">'+productDescription+'</div>';
	obj.innerHTML=newHTML;
	setTimeout('remove_loading()',2000);
	obj.style.left=mouseX+25;			
	//obj.style.top=mouseY+25;
			if((parseInt(obj.style.left))>screen.width-250)
			{
				obj.style.left=(parseInt(obj.style.left)-350);
				obj.style.top=mouseY+25;
			}
			else
			{
				obj.style.top=mouseY+25;
			}
	
	if(obj.style.display=='none')
	{
		obj.style.display='block';
	}	
}
//---------------------------------------------
function loading()
{

	var obj=document.getElementById('load');
	obj.style.left=mouseX+25;			

	if((parseInt(obj.style.left))>screen.width-250)
	{
		obj.style.left=(parseInt(obj.style.left)-250);
		obj.style.top=mouseY+25;
	}
	else
	{
		obj.style.top=mouseY+25;
	}
	obj.style.display='block';
	clear=setTimeout('loading()',2000);

}
//------------------------------------------------
function remove_loading()
{

	var obj=document.getElementById('load');
	obj.style.display='none';
	clearTimeout(clear);

}
//---------------------------------------------
function GetCursor(e) // works on IE6,FF,Moz,Opera7
{
  if (!e) e = window.event; // works on IE, but not NS (we rely on NS passing us the event)

  if (e)
  { 
	if (e.pageX || e.pageY)
	{ // this doesn't work on IE6!! (works on FF,Moz,Opera7)
	  mouseX = e.pageX;
	  mouseY = e.pageY;
	  algor = '[e.pageX]';
	  if (e.clientX || e.clientY) algor += ' [e.clientX] '
	}
	else if (e.clientX || e.clientY)
	{ // works on IE6,FF,Moz,Opera7
	  mouseX = e.clientX + document.body.scrollLeft;
	  mouseY = e.clientY + document.body.scrollTop;
	  algor = '[e.clientX]';
	  if (e.pageX || e.pageY) algor += ' [e.pageX] '
	}  
  }
}
//---------------------------------------------------
function hideImage()
{

	var obj=document.getElementById('anh');
	obj.style.display='none';	

}

