function show_sader()
{
	var hrefSp  = parent.location.href.split("/");
	var url = hrefSp[hrefSp.length-1];
var param=arguments[0]||{};
if ("" == param.ownerid){
	parent.location.href="/UserLogin.jsp?wherelogin=1&url="+url;
}else{
	window.open('../assist.jsp?spid='+param.id+'&spname='+param.name,'','top=100,left=300,width=588,height=512,scrollbars=yes');
}
}
function getWindowSize(){//得到当前窗体的大小信息
		var myWidth,myHeight,myScroll;
		var myScrollWidth,myScrollHeight;
		if (self.innerHeight) { // Everyone but IE
			myWidth = window.innerWidth;
			myHeight = window.innerHeight;
			myScroll = window.pageYOffset;
		} else if (document.documentElement && document.documentElement.clientHeight) { // IE6 Strict
			myWidth = document.documentElement.clientWidth;
			myHeight = document.documentElement.clientHeight;
			myScroll = document.documentElement.scrollTop;
		} else if (document.body) { // Other IE, such as IE7
			myWidth = document.body.clientWidth;
			myHeight = document.body.clientHeight;
			myScroll = document.body.scrollTop;
		}
	
		// Page size w/offscreen areas
	
		if (window.innerHeight && window.scrollMaxY) {	
			myScrollWidth = document.body.scrollWidth;
			myScrollHeight = window.innerHeight + window.scrollMaxY;
		} else if (document.body.scrollHeight > document.body.offsetHeight) { // All but Explorer Mac
			myScrollWidth = document.body.scrollWidth;
			myScrollHeight = document.body.scrollHeight;
		} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
			myScrollWidth = document.body.offsetWidth;
			myScrollHeight = document.body.offsetHeight;
		}
		return {
			width:myWidth,
			height:myHeight,
			Scroll:myScroll,
			scrollWidth:myScrollWidth,
			scrollHeight:myScrollHeight
		};
	}
function getAbsP(e){
//獲得指定元素的絕對位置，離網頁原點的距離
	var t = e.offsetTop;
	var l = e.offsetLeft;
	while (e = e.offsetParent) {
		t += e.offsetTop;
		l += e.offsetLeft;
	}
	return {top:t,left:l};
}
var showTimer=null;
var hiddTimer=null;
var currShowImg=null;
var cacheImg=new Object();
var loadImg=new Image();
loadImg.src="/image/loading1.gif";//預加載圖片
loadImg.alt="图片加载中...";
loadImg.title="图片加载中...";
function showPic(srcObj,config){
	//try{
		var spPic=document.getElementById("productPic_show");
		//document.body.clientWidth+","+document.body.clientHeight+" \r\n"+document.body.offsetWidth+","+document.body.offsetHeight
		spPic.src=loadImg.src;
		spPic.alt=loadImg.alt;
		spPic.title=loadImg.title;
		var tShowImg=new Image();
		tShowImg.src=config.src;
		var itemPos=getAbsP(srcObj.parentNode);
		var sp=document.getElementById("showPic");
		var spText=document.getElementById("productName_show");
		var spPrice=document.getElementById("productPrice_show");
		var spPic=document.getElementById("productPic_show");
		var spmdou=document.getElementById("product_mdou");
		var spodu=document.getElementById("mdou_"+config.id);
		spmdou.onclick=spodu.onclick;
		spText.innerHTML=config.name;
		spPrice.innerHTML=config.price;
		//spPic.src=config.src;
		spPic.onclick=srcObj.onclick;
		
		var spwidth=sp.offsetWidth;
		var spheight=sp.offsetHeight;
		itemPos.top=itemPos.top-((spheight-srcObj.offsetHeight)/2);
		itemPos.left=itemPos.left-((spwidth-srcObj.offsetWidth)/2);
		if(tShowImg['width']!=0){
			currShowImg=tShowImg;
			cacheImg["img"+config.id]=tShowImg;
			showTimer=setTimeout("moveShowDiv({top:"+itemPos.top+",left:"+itemPos.left+"});",100);//如果图片已加载就快速显示
		}else{
			currShowImg=new Image();
			currShowImg.src=tShowImg.src;
			showTimer=setTimeout("moveShowDiv({top:"+itemPos.top+",left:"+itemPos.left+"});",1000);
		}
	//}catch(e){}
}
function hideShowDiv(hiddFlag){
	var sp=document.getElementById("showPic");
	if(showTimer){
		clearTimeout(showTimer);
	}
	
	if(!hiddFlag)
		hiddTimer=setTimeout('document.getElementById("showPic").style.visibility="hidden";',20);
	showTimer=null;
}
function moveShowDiv(cc){
	hideShowDiv(1);
	if(hiddTimer){
		clearTimeout(hiddTimer);
	}
	var sp=document.getElementById("showPic");
	var spPic=document.getElementById("productPic_show");
	spPic.src=currShowImg.src;
	spPic.alt="点击进入设计";
	spPic.title="点击进入设计";
	$RM(spPic,218,245);
	sp.style.visibility="visible";
	var currWidth=sp.offsetWidth;
	var currHeight=sp.offsetHeight;
	if(cc){
		sp.style.left=cc.left+"px";
		sp.style.top=cc.top+"px";
	}
	var windowSize=getWindowSize();
	if(sp.offsetTop<2){
		sp.style.top="2"+"px";
	}else if(sp.offsetHeight+sp.offsetTop+2>windowSize.height+windowSize.Scroll){
		//alert(windowSize.Scroll);
		sp.style.top=windowSize.height+windowSize.Scroll-sp.offsetHeight+"px";
	}
	if(sp.offsetLeft<2){
		sp.style.left="2"+"px";
	}else if(sp.offsetWidth+sp.offsetLeft-2>windowSize.width){
		sp.style.left=windowSize.width-sp.offsetWidth-2+"px";
	}
}