function nTabs(thisObj,Num){ 
if(thisObj.className == "active")return; 
var tabObj = thisObj.parentNode.id; 
var tabList = document.getElementById(tabObj).getElementsByTagName("li"); 
for(i=0; i <tabList.length; i++) 
{ 
  if (i == Num) 
  { 
   thisObj.className = "active";  
      document.getElementById(tabObj+"_Content"+i).style.display = "block"; 
  }else{ 
   tabList[i].className = "normal";  
   document.getElementById(tabObj+"_Content"+i).style.display = "none"; 
  } 
}  
} 



function show_intro(pre,pree, n, select_n,css) {
for (i = 1; i <= n; i++) {
var intro = document.getElementById(pre + i);
var cha = document.getElementById(pree + i);
intro.style.display = "none";
cha.className=css + "_off";
if (i == select_n) {
intro.style.display = "block";
cha.className=css + "_on";
}
}
}

function showimg(obj)
{
	obj.style.margin = '2px';
	obj.style.cursor="hand";
	if (obj.width > 460)
	{
		obj.resized = true;
		obj.height = (obj.height/obj.width)*460;
		obj.width = 460;
		obj.alt = '点击图片在新窗口查看大图';
		obj.title = '点击图片在新窗口查看大图';
	}
}

var td_read = false;
var td_ws = new Array();

var thunderpid = 0;
var thundertype = 0;
var thunderpara1 = '';
var thunderpara2 = '';
var thunderpara3 = 0;

function _src()
{	
	/*
	r = "";	
	try {		
		r = top.document.referrer;	
	}	
	catch (e) {		
		try {			
			r = parent.document.referrer;		
		}		
		catch (e) {			
			try {				
				r = document.referrer;			
			}			
			catch (e) {				
				r = "";					
			}		
		}	
	}	
	p = r.indexOf("?");	
	if(-1 == p)		
	p = r.indexOf("&");	
	if(-1 == p)		
		return r;	
	else 		
		return r.substring(0,p);
	*/
	return document.location;
}

function loadcop(sid) {
	var dtype = sid % 100;
	var copjs = '<script language="JavaScript" src="../un.so.gougou.com/socop/' + dtype + '/' + sid + 'a.js"><\/script>' 
		+ '<script language="JavaScript" src="../un.so.gougou.com/socop/' + dtype + '/' + sid + 'b.js"><\/script>' 
		+ '<script language="JavaScript" src="../un.so.gougou.com/js/SearchWord.js"><\/script>';
	document.write(copjs);
}

function xcontent(sid,stype,spara1,spara2,spara3) {
	var btype = Math.floor(parseInt(stype, 10)/100);
	if(btype == 4 || btype == 6 ) {
		sid = parseInt(sid, 10) + btype*1000000;
		preContent = '<a href="../www.gougou.com/search@search=' + spara1 + '&id=' + sid + '&pattern=' + stype + '" target="_blank">' + spara2 + '</a>';
	}
	else {
		preContent = '<iframe id="gougouframe" border="0" vspace="0" hspace="0" marginwidth="0" marginheight="0" framespacing="0" frameborder="0" scrolling="no" width="' + spara1 + '" height="' + spara2 + '" src="../un.so.gougou.com/gougou' + stype + '.htm#id=' + sid + '"></iframe>';
	}
	return preContent
}

/* 
 *spara1 - width, keyword
 *spara2 - height, title
 */
function xprint(sid,stype,spara1,spara2,spara3) {
	var btype = Math.floor(parseInt(stype, 10)/100);
	if(btype == 4 || btype == 6 ) {
		thunderpid = sid;
		thundertype = stype;
		thunderpara1 = spara1;
		thunderpara2 = spara2;
		if(spara3)
			thunderpara3 = parseInt(spara3,10);
		if(!td_read) {
			//loadcop(1);
			loadcop(sid);
			td_read = true;
		}
		document.write('<script language="JavaScript" src="../un.so.gougou.com/js/WordPrint.js"><\/script>');
	}
	else {
		document.write(xcontent(sid,stype,spara1,spara2,spara3));
	}
}
