﻿var lastLi1=null; 
var timeOutVar1=null; 
$(function(){
$(document.body).prepend(
	"<div id=\"showLayers\" style=\"display:none;\"><div id=\"ShowContentTitle\">内容读取中</div>"
	+ "<img src=\"/images/loading.gif\" border=\"0\" id=\"ShowContentImg\" alt=\"读取中\"  onerror=\"this.src='/Themes/plyh/images/noimg.gif'\"/>"
	+"<div id=\"ShowConfig\"></div></div>"
						 );
	prolistbind();
});

function prolistbind(){
	$("a[name='proli']").hover(function(e){
	$("#showLayers").html("<div id=\"ShowContentTitle\">内容读取中</div>"
	+ "<img src=\"/images/loading.gif\" border=\"0\" id=\"ShowContentImg\" alt=\"读取中\"  onerror=\"this.src='/Themes/plyh/images/noimg.gif'\"/>"
	+"<div id=\"ShowConfig\"></div>").show();
	$.getJSON("/Ajax/Ajax.ashx?act=getimg&id=" + $(this).attr("pro"),function(data)
	{
		if(data.state=='True')
		{
		$("#showLayers").html("<div id=\"ShowContentTitle\">" + data.name + "</div>"
	+ "<img width=\"300\" src=\"" + data.bpic + "\" border=\"0\" id=\"ShowContentImg\" onerror=\"this.src='/Themes/plyh/images/noimg.gif'\"/>"
	+"<div id=\"ShowConfig\">" + data.config + "</div>");
		}
		else
		{alert(data.reason);}
	});								  
										  }
,function(){
	$("#showLayers").hide();
										  })
.mousemove(function(evt){
	var x,y;
  var offsetX=10,offsetY=20;
  var scrollTop = $(window).scrollTop();
  var scrollLeft = $(window).scrollLeft();
  x=evt.clientX +scrollLeft;
  y=evt.clientY ;
  if (x-scrollLeft+ $("#showLayers").outerWidth()+offsetX> $(window).width()) {
  	x = x - $("#showLayers").outerWidth() - 2 * offsetX;
  }
  
  if ((y+$("#showLayers").outerHeight()+offsetY)>$(window).height()) {
	y = $(window).height()-$("#showLayers").outerHeight()-offsetY;
  }
	x=x+offsetX;
	y=y+offsetY;
	$("#showLayers").css({ "top": (y +scrollTop) + "px", "left": x + "px" });
					});
}
