var scrollPos

function showpic(ob,obwidth,obheight)
{
if (typeof window.pageYOffset != 'undefined') {
	   scrollPos = window.pageYOffset;
		}
		else if (typeof document.compatMode != 'undefined' &&
					 document.compatMode != 'BackCompat') {
		   scrollPos = document.documentElement.scrollTop;
		}
		else if (typeof document.body != 'undefined') {
				   scrollPos = document.body.scrollTop;
		}
	scrollPos=scrollPos+200
var allbox=document.getElementById("allbox")
if(allbox!==null)
{
	document.body.removeChild(allbox)
}
var screenwidth=(document.body.scrollWidth)
var newlayer=document.createElement("div")
newlayer.style.cssText="width:"+screenwidth+"px;text-align:center;position:absolute; top:"+scrollPos+"px; left:0; z-index:60;clear:both;"
newlayer.setAttribute("id","allbox")

var ahref=document.createElement("a")
ahref.setAttribute("href","#")
ahref.style.cssText="border:none;"

var pic=document.createElement("img")
pic.setAttribute("src",ob)
pic.style.cssText="width:"+obwidth+"px;height:"+obheight+"px; border:1px solid #ccc;margin:0 auto;"
pic.onclick=function()
{
document.body.removeChild(newlayer)
return false;
}

var pic_box=document.createElement("div")
pic_box_width=obwidth+5
pic_box_height=obheight+5
pic_box.style.cssText="width:"+pic_box_width+"px;height:"+pic_box_height+"px; margin:0 auto;"
ahref.appendChild(pic)
pic_box.appendChild(ahref)
newlayer.appendChild(pic_box)
document.body.appendChild(newlayer)

}


//引用代码示例(图片外面要有一个唯一的标签包含img标签)  <a href="1a-wet-process-resin.html"> <img src="1-pu-resin/1-1s.jpg" alt="" onmousemove="setBigPic('1-pu-resin/2-1b.jpg',200,200,-20,-20,'5','#333',this)" onmouseout="ResetPic('1-pu-resin/1-1s.jpg',this)"/></a>
function setBigPic(bigpic,width,height,moveX,moveY,borderWidth,borderColor,ob){ob.parentNode.style.cssText="position:relative;z-index:999;";ob.style.cssText="position:absolute;left:"+moveX+"px; top:"+moveY+"px;border:"+borderWidth+"px solid "+borderColor;ob.setAttribute("src",bigpic);ob.setAttribute("width",width);ob.setAttribute("height",height);}
function ResetPic(smallPic,ob){ob.setAttribute("src",smallPic);ob.removeAttribute("width");ob.removeAttribute("height");ob.removeAttribute("border");ob.style.cssText="position:inherit;";ob.parentNode.style.cssText="z-index:-999";}

