﻿
function isIE(){ //ie? 
if (window.navigator.userAgent.toLowerCase().indexOf("msie")>=1) 
    return true; 
else 
    return false; 
} 
if(!isIE()){ //firefox innerText define
    HTMLElement.prototype.__defineGetter__("innerText", 
    function(){
        var anyString = "";
        var childS = this.childNodes;
        for(var i=0; i<childS.length; i++) { 

            if(childS[i].nodeType==1)
                //anyString += childS[i].tagName=="BR" ? "\n" : childS[i].innerText;
                anyString += childS[i].innerText;
            else if(childS[i].nodeType==3)
                anyString += childS[i].nodeValue;
        }
        return anyString;
    } 
    ); 
    HTMLElement.prototype.__defineSetter__("innerText", 
    function(sText){
        this.textContent=sText; 
    } 
    ); 
 
}
 
function shoptopcontent(id,classid){
	if(document.getElementById("topnews_content_hidden").innerHTML.length<90)
	  document.getElementById("topnews_content").innerHTML="&nbsp;&nbsp;"+ document.getElementById("topnews_content_hidden").innerText;
	else
	  document.getElementById("topnews_content").innerHTML="&nbsp;&nbsp;"+document.getElementById("topnews_content_hidden").innerText.substr(0,120);
	  document.getElementById("topnews_content").innerHTML+="...&nbsp;&nbsp;[<a href=\"view_"+id+"_"+classid+".html\" target=\"_blank\">详细信息</a>]"
											  +" [<a href=\"notebook_index.asp\">给我们留言</a>]";
}

function getleft(showid,hiddenid,length,SpaceEnter)
{
	var thetext = document.getElementById(hiddenid).innerText 
	if(thetext.length>length)  
		thetext=""+thetext.substr(0,length); 

	if(SpaceEnter==1)
	{
		thetext = thetext.replace(/\ /g,"&nbsp;");
		thetext = thetext.replace(/\r\n/g,"<br />")
	}
	//alert(thetext);
	document.getElementById(showid).innerHTML=thetext;
}
