function mouse_Move(e){
    x=(document.all)?event.clientX :e.clientX;
	y=(document.all)?event.clientY :e.clientY;
	//x=(document.all)?event.x:e.pageX;
	//y=(document.all)?event.y:e.pageY;
	var x_scrollLeft,y_scrollTop;
	if (typeof document.compatMode != 'undefined' && document.compatMode != 'BackCompat') { 
    		x_scrollLeft=document.documentElement.scrollLeft;
			y_scrollTop=document.documentElement.scrollTop;
	} 
	else if (typeof document.body != 'undefined') { 
			x_scrollLeft=document.body.scrollLeft;
			y_scrollTop=document.body.scrollTop;
	}
	
	if (x_scrollLeft<=0){x_scrollLeft=document.documentElement.scrollLeft;}
	if (y_scrollTop<=0){y_scrollTop=document.documentElement.scrollTop;}
	x = x + x_scrollLeft;
	y = y + y_scrollTop;
	document.getElementById('tip_div').style.left=(x+5)+'px';
	document.getElementById('tip_div').style.top=(y+10)+'px';
}
function clear_tip_div(){
	document.getElementById('tip_div').style.visibility='hidden';
}

function get_tip(id){
document.onmousemove = mouse_Move;
document.onmouseout = clear_tip_div;
    //x=(document.all)?event.clientX :e.clientX;
	//y=(document.all)?event.clientY :e.clientY;
	//x=(document.all)?event.x:e.pageX;
	//y=(document.all)?event.y:e.pageY;
	//x = x + document.body.scrollLeft;
	//y = y + document.body.scrollTop;
	var x_scrollLeft,y_scrollTop;
	if (typeof document.compatMode != 'undefined' && document.compatMode != 'BackCompat') { 
    		x_scrollLeft=document.documentElement.scrollLeft;
			y_scrollTop=document.documentElement.scrollTop;
	} 
	else if (typeof document.body != 'undefined') { 
			x_scrollLeft=document.body.scrollLeft;
			y_scrollTop=document.body.scrollTop;
	}
	if (x_scrollLeft<=0){x_scrollLeft=document.documentElement.scrollLeft;}
	if (y_scrollTop<=0){y_scrollTop=document.documentElement.scrollTop;}
	//x = x + x_scrollLeft;
	//y = y + y_scrollTop;
	x = x_scrollLeft;
	y = y_scrollTop;
	document.getElementById('tip_div').style.left=(x+5)+'px';
	document.getElementById('tip_div').style.top=(y+10)+'px';
	//alert(document.documentElement.scrollTop);
	//alert(document.documentElement.scrollLeft);
	//alert(document.body.scrollTop);
	//alert(document.body.scrollLeft);
	
	var xmlhttp;
	if (window.XMLHttpRequest) {
		xmlhttp = new XMLHttpRequest();
	}else if (window.ActiveXObject) {
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	}
	
	//return xmlhttp;
	
	//-----------------------------XMLHttpRequest------------------------------------------------
	//var xmlhttp;
	//if (window.XMLHttpRequest) {
		//xmlhttp = new XMLHttpRequest();
	//}else if (window.ActiveXObject) {
		//xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    //if (!xmlHttp){
       //alert('您使用的瀏覽器不支援 xmlHttp 物件');
       //return false;
	//}
	//-----------------------------XMLHttpRequest------------------------------------------------
	
	
	var SendDate="id=" + id;
       
	//var SendDate="ts=" + new Date().getTime();
    //SendDate="id=" + id + "&" + SendDate;
	var url="/sale/tips_view.asp";
    xmlhttp.open('POST',url,true);
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');             //POST要加此行
	xmlhttp.onreadystatechange=function()
	{
		//alert(xmlhttp.status);
			if (xmlhttp.readyState==4)
			{
				if (xmlhttp.status == 200)
				{
					//div.className="on";
					//var obj=document.getElementById(k);
					var obj=document.getElementById('tip_div');
					if (xmlhttp.responseText!='')
						{
						 //alert(xmlhttp.responseText);
    					 obj.innerHTML=xmlhttp.responseText;
    					 obj.style.visibility='visible';
    					 //obj.title=xmlhttp.responseText;
    					 return false;
    					}
				}else{
					return false;
					//alert('執行錯誤,代碼:'+xmlhttp.status+'\('+xmlhttp.statusText+'\)');
				}
			}
	}
		xmlhttp.send(SendDate);
}

function clear_this_div(div){
	document.getElementById(div).style.display="none";
}

function get_product_text(id,div){
	document.getElementById(div).style.display="";
	document.getElementById(div).innerHTML="<img src='/pic/ajax_loader.gif' />  讀取中...";
	var xmlhttp;
	if (window.XMLHttpRequest) {
		xmlhttp = new XMLHttpRequest();
	}else if (window.ActiveXObject) {
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	}
	
	var SendDate="id=" + id +"&text_div=" + div;
	//var SendDate="ts=" + new Date().getTime();
    //SendDate="id=" + id + "&" + SendDate;
	var url="/sale/get_product_text.asp";
    xmlhttp.open('POST',url,true);
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');             //POST要加此行
	xmlhttp.onreadystatechange=function()
	{
		//alert(xmlhttp.status);
			if (xmlhttp.readyState==4)
			{
				if (xmlhttp.status == 200)
				{
					var obj=document.getElementById(div);
					if (xmlhttp.responseText!='')
						{
    					 obj.innerHTML=xmlhttp.responseText;
    					 return false;
    					}
				}else{
					return false;
					//alert('執行錯誤,代碼:'+xmlhttp.status+'\('+xmlhttp.statusText+'\)');
				}
			}
	}
		xmlhttp.send(SendDate);
}