function G(id){
    return document.getElementById(id);
};
function GC(t){
   return document.createElement(t);
};
String.prototype.trim = function(){
          return this.replace(/(^\s*)|(\s*$)/g, '');
};
function isIE(){
      return (document.all && window.ActiveXObject && !window.opera) ? true : false;
}

/*需要显示的div*/
var loginDivWidth = 900; 				 
					 
	var sign_in_flow4 ='<DIV style="Z-INDEX:20;LEFT:120px;VISIBILITY:visible;POSITION:absolute;TOP:150px;" class=logincontainer id=move name=move>'
		+'<style>html body {width:auto;height:auto;}</style>'
		+'<div class="emailtofrdbox"><table width="100%" border="0" cellpadding="0" cellspacing="0">'
		+'<tr><td class="contenttitlebg"><span class="toptitle">寄給朋友</span>'
		+'<div class="closebtn" style="cursor:pointer;" onclick="cancelSign();">'
		+'<img src="./images/searchboxcross_orange.gif" alt="關閉" border="0" align="absmiddle" /> 關閉'
		+'</div></td></tr>'
		+'<tr><td bgcolor="#FFFFFF"><div class="emailtofriendbox">'
		+'<table width="100%" border="0" cellpadding="0" cellspacing="0">'
		+'<tr><td valign="top" class="contentbg"><div style="padding:5px 0px 0px 0px"></div>'
		+'<div style="padding:5px 0px 0px 0px"></div>'
		+'<table width="100%" height="100" border="0" align="center" cellpadding="0" cellspacing="10" class="contentbg">'
		+'<tr><td><div class="subtitle"><strong>請選擇通知朋友的方法：  </strong></div></td></tr>'
		+'<tr><td>1.	直接抄貼以下連結<div style="padding:5px 0px 0px 0px"></div>'
		+'<input style="float:left;width:80%;margin-top:5px;margin-left:15px;" id="urltocopy" type="text" value="" readonly="1" onmouseover="emailover();" />'
		+'<button id="copytoclipboard" onclick="tocopy();" style="float:left;display:none">Copy</button>'
		+'<div style="padding:15px 0px 0px 0px"></div></td></tr>'
		+'<tr><td>2.	使用你個人的電郵信箱發送<div style="padding:5px 0px 0px 0px"></div><span style=" margin-left:15px; ">'
		+'[ <a id="emailurl" href="#" onclick="emailshow();">開啟信箱</a> ]</span>'
		+'<div style="padding:15px 0px 0px 0px"></div></td></tr>'
		+'<form id = "email_rs" name="email_rs" method = post action=""  style="display:none;" >'
		+'<input type="hidden" id = "pass_shopid" name = "pass_shopid" value=""/></form>'
		+'<tr><td>3.	<a href="#" onclick="call_xajax_email();">透過Sofood發送</a><div style="padding:5px 0px 0px 0px"></div><div style="padding:5px 0px 0px 0px"></div></td></tr></table><div style="padding:5px 0px 0px 0px"></div><div class="loginbtn"></div></td></tr></table></div></td></tr></table></div></div>';
		
		var sign_in_flow3 = '<DIV style="Z-INDEX:20;LEFT:320px;VISIBILITY:visible;POSITION:absolute;TOP:150px;" class=logincontainer id=move name=move>'
		+'<div class="editbookmark"><table width="100%" border="0" cellpadding="0" cellspacing="0">'
		+'<tr><td class="contenttitlebg"><span class="toptitle">檢舉此食評</span>'
		+'<div class="closebtn" style="cursor:pointer;" onclick="cancelSign();">'
		+'<img src="./images/searchboxcross_orange.gif" alt="關閉" border="0" align="absmiddle" /> 關閉</div></td></tr>'
		+'<tr><td bgcolor="#FFFFFF"><table width="350" border="0" align="left" cellpadding="0" cellspacing="10" class="contentbg">'
		+'<form METHOD="POST" id="infrom" name="inform" enctype="multipart/form-data">'
		+'<input type="hidden" name="inform_id" value="" /><tr><td>請選擇檢舉類別：</td></tr>'
		+'<tr><td><input name="inform_type" type="radio" value="1" checked="checked" />懷疑不實食評'
		+'<br /><input name="inform_type" type="radio" value="2" />內容含粗言穢語'
        +'<br /><input name="inform_type" type="radio" value="3" />點評不屬於此店'
        +'<br /><input name="inform_type" type="radio" value="4" />重覆發表'
        +'<br /><input name="inform_type" type="radio" value="5" />其他</td></tr>'
		+'<tr><td><strong>檢舉理由:</strong><br />請詳細說明你的檢舉理由，以便查證。</td></tr>'
		+'<tr><td><textarea style="width:98%; height:50px;" name="inform_content"></textarea></td></tr>'
		+'<tr><td><input style="width:100px;" type="submit" name="btnSubmit" onclick="call_xajax_inform();return false;" value="遞交" />'
		+'<input style="width:100px;" type="button" name="btnCancle" value="取消" onclick="cancelSign();" /></td></tr></form></table></td></tr></table></div></div>';
		
		
		var sign_in_flow5 = '<DIV style="Z-INDEX:20;LEFT:120px;VISIBILITY:visible;POSITION:absolute;TOP:150px;" class=logincontainer id=move name=move>'
					 +'<div class=\"emailtofrdbox\"><table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td class=\"contenttitlebg\"><span class=\"toptitle\">寄給朋友<\/span><div class=\"closebtn\" style=\"cursor:pointer;\" onclick=\"cancelSign();\"><img src=\".\/images\/searchboxcross_orange.gif\" alt=\"關閉\" border=\"0\" align=\"absmiddle\" \/> 關閉'
+'					<\/div><\/td><\/tr><tr><td bgcolor=\"#FFFFFF\">'
+'<form METHOD=\"POST\" id=\"form1\" onsubmit=\"return CheckForm()\" action=\".\/mailfriend.php\" target=\"myform\">'
+'         <input type=\"hidden\" name=\"subaction\" id=\"subaction\" value=\"1\" \/>'
+'        <input type=\"hidden\" name="sendurl" id="sendurl" value=\"\" \/><input type=\"hidden\" name=\"shopname\" value=\"[##$restaurant_sr.name##]\" \/><input type=\"hidden\" name=\"RestaurantId\" value=\"[##$shopid##]\" \/><div class=\"emailtofriendbox\"><table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td valign=\"top\"><div style=\"padding:5px 0px 0px 0px\"><\/div><table width=\"100%\" height=\"100\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"10\" class=\"contentbg\"><tr><td><table width=\"100%\" height=\"100\" border=\"0\" cellpadding=\"0\" cellspacing=\"2\"><tr valign=\"top\"><td width=\"150\"><span class=\"requiredfield\"><span class=\"requiredfield\">*<\/span>必須輸入'
+'                                  <\/span><\/td><td><\/td><\/tr><tr valign=\"top\"><td><div align=\"right\">'
+'                                    朋友的電郵地址<span class=\"requiredfield\">*<\/span>:'
+'                                  <\/div><\/td><td><textarea style=\"width:98%; height:50px; \" name=\"EmailTo\" id=\"EmailTo\"><\/textarea><div class=\"restAcknoemail\">(請用逗號分隔電郵地址) <\/div><div class=\"WarningMessage \" id=\"WarningMessageEmailTo\"><img width=\"16\" height=\"13\" align=\"absmiddle\" src=\"\/images\/warning_s.gif\" \/> 必須輸入朋友的電郵地址'
+'                                  <\/div><div class=\"WarningMessage \" id=\"WarningMessageEmailToFormat\"><img width=\"16\" height=\"13\" align=\"absmiddle\" src=\".\/images\/warning_s.gif\" \/> 朋友的電郵地址格式不正確: <\/div><\/td><\/tr><tr valign=\"top\"><td><div align=\"right\">'
+'                                    你的名字<span class=\"requiredfield\">*<\/span>:'
+'																	<\/div><\/td><td><input style=\"width:98%;\" name=\"sendname\" id=\"sendname\" type=\"text\" value=\"\" \/><div class=\"WarningMessage \" id=\"WarningMessageUsername\"><img width=\"16\" height=\"13\" align=\"absmiddle\" src=\".\/images\/warning_s.gif\" \/> 必須輸入你的名字'
+'                                  <\/div><\/td><\/tr><tr valign=\"top\"><td><div align=\"right\">你的電郵: <span class=\"requiredfield\">*<\/span><\/div><\/td><td><input style=\"width:98%;\" id=\"Email\" name=\"Email\" type=\"text\" value=\"[##$useremail##]\" \/><div class=\"WarningMessage \" id=\"WarningMessageEmail\"><img width=\"16\" height=\"13\" align=\"absmiddle\" src=\"\/images\/warning_s.gif\" \/> 必須輸入你的電郵'
+'                                  <\/div><div class=\"WarningMessage \" id=\"WarningMessageEmailFormat\"><img width=\"16\" height=\"13\" align=\"absmiddle\" src=\".\/images\/warning_s.gif\" \/> 你的電郵地址格式不正確'
+'                                  <\/div><\/td><\/tr><tr valign=\"top\"><td><div align=\"right\">'
+'                                    訊息:  <br \/><\/div><\/td><td><textarea name=\"textarea\" style=\"width:98%; height:100px; \"><\/textarea><\/td><\/tr><tr valign=\"top\"><td>'
+'																<\/td><td><center><span class=\"loginbtn\"><input style=\"width:65px;\" type=\"Submit\" name=\"Submit\" value=\"發送\" \/><input style=\"width:65px;\" type=\"button\" name=\"14\" value=\"取消\" onclick=\"cancelSign();\" \/><\/span><\/center><span class=\"loginbtn\"><\/span><\/td><\/tr><\/table><div style=\"padding:5px 0px 0px 0px\"><\/div><\/td><\/tr><\/table><div style=\"padding:5px 0px 0px 0px\"><\/div><div class=\"loginbtn\"><\/div><\/td><\/tr><\/table><\/div><\/form><\/td><\/tr><\/table><iframe name=\"myform\" id=\"myform\" frameborder=\"0\" style=\"display:none\" src=\".\/mailfriend.php\"><\/iframe><\/div></DIV>';
		var sign_in_flow6 = '<DIV style="Z-INDEX:20;LEFT:320px;VISIBILITY:visible;POSITION:absolute;TOP:150px;" class=logincontainer id=move name=move>'
					+'<div class=\"AddFavBox\"><table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td class=\"contenttitlebg\"><span class=\"toptitle\"><\/span><div class=\"closebtn\" style=\"cursor:pointer;\" onclick=\"cancelSign();\"><img src=\".\/images\/searchboxcross_orange.gif\" alt=\"關閉\" border=\"0\" align=\"absmiddle\" \/> 關閉'
+'					<\/div><\/td><\/tr><tr><td bgcolor=\"#FFFFFF\"><table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"5\" class=\"contentbg\"><tr><td><div id=\"scrollable\"><strong>成功發送!<\/strong><\/div><div style=\"padding:10px 0px 0px 0px\"><\/div>'
+'							此訊息將於5秒後自動關閉。<br \/>'
+'							[如未有自動關閉，請按以下關閉鍵]'
+'						<div style=\"padding:20px 0px 0px 0px\"><\/div><\/td><\/tr><tr><td><center><button onclick=\"cancelSign();\">關閉<\/button><\/center><\/td><\/tr><\/table><script>'
+'					parent.delayHidePopup(0,0,\'\');'
+'				<\/script><\/td><\/tr><\/table><\/div></DIV>';
		var sign_in_flow7 = '<DIV style="Z-INDEX:20;LEFT:200px;VISIBILITY:visible;POSITION:absolute;TOP:150px;" class=logincontainer id=move name=move>'
					+'<div class="ForgotPwdbox"><table width="100%" border="0" cellpadding="0" cellspacing="0">'
					+'<tr><td class="contenttitlebg"><span class="toptitle">忘記密碼</span>'
					+'<div class="closebtn" style="cursor:pointer;" onclick="cancelSign();">'
					+'<img src="./images/searchboxcross_orange.gif" alt="關閉" border="0" align="absmiddle" /> 關閉</div>'
					+'</td></tr><tr><td bgcolor="#FFFFFF"><div class="emailtofriendbox">'
					+'<table width="100%" border="0" cellpadding="0" cellspacing="0">'
					+'<tr><td valign="top" class="contentbg"><div style="padding:5px 0px 0px 0px"></div>'
					+'<div style="padding:5px 0px 0px 0px"></div>'
				+'<table width="100%" height="100" border="0" align="center" cellpadding="0" cellspacing="10" class="contentbg">'
				+'<tr><td><strong>請輸入您登記所使用的登入電郵或食家名稱，我們便會將重設密碼的指示寄上。</strong>'
				+'</td></tr><tr><td><form name="getpw" id="getpw" METHOD="POST" onsubmit="return false;">'
				+'<table width="100%" border="0" cellspacing="0" cellpadding="0">'
				+'<tr><td width="162">登入電郵或食家名稱：</td>'
				+'<td><input style="width:200px;" name="pwEmail" id="pwEmail" type="text" onkeydown="enterPress(event);"  value="" /></td></tr>'
				+'<tr><td colspan="2" height="20"><div class="WarningMessage " id="WarningMessageEmail">'
				+'<img width="16" height="13" align="absmiddle" src="./images/warning_s.gif" /> 必須輸入電郵或食家名稱</div>'
				+'<div class="WarningMessage " id="MessageEmail">'
				+'<img src="./images/warning_s.gif" width="16" height="13" align="absmiddle" /> 輸入的電郵或食家名稱不存在或未被確認'
				+'</div></td></tr><tr><td></td><td height="40"><span class="loginbtn">'
				+'<input style="width:65px;" type="submit" id="emailsubmit" name="emailsubmit"  onclick="CheckForm2();return false;" value="遞交" />'
				+'<input style="width:65px;" type="button" onclick="cancelSign();" value="取消" />'
				+'</span></td></tr></table></form></td></tr></table></td></tr></table></div></td></tr></table></div></DIV>';
		var sign_in_flow8 = '<DIV style="Z-INDEX:20;LEFT:320px;VISIBILITY:visible;POSITION:absolute;TOP:150px;" class=logincontainer id=move name=move>'
					+'<div class=\"AddFavBox\"><table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td class=\"contenttitlebg\"><span class=\"toptitle\">忘记密碼<\/span><div class=\"closebtn\" style=\"cursor:pointer;\" onclick=\"cancelSign();\"><img src=\".\/images\/searchboxcross_orange.gif\" alt=\"關閉\" border=\"0\" align=\"absmiddle\" \/> 關閉'
+'					<\/div><\/td><\/tr><tr><td bgcolor=\"#FFFFFF\"><table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"5\" class=\"contentbg\"><tr><td><div id=\"scrollable\"><strong>成功發送!<\/strong><\/div><div style=\"padding:10px 0px 0px 0px\"><\/div>'
+'							我們已將重設密碼的指示寄到你登記的電郵地址。'
+'						<div style=\"padding:20px 0px 0px 0px\"><\/div><\/td><\/tr><tr><td><center><button onclick=\"cancelSign();\">關閉<\/button><\/center><\/td><\/tr><\/table><script>'
+'					parent.delayHidePopup(0,0,\'\');'
+'				<\/script><\/td><\/tr><\/table><\/div></DIV>';
	  var sign_in_flow9 = '<DIV id=move name=move style="Z-INDEX:20;LEFT:80px;VISIBILITY:visible;POSITION:absolute;TOP:0px;" >'
	  +	'<iframe id="theframe" name="theframe" src="" style="border:none; height:586px; width:754px; background-color: #DCA0AE;" allowtransparency="true" frameborder="0" scrolling="no" marginheight="0px" marginwidth="0px"></iframe>'
	  +'</DIV>';
	   var sign_in_flow10 = ' <div id="regbox"><div class="closebtn"><a href="javascript:void(0);" onclick="close_UI();"><img src="images/closebtn.jpg"/></a></div><iframe id="theframe" name="theframe" src="logintest.php" style="border:none; height:180px; width:515px;" allowtransparency="true" frameborder="0" scrolling="no" marginheight="0px" marginwidth="0px"></iframe></div>';
	   var sign_in_flow11 = '<div id="regbox"><div class="closebtn"><a href="javascript:void(0);" onclick="close_UI();"><img src="images/closebtn.jpg"/></a></div>'
	  +	'<iframe id="theframe" name="theframe" src="" style="border:none; height:180px; width:515px;" allowtransparency="true" frameborder="0" scrolling="no" marginheight="0px" marginwidth="0px"></iframe>'
	  +'</DIV>';
	
	function enterPress(e)
	{
		 if (e.keyCode == 13) {   
            document.getElementById('emailsubmit').click();   
        }   
		
	}
	
	function call_xajax_inform()
	{
		xajax_inform(xajax.getFormValues('inform'));	
	}
		
	function call_xajax_email()
	{
		xajax_email_pass(xajax.getFormValues('email_rs'));
	}
	
	function call_xajax_pwemail()
	{
		xajax_email_pw(xajax.getFormValues('getpw'));
	}
	
	function CheckForm2()
	{
		var error = 0;
		var check = 0;

		check = document.getElementById("pwEmail").value == "";
		error = check || error;
		document.getElementById("WarningMessageEmail").className = check? 'WarningMessage error':'WarningMessage';
		if(error)
		{
		document.getElementById('pwEmail').focus();
		return !error;
		}else
		{
			call_xajax_pwemail();
		}
	}
	
	function emailfail(e){
		if(e=='3')
		{
			document.getElementById("MessageEmail").className = 'WarningMessage error';	
		}else
		{
			alert(e);
		}
	}

	function CheckForm()
	{
		var error = 0;
		var check = 0;

		check = document.getElementById("EmailTo").value == "";
		error = check || error;
		document.getElementById("WarningMessageEmailTo").className =check? "WarningMessage error" : "WarningMessage";
		
		check = document.getElementById("sendname").value == "";
		error = check || error;
		document.getElementById("WarningMessageUsername").className =check? "WarningMessage error" : "WarningMessage";

		check = document.getElementById("Email").value == "";
		error = check || error;
		document.getElementById("WarningMessageEmail").className =check? "WarningMessage error" : "WarningMessage";
		
		
		return !error;
	}
	
	function hideSelect() 
	{ 
	var selects = document.getElementsByTagName( "Select"); 
	for(var i=0;i<selects.length;i++) 
	{ selects[i].style.display=   "none"; } 
	} 
	
	function showSelect() 
	{ 
	var selects = document.getElementsByTagName( "Select"); 
	for(var i=0;i<selects.length;i++) 
	{ selects[i].style.display=   ""; } 
	} 
	
	function emailover()
	{
		//$G("urltocopy").select();
		G("copytoclipboard").style.display='block';
	}
	
	function close_UI()
	{
		$.unblockUI({fadeOut:400});

	}
	function emailshow()
	{
		var url = window.location.href; 
		//var mailurl = document.getElementById('emailurl');
		G("emailurl").href ='mailto:?subject=Hey,%20I%20found%20this%20on%20Sofood.cc&body='+url;
	}
	
	function inform_sucess()
	{
			alert('您的检举已提交，谢谢您的支持');
			cancelSign();
	}
	function tocopy()
	{
		DOM.CopyToClipboard(urltocopy);
		alert("地址复制成功！快和你的朋友分享吧！");
	}
	function showtimeout(e)
	{
		popSign(e);
		setTimeout('cancelSign()',5000);
	}

function loadSignInFlow(){
   G("sign_div").innerHTML = sign_in_flow;
    //G("sign_email").focus();
};
/*需要显示的div*/

function cancelSign(){
	showSelect();
    G("sign_div").style.display = 'none';
    G("cover_div").style.display = 'none';
   document.body.style.overflow = '';
   if(G("theframe"))
	{
		G("theframe").src = "about:blank";
	}
};
function popCoverDiv(){
   if (G("cover_div")) {
    G("cover_div").style.display = '';
   } else {
    var coverDiv = GC('div');
    document.body.appendChild(coverDiv);
    coverDiv.id = 'cover_div';
    with(coverDiv.style) {
     position = 'absolute';
     background = '#CCCCCC';
     left = '0px';
     top = '0px';
     var bodySize = getBodySize();
     width = bodySize[0] + 'px'
     height = bodySize[1] + 'px';
     zIndex = 98;
     if (isIE()) {
      filter = "Alpha(Opacity=60)";
     } else {
      opacity = 0.6;
     }
    }
   }
}
function getBodySize(){
   var bodySize = [];
   with(document.body) {
    bodySize[0] = (scrollWidth>clientWidth)?scrollWidth:clientWidth;
    bodySize[1] = (scrollHeight>clientHeight)?scrollHeight:clientHeight;
   }
   return bodySize;
} 

function getPosition(sender) {
    var e=sender,E=e;
    var x=e.offsetLeft;
    var y=e.offsetTop;
    while (e=e.offsetParent) {
        var P=e.parentNode;
        while (P!=(E=E.parentNode)) {
            x-=E.scrollLeft;
            y-=E.scrollTop;
        }
        x+=e.offsetLeft;
        y+=e.offsetTop;
        E=e;
    }
 return {"x":x,"y":y};
}

function popSign(e,data,url){

   if(e==0){
    //G("sign_div").innerHTML = sign_in_flow;
	//G("refererx").value = url;
	$.blockUI({message: sign_in_flow11,fadeIn: 700,fadeOut: 10,
	  css:{
		width:'auto',
		height:'auto',
		border:'#d69181 solid 5px',
		cursor: 'default'
	   },
	   overlayCSS: { backgroundColor: '#d69181',
	   				 opacity : 0.4}
	  }); 

		G('theframe').src = 'login.php?url='+url+'&data='+data;
	}
	else if(e==1)
	{
	//G("sign_div").innerHTML = sign_in_flow2;
	
		$.blockUI({message: sign_in_flow10,fadeIn: 700,fadeOut: 10,
	  css:{
		width:'auto',
		height:'auto',
		border:'#d69181 solid 5px',
		cursor: 'default'
	   },
	   overlayCSS: { backgroundColor: '#d69181',
	    			 opacity : 0.4}
	  }); 
	}else if(e==2)
	{
	G("sign_div").innerHTML = sign_in_flow3;
	G("inform_id").value = data;
	}else if(e==3)
	{
		G("sign_div").innerHTML = sign_in_flow4;
		//var url2 = document.URL;
		G("urltocopy").value=window.location.href;
		G("pass_shopid").value = data;
		
	}else if(e==5)
	{
		G("sign_div").innerHTML = sign_in_flow5;
		G("shopname").value = data['shopname'];
		G("sendname").value = data['username'];
		G("Email").value = data['email'];
		document.getElementById('sendurl').value =window.location.href;
	}else if(e==6)
	{
		G("sign_div").innerHTML = sign_in_flow6;
		//var url2 = document.URL;
	}else if(e==7)
	{
		G("sign_div").innerHTML = sign_in_flow7;
		document.getElementById('pwEmail').focus();
	}else if(e==8)
	{
		G("sign_div").innerHTML = sign_in_flow8;
	}else if(e==9)
	{
		G("sign_div").style.top = '10px';
		G("sign_div").innerHTML = sign_in_flow9;
		G('theframe').src = 'mapreport.php?ishop='+data;
	}

}

function popLogin(e,data,url) {
	
   popSign(e,data,url);  
}

function logout(formhash){
	var url = "./logout.php";
	var postStr = "formhash="+formhash;
	var ajax=InitAjax();
	ajax.open("POST",url,true);
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	ajax.send(postStr); 
	ajax.onreadystatechange = function()
	{
	　　//如果执行状态成功，那么就把返回信息写到指定的层里
	　　if (ajax.readyState == 4 && ajax.status == 200)
		{
			if(ajax.responseText=='success')
			{
						window.location.reload();
			}else{
	　　　	alert(ajax.responseText);
			}
			//msg.innerHTML = ajax.responseText;
	　　 } 
	}	
}
//<![CDATA[
var tips; var theTop = 0/*这是默认高度,越大越往下*/; var old = theTop;
function initFloatTips() {
  tips = document.getElementById('move');
  moveTips();
};
function moveTips() {
  var tt=50;
  if (window.innerHeight) {
    pos = window.pageYOffset
  }
  else if (document.documentElement && document.documentElement.scrollTop) {
    pos = document.documentElement.scrollTop
  }
  else if (document.body) {
    pos = document.body.scrollTop;
  }

  pos=pos-tips.offsetTop+theTop;
  pos=tips.offsetTop+pos/10;
	
  if (pos < theTop) pos = theTop;
  if (pos != old) {
    tips.style.top = pos+"px";
    tt=10;
		//alert(tips.style.top);
  }
	  //alert(pos+","+old);
  old = pos;
  setTimeout(moveTips,tt);
}
//!]]>
