<!--
// flash,scroller,pollfun,default
// 显示flash
function Flash(file, w, h)
{
		document.write("<div style=\"padding:5px\"><object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width=\"");
		document.write(w);
		document.write("\" height=\"");
		document.write(h);
		document.write("\"><param name=\"movie\" value=\"");
		document.write(urlPrefix+file);
		document.write("\"> <param name=\"quality\" value=\"high\"><param name=\"wmode\" value=\"opaque\"><embed src=\"");
		document.write(file);
		document.write("\" loop=\"false\" menu=\"false\" quality=\"high\" width=\"");
		document.write(w);
		document.write("\" height=\"");
		document.write(h);
		document.write("\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"></embed></object></div>");
}

//***

// 提交调查检查
function pollCheck(o,checkMax){
	var checkNum = 0;
	var f = o.form;
	for(var i=0; i<f.elements.length; i++){
		var c = f.elements[i];
		if (c.name==o.name && c.checked){
			checkNum++;
		}
	}
	if (checkNum>checkMax){
		alert("最多选择"+ checkMax +"项!");
		o.checked = false;
	}
}

// 查看调查
function ViewPoll(id) {
	window.open(urlPrefix+"pollView.aspx?act=result&id="+id, "iwmsPoll","width=500,height=400,left=0,top=0,scrollbars=1,status=1,resizable=1");
}


//***

// 友情链接滚动脚本
//alert(navigator.userAgent);
var rollspeed=30
var myInter;
var ff=navigator.userAgent.indexOf("Firefox")>=0;
function MarqueeV(){
	var ooRollV=document.getElementById("oRollV");
	var ooRollV1=document.getElementById("oRollV1");
	var ooRollV2=document.getElementById("oRollV2");
	if (ooRollV.scrollTop>=(ff ? ooRollV.scrollHeight/2 : ooRollV1.scrollHeight)){
		ooRollV.scrollTop=1;	
	}else{
		ooRollV.scrollTop++;
	}
}
function StartRollV() {
	var ooRollV=document.getElementById("oRollV");
	var ooRollV1=document.getElementById("oRollV1");
	var ooRollV2=document.getElementById("oRollV2");
	if (ooRollV) {
		if (parseInt(ooRollV.style.height)>=ooRollV1.scrollHeight) {
			ooRollV.style.height = ooRollV1.scrollHeight;
			return;
		}
		ooRollV2.innerHTML=ooRollV1.innerHTML;
		myInter=setInterval(MarqueeV,rollspeed);
		ooRollV.onmouseover=function() {clearInterval(myInter)};
		ooRollV.onmouseout=function() {myInter=setInterval(MarqueeV,rollspeed)};
	}
}
function MarqueeH(){
	var ooRollH=document.getElementById("oRollH");
	var ooRollH1=document.getElementById("oRollH1");
	var ooRollH2=document.getElementById("oRollH2");
	if(ooRollH2.offsetLeft-ooRollH.scrollLeft<=0) {
		ooRollH.scrollLeft-=ooRollH1.offsetWidth;
	}else{
		ooRollH.scrollLeft++;
	}
}
function StartRollH() {
	var ooRollH=document.getElementById("oRollH");
	var ooRollH1=document.getElementById("oRollH1");
	var ooRollH2=document.getElementById("oRollH2");
	if (ooRollH) {
		if (parseInt(ooRollH.style.width)>=ooRollH2.offsetLeft) {
			oRollH.style.width = oRollH2.offsetLeft;
			return;
		}
		ooRollH2.innerHTML=ooRollH1.innerHTML;
		myInter=setInterval(MarqueeH,rollspeed);
		ooRollH.onmouseover=function() {clearInterval(myInter)};
		ooRollH.onmouseout=function() {myInter=setInterval(MarqueeH,rollspeed)};
	}
}

// 友情链接高度
function linkSize()
{
	var o1,o2;
	with(document){
		o1 = document.getElementById("siteNav");
		o2 = document.getElementById("oRollV");
	}
	if (o1&&o2){
		if (parseInt(o2.style.height)+25<parseInt(o1.clientHeight)){
			o2.style.height = (parseInt(o1.clientHeight) - 35) + "px";
		}
	}
}


//***

/*公告滚动脚本
* Pausing up-down scroller- ? Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
*/
function pausescroller(content, divId, divHeight, delay){
	content=this.arrayInit(content);
	if (content.length==0){
		return;
	}else if(content.length==1){
		content[1]=content[0];
	}
	this.content=content; //message array content
	this.tickerid=divId; //ID of ticker div to display information
	this.delay=delay; //Delay between msg change, in miliseconds.
	this.mouseoverBol=0; //Boolean to indicate whether mouse is currently over scroller (and pause it if it is)
	this.hiddendivpointer=1; //index of message array for hidden div
	var o_c=document.createElement("DIV");
	o_d=document.createElement("DIV");
	o_d.id=divId;
	with(o_d.style){
		position="relative";
		overflow="hidden";
	height=divHeight+"px";
	}
	var o_d1=document.createElement("DIV");
	with(o_d1){
		id=divId+"1";
		className="innerDiv bulletin";
		style.position="absolute";
		style.textAlign="center";
		style.width="100%";
		innerHTML=content[0];
	}
	var o_d2=document.createElement("DIV");
	with(o_d2){
		id=divId+"2";
		className="innerDiv bulletin";
		style.position="absolute";
		style.textAlign="center";
		style.width="100%";
		style.visibility="hidden";
		innerHTML=content[1];
	}
	o_d.appendChild(o_d1);
	o_d.appendChild(o_d2);
	o_c.appendChild(o_d);
	document.write(o_c.innerHTML);
	var scrollerinstance=this;
	setTimeout(function(){scrollerinstance.initialize()}, 300);
}

// initialize()- Initialize scroller method.
pausescroller.prototype.initialize=function(){
	this.tickerdiv=document.getElementById(this.tickerid);
	this.visiblediv=document.getElementById(this.tickerid+"1");
	this.hiddendiv=document.getElementById(this.tickerid+"2");
	this.visibledivtop=parseInt(pausescroller.getCSSpadding(this.tickerdiv));
	//set width of inner DIVs to outer DIV's width minus padding (padding assumed to be top padding x 2)
	this.visiblediv.style.width=this.hiddendiv.style.width=this.tickerdiv.offsetWidth-(this.visibledivtop*2)+"px";
	this.getinline(this.visiblediv, this.hiddendiv);
	this.hiddendiv.style.visibility="visible";
	var scrollerinstance=this;
	document.getElementById(this.tickerid).onmouseover=function(){scrollerinstance.mouseoverBol=1};
	document.getElementById(this.tickerid).onmouseout=function(){scrollerinstance.mouseoverBol=0};
	if (window.attachEvent){//Clean up loose references in IE
		window.attachEvent("onunload", function(){scrollerinstance.tickerdiv.onmouseover=scrollerinstance.tickerdiv.onmouseout=null});
	}
	setTimeout(function(){scrollerinstance.animateup()}, this.delay);
};

// animateup()- Move the two inner divs of the scroller up and in sync
pausescroller.prototype.animateup=function(){
	var scrollerinstance=this;
	if (parseInt(this.hiddendiv.style.top)>(this.visibledivtop+5)){
		this.visiblediv.style.top=parseInt(this.visiblediv.style.top)-5+"px";
		this.hiddendiv.style.top=parseInt(this.hiddendiv.style.top)-5+"px";
		setTimeout(function(){scrollerinstance.animateup()}, 50);
	}else{
		this.getinline(this.hiddendiv, this.visiblediv);
		this.swapdivs();
		setTimeout(function(){scrollerinstance.setmessage()}, this.delay)
	};
};

// swapdivs()- Swap between which is the visible and which is the hidden div
pausescroller.prototype.swapdivs=function(){
	var tempcontainer=this.visiblediv;
	this.visiblediv=this.hiddendiv;
	this.hiddendiv=tempcontainer;
};

pausescroller.prototype.getinline=function(div1, div2){
	div1.style.top=this.visibledivtop+"px";
	div2.style.top=Math.max(div1.parentNode.offsetHeight, div1.offsetHeight)+"px";
};

// setmessage()- Populate the hidden div with the next message before it's visible
pausescroller.prototype.setmessage=function(){
	var scrollerinstance=this;
	if (this.mouseoverBol==1){ //if mouse is currently over scoller, do nothing (pause it)
		setTimeout(function(){scrollerinstance.setmessage()}, 100);
	}else{
		var i=this.hiddendivpointer;
		var ceiling=this.content.length;
		this.hiddendivpointer=(i+1>ceiling-1)? 0 : i+1;
		this.hiddendiv.innerHTML=this.content[this.hiddendivpointer];
		this.animateup();
	}
};

pausescroller.getCSSpadding=function(tickerobj){ //get CSS padding value, if any
	if (tickerobj.currentStyle){
		return tickerobj.currentStyle["paddingTop"];
	}else if (window.getComputedStyle){ //if DOM2
		return window.getComputedStyle(tickerobj, "").getPropertyValue("padding-top");
	}else{
		return 0;
	}
};

// iwms公告数组处理函数
pausescroller.prototype.arrayInit=function(arr){
	if (arr.length==0 || typeof(arr[0])!="object"){
		return arr;
	}
	if (arr[0].length==3){
		for(var i=0;i<arr.length;i++){
		var c=document.createElement("DIV");
		var a=document.createElement("A");
		a.target="_blank";
		a.href=arr[i][1];
		a.innerHTML=arr[i][0];
		a.className="bulletin";
		var s=document.createElement("SPAN");
		s.className="gray";
		s.innerHTML="&nbsp; ["+ arr[i][2] +"]";
		c.appendChild(a);
		c.appendChild(s);
		arr[i] = c.innerHTML;
		}
	}else{
		for(var i=0;i<arr.length;i++){
		var c=document.createElement("DIV");
		var a=document.createElement("A");
		a.style.fontWeight="bold";
		a.target="_blank";
		a.href=arr[i][1];
		a.innerHTML=arr[i][0];
		var s=document.createElement("DIV");
		s.className="gray";
		s.style.textAlign="right";
		s.style.marginBottom="10px";
		s.innerHTML="&nbsp; ["+ arr[i][2] +"]";
		var b=document.createElement("DIV");
		b.style.textAlign="left";
		b.innerHTML=arr[i][3];
		c.appendChild(a);
		c.appendChild(b);
		c.appendChild(s);
		arr[i] = c.innerHTML;
		}
	}
	return arr;
};


/**
模块: 图像(水平翻页)滚动[imagePageView]
更新: 10:26 2007-2-27
参数: 
	@param  elm{String|Dom node}  需要添加滚动效果的模块
	@param  opt{Object}  动画效果的一些设置
返回值: {Object}
功能: 将图片列表滚动起来(水平滚动)
页面结构限制: 
	在 div.image_list_box 之外添加id
	每个id 下面只能有1 个ul
	每个ul 下面的图片必须足够多(不能在1 行完全显示)才会滚动
*/
function imagePageView(elmId, opt){
	new imagePageView_build(elmId, opt);
}
function imagePageView_build(elmId, opt){
	var me=this;
	this.elmId=elmId;
	this.elmRoot=Dom.$id(elmId);
	if(!this.elmRoot){return false;}
	if(opt){//如果带了配置，则读取
	}
	var elmListW=Dom.$tagHasClassInNodeChild('div', 'image_list_box', this.elmRoot)[0];//动画显示的范围
	this.lists=Dom.$tagInNode('li', elmListW);//所有图片框的集合
	this.listsLen=this.lists.length;//图片总数
	var list_0=this.lists[0];//第一张图片
	var list_0_style=kStyle.getRealStyle(list_0);
	this.elmList=list_0.parentNode;//存放图片的ul, 滚动动画就是靠控制它的位置来实现的(滚动的整体)
	this.listSize=[
		this.lists[1].offsetLeft-this.lists[0].offsetLeft,
		list_0.offsetHeight+parseInt(list_0_style.marginTop)+parseInt(list_0_style.marginBottom)
	];//一个图片框的尺寸[width, height]
	if(this.elmList.offsetHeight<(2 * this.lists[0].offsetHeight)){//如果没有2 行，则返回
		//setTimeout(function(){me=null;},100); //此功能未测试,不知道是否能清空内存数据
		return false;
	}
	elmListW.style.width=elmListW.offsetWidth+'px';
	elmListW.style.position='relative';
	//var oh1=elmListW.offsetHeight;
	//elmListW.style.height=oh1+'px';
	//elmListW.style.height=(2*oh1-elmListW.offsetHeight)+'px';
	elmListW.style.overflow='hidden';//限制动画显示区域
	/*
	此处之前的代码与imageScroll_build 类似
	*/
	this.positionMax=this.listsLen*this.listSize[0];
	var numberPerPage=Math.floor((elmListW.offsetWidth + parseInt(list_0_style.marginRight))/this.listSize[0]);
	this.pages=Math.ceil(this.listsLen/numberPerPage);
	this.elmList.style.width=this.listsLen*this.listSize[0]+100+'px';
	var i;
	this.positions=[];
	for(i=0; i<this.pages; i++){
		this.positions[i]=0-this.lists[numberPerPage*i].offsetLeft;
		//console.log('position['+i+'] is: '+this.positions[i]);
	}
	this.elmList.style.position='relative';
	this.current=0;
	this.roundView=false;//可以循环浏览
	this.duration=1200;//每次翻页时间(ms)
	this.scrollTimer=null;
	this.nav={};//按钮，状态栏等
	/**
	更新按钮等
	*/
	var updateNav=function() {
		var i, link;
		for(i=0; (link=me.nav.link[i]); i++){
			link.className='';
		}
		me.nav.link[me.current].className='current';
		if(!me.roundView){
			if(me.current==0){
				Dom.addClass('p_off', me.nav.previous);
			}else{
				Dom.removeClass('p_off', me.nav.previous);
			}
			if(me.current==me.pages-1){
				Dom.addClass('n_off', me.nav.next);
			}else{
				Dom.removeClass('n_off', me.nav.next);
			}
		}
	};
	/**
	添加翻页按钮
	*/
	var addNavButtons=function() {
		var p=document.createElement('a'), n=p.cloneNode(true);
		n.href=p.href="javascript:;"//"#"+me.elmId;
		p.innerHTML="&lt;&lt;"
		n.innerHTML="&gt;&gt;"
		p.className="previous";
		n.className="next";
		// insert nodes after <div class="image_list_box">
		//console.log(me);
		me.elmRoot.appendChild(p);
		me.elmRoot.appendChild(n);
		p.style.top=n.style.top=(Dom.$tagHasClassInNode('div', 'image', list_0)[0].offsetHeight-p.offsetHeight)/2+'px';
		p.style.left=(0-p.offsetWidth/2+2)+'px';//这里的2 起修正作用，往右边移2 px
		n.style.left=(me.elmRoot.offsetWidth-n.offsetWidth/2-2)+'px';//这里的2 起修正作用，往左边移2 px
		n.style.right='auto';
		// add handlers
		p.onmousedown=me.scrollPrev_click;
		n.onmousedown=me.scrollNext_click;
		me.nav.previous=p
		me.nav.next=n;
		//n.relIPV=p.relIPV=this;
	};
	
	/**
	添加翻页状态条
	*/
	var addNavStatus=function(){
		function findElmInParent(elm, opt){
			elm=elm.parentNode;
			//console.log(elm);
			if((!elm) || (!opt) || ((!opt.tag) && (!opt.className) && (!opt.id))){return;}
			if(opt.tag && (elm.nodeName.toLowerCase()!=opt.tag.toLowerCase())){
				return findElmInParent(elm, opt);
			}
			if(opt.className && (!(Dom.hasClass(opt.className, elm)))){
				return findElmInParent(elm, opt);
			}
			if(opt.id && (!(elm.id && elm.id==opt.id))){
				return findElmInParent(elm, opt);
			}
			return elm;
		}
		var md=findElmInParent(me.elmRoot, {tag:'div', className:'md'});
		var md_hd = Dom.$tagHasClassInNode('div', 'md_hd', md)[0];
		md_hd.style.position='relative';
		var na=document.createElement('div');
		na.className='image_page_view_nav';
		na.style.visibility='hidden';
		me.nav.link=[];
		var LK=me.nav.link;
		function linkClick(ev){
			this.blur();
			if(me.scrollTimer!==null){
				return;
			}
			var v1, v2;
			v1=v2=0;
			var ito=this.getAttribute('i');
			v1=me.positions[me.current];
			me.current=ito;
			v2=me.positions[ito];
			if(v1!=v2){
				clearInterval(me.scrollTimer);
				me.scrollTimer=null;
				updateNav();
				movePic(me.scrollTimer, me.elmList, v1, v2, me.duration);
			}
			return false;
		};
		for(var i=0; i<me.pages; i++){
			var l=document.createElement('a');
			l.href="javascript:;"//+me.elmId;
			if(i==me.current){
				l.className='current';
			}
			l.setAttribute('i', i);
			l.onclick=linkClick;
			na.appendChild(l);
			LK.push(l);
		}
		na.style.left=(md_hd.offsetWidth-na.offsetWidth)/2+'px';
		na.style.top=(md_hd.offsetHeight-(Base.isIE()?13:8))/2+'px';
		na.style.visibility='visible';
		md_hd.appendChild(na);
	};
	
	this.init=function(){
		addNavButtons();
		addNavStatus();
		updateNav();
	};
	this.scrollPrev_click=function(){
		this.blur();
		if((this.className.indexOf('off')!=-1)||(me.scrollTimer!==null)){
			return false;
		}
		var v1, v2;
		v1=v2=0;
		if(me.current>0){
			v1=me.positions[me.current];
			me.current--;
			v2=me.positions[me.current];
		}else if(me.current==0){
			if(me.roundView){
				v1=me.positions[me.current];
				me.current=me.pages-1;
				v2=me.positions[me.current];
			}
		}
		if(v1!=v2){
			clearInterval(me.scrollTimer);
			me.scrollTimer=null;
			updateNav();
			movePic(me.scrollTimer, me.elmList, v1, v2, me.duration);
		}
		return false;
	};
	this.scrollNext_click=function(){
		this.blur();
		if((this.className.indexOf('off')!=-1)||(me.scrollTimer!==null)){
			return false;
		}
		var v1, v2;
		v1=v2=0;
		if(me.current<me.pages-1){
			v1=me.positions[me.current];
			me.current++;
			v2=me.positions[me.current];
		}else if(me.current==(me.pages-1)){
			if(me.roundView){
				v1=me.positions[me.current];
				me.current=0;
				v2=me.positions[me.current];
			}
		}
		if(v1!=v2){
			clearInterval(me.scrollTimer);
			me.scrollTimer=null;
			updateNav();
			movePic(me.scrollTimer, me.elmList, v1, v2, me.duration);
		}
		return false;
	};
	
	function movePic(timer, elm, v1, v2, duration, whenDone){
		//alert('start');
		clearInterval(me.scrollTimer);
		me.scrollTimer=null;
		var scrollStart=false;
		var startTime=null;
		me.scrollTimer=setInterval(scroll, 15);
		function scroll(){
			//alert(1);
			if(scrollStart){
				var now=new Date();
				var percent=parseFloat((now-startTime)/duration);
				var sl=Math.round(kAnimator.getPV(v1, v2, percent));
				if(percent<0.99999){
					try{
						elm.style.left=sl+'px';
					}catch(er){/*alert(er.name);*/}
					return;
				}else{
					elm.style.left=v2+'px';
					clearInterval(me.scrollTimer);
					me.scrollTimer=null;
					scrollStart=false;
					if(whenDone && (typeof whenDone=='function')){
						whenDone();
					}
					//alert('end');
				}
			}else{
				scrollStart=true;
				startTime=new Date();
			}
		}
	}
	this.init();
}
-->