function showTip(obj,txt){
        obj.init = function(){
            var thisObj = this;
            var str = thisObj.innerHTML;
            thisObj.style.position = "relative";
              var div = document.createElement("span");
             div.className = "tip-bg";
              div.innerHTML = "<div class=\"tip-bulb\">&nbsp;" + txt + "&nbsp;</div>";
              thisObj.insertBefore(div,thisObj.firstChild);

            thisObj.getElementsByTagName ('div')[0].style.display = 'none';

            thisObj.showTip();
			
            thisObj.onmouseover = thisObj.showTip;
            thisObj.onmouseout = thisObj.hideTip;
        }
        obj.showTip = function(){

            var thisObj = this;
            clearTimeout(thisObj.timeout);
            thisObj.timeout = setTimeout(function(){
                thisObj.getElementsByTagName ('div')[0].style.display='block';
            },200);
        }
        obj.hideTip = function(){
            var thisObj = this;
            clearTimeout(thisObj.timeout);
            thisObj.getElementsByTagName ('div')[0].style.display='none'
        }
        obj.init();
	}

function blanklinks(){       //设定属性rel为external的连接在新页面打开
        if(!document.getElementsByTagName) return ;
        var anchors=document.getElementsByTagName("a");
        for(var i=0;i<anchors.length;i++){
            anchor=anchors[i];
            if(anchor.getAttribute("href")&&anchor.getAttribute("rel")=="blank"){
                anchor.setAttribute("target","_blank");
            }
        }
    }

function showtab(n,m) {
	for (var i=1;i<=m;i++) {
	if (i==n) {
		document.getElementById("tab_"+i).className="nonce"
		document.getElementById("list_"+i).style.display="block"
		}
		else {
		document.getElementById("tab_"+i).className=""
		document.getElementById("list_"+i).style.display="none"
		}
	}
}
function showlist(n,m) {
	for (var i=1;i<=m;i++) {
	if (i==n) {
		document.getElementById("show_"+i).className="nonce"
		document.getElementById("goods_"+i).style.display="block"
		}
		else {
		document.getElementById("show_"+i).className=""
		document.getElementById("goods_"+i).style.display="none"
		}
	}
}

function settab(area,id) {
	var tabArea=document.getElementById(area);

	var contents=tabArea.childNodes;
	for(i=0; i<contents.length; i++) {
		if(contents[i].className=='tabcontent'){contents[i].style.display='none';}
	}
	document.getElementById(id).style.display='';

	var tabs=document.getElementById(area+'_tabs').getElementsByTagName('a');
	for(i=0; i<tabs.length; i++) { tabs[i].className=''; }
	document.getElementById(id+'_tab').className='nonce';
	document.getElementById(id).style.display='block';
	document.getElementById(id+'_tab').blur();
}

function init() {
	blanklinks();
}

window.onload = init;

/*JQ*/


