function openWin(strUrl,winName,width,height) {	
	x=(screen.availWidth-width)/2
	y=(screen.availHeight-height)/2
	window.open(strUrl,winName,"width="+width+",height="+height+",left="+x+",top="+y+",scrollbars=yes")	
}


function writeTool() {
	document.write("<br class='clearfloat' /><div class='toolBar'><ul><li><a href='javascript:history.back(-1)' class='back'>返回上页</a></li><li><a href='../common/index.asp' class='home'>返回首页</a></li><li><a href='#' class='top'>回到顶部</a></li></ul></div>");
}


/*
add 080103
功能：图片的动态转换
*/

var imageholder=new Array()
var ie55=window.createPopup

function slideit(strSrc){
	//alert(parent.document.images.length)
	if (!document.images) return
	if (ie55) document.images.pic_show.filters[0].apply()
	document.images.pic_show.src=strSrc
	if (ie55) document.images.pic_show.filters[0].play()
}

function showBigPic(strSrc) {
	//取消按钮的选中状态
	theseObj=document.all("picText_allPage").getElementsByTagName("DD");
	
	//显示加载的图片提示
	document.all("loading").style.display="";
	document.all("pic_show").style.display="none";
	for (n=0;n<theseObj.length;n++) {
		theseObj[n].className="";		
	}
	//开始动态转换
	slideit(strSrc);
}



/*
图片说明的文字列表翻页,目前应用在电子杂志的翻页
*/
function setPicText_page(intPage) {	
	theseObj=document.all("picText_allPage").getElementsByTagName("DD");
	for (n=0;n<theseObj.length;n++) {
		theseObj[n].style.display="none";		
	}	
	theseObj=document.getElementsByName("picText_page"+intPage);
	for (n=0;n<theseObj.length;n++) {
		theseObj[n].style.display="";
	}
}

function imgHasLoaded(thisObj) {	
	document.all("loading").style.display="none";
	thisObj.style.display="";
}


var originalClassNameString;
originalClassNameString="";
//对所有的input 和 textarea 批量用CSS控制
function formatInput(strID){   
	var   a   =   document.getElementById(strID).getElementsByTagName("INPUT"); 
	for   (var   i=0;   i<a.length;   i++)  {
		if(a[i].type=="text" || a[i].type=="password") {
			a[i].className="input_text";
			a[i].onfocus=function() {
				originalClassNameString = this.className;
				this.className+=" focus"; 
			};
			a[i].onblur=function() {
				this.className=originalClassNameString; 
			};
		}
	} 
	
	
	var   a   =   document.all(strID).getElementsByTagName("textarea"); 
	for   (var   i=0;   i<a.length;   i++)  {
			a[i].className="input_text";
			a[i].onfocus=function() {
				originalClassNameString = this.className;
				this.className+=" focus"; 
			};
			a[i].onblur=function() {
				this.className=originalClassNameString; 
			};
	} 
	
}

function tagEventEffect(type,tag, parentId) { 	
	if (window.attachEvent) {   
		window.attachEvent("onload", function() {
		var sfEls = (parentId==null)?document.getElementsByTagName(tag):document.getElementById(parentId).getElementsByTagName(tag);  		type(sfEls);   
		});   
	}  	
}
sfHover = function(sfEls) {
	for (var i=0; i < sfEls.length; i++) { 
		sfEls[i].onmouseover=function() {
			originalClassNameString = this.className;
			this.className+=" over"; 
		}
		sfEls[i].onmouseout=function() {   
			this.className=originalClassNameString; 			
		}
	}   
} 

var tablink_idname = new Array("tablinkone","tablinktwo")
//Set the id names of your tabcontentareas (without a number at the end)
var tabcontent_idname = new Array("tabcontentone","tabcontenttwo") 
//Set the number of your tabs in each menu
var tabcount = new Array("6","3")
//Set the Tabs wich should load at start (In this Example:Menu 1 -> Tab 2 visible on load, Menu 2 -> Tab 5 visible on load , Menu 3 -> Tab 1 visible on load)
var loadtabs = new Array("1","1")  
//Set the Number of the Menu which should autochange (if you dont't want to have a change menu set it to 0)
var autochangemenu = 0;
//the speed in seconds when the tabs should change
var changespeed = 2;
//should the autochange stop if the user hover over a tab from the autochangemenu? 0=no 1=yes
var stoponhover = 1;
//END MENU SETTINGS

/*Swich EasyTabs Functions - no need to edit something here*/
function easytabs(menunr, active) {if (menunr == autochangemenu){currenttab=active;}if ((menunr == autochangemenu)&&(stoponhover==1)) {stop_autochange()} else if ((menunr == autochangemenu)&&(stoponhover==0))  {counter=0;}menunr = menunr-1;for (i=1; i <= tabcount[menunr]; i++){document.getElementById(tablink_idname[menunr]+i).className='tab'+i;document.getElementById(tabcontent_idname[menunr]+i).style.display = 'none';}document.getElementById(tablink_idname[menunr]+active).className='tab'+active+' tabactive';document.getElementById(tabcontent_idname[menunr]+active).style.display = 'block';}var timer; counter=0; var totaltabs=tabcount[autochangemenu-1];var currenttab=loadtabs[autochangemenu-1];function start_autochange(){counter=counter+1;timer=setTimeout("start_autochange()",1000);if (counter == changespeed+1) {currenttab++;if (currenttab>totaltabs) {currenttab=1}easytabs(autochangemenu,currenttab);restart_autochange();}}function restart_autochange(){clearTimeout(timer);counter=0;start_autochange();}function stop_autochange(){clearTimeout(timer);counter=0;}

window.onload=function(){
var menucount=loadtabs.length; var a = 0; var b = 1; do {easytabs(b, loadtabs[a]);  a++; b++;}while (b<=menucount);
if (autochangemenu!=0){start_autochange();}
}

