// JavaScript Document
function showAd(){
	var files = "",links = "",texts = "";
	for(i=1;i<picarr.length;i++){
		if(files=="") files = picarr[i];
		else files += "|"+picarr[i];
	}
	for(i=1;i<linkarr.length;i++){
		if(links=="") links = linkarr[i];
		else links += "|"+linkarr[i];
	}
	for(i=1;i<textarr.length;i++){
		if(texts=="") texts = textarr[i];
		else texts += "|"+textarr[i];
	}
	var swf_width=345;
	var swf_height=217;
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ swf_width +'" height="'+ swf_height +'">');
	document.write('<param name="movie" value="File/@style2009/Images/bcastr3.swf"><param name="quality" value="high">');
	document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
	document.write('<param name="FlashVars" value="bcastr_file='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'">');
	document.write('<embed src="File/@style2009/Images/bcastr3.swf" wmode="opaque" FlashVars="bcastr_file='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'& menu="false" quality="high" width="'+ swf_width +'" height="'+ swf_height +'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'); document.write('</object>'); 
}
var Ptr;
function $(){
		for (i=1;i<Ptr.length+1;i++){ 
		Ptr[i-1].className = (i%2>0)?"t1":"t2"; 
		}
}
function bindMouseOver(){
	Ptr=document.getElementById("tab").getElementsByTagName("li");
	$;
	for(var i=0;i<Ptr.length;i++){
		Ptr[i].onmouseover=function(){this.tmpClass=this.className;this.className = "t3";};
		Ptr[i].onmouseout=function(){this.className=this.tmpClass;};
	}
}
function openwin(obj) {
	var url=obj.options[obj.selectedIndex].value;
	if(url.length > 5){
		var newPage = window.open (url);
//		newPage.focus();
	}
}
function OpenPage(pageUrl,windowWidth,windowHeight){var reValue = window.showModalDialog(pageUrl,'pop','dialogWidth='+windowWidth+'px;dialogHeight='+ (windowHeight + 20) +'px;status=0;scroll=0;');return reValue;};function setHome(){var homePage=location.href;var i=homePage.indexOf('/',10);if(i!=-1)homePage=homePage.substring(0,i);setHomepage.style.behavior='url(#default#homepage)';setHomepage.sethomepage(homePage);};function addFavorite(){window.external.AddFavorite(location.href,document.title)};function checkLogin(form){if(form.UserName.value==''){alert('请输入用户名！');form.UserName.focus();return false;}else if(form.Password.value == ''){alert('请输入密码！');form.Password.focus();return false;}else{return true;}};function checkUser(form1,form2){if (form1.UserName.value==""){alert("请输入用户名！");form1.UserName.focus();return false;}else{form2.username.value=form1.UserName.value;form2.submit();}};function checkSearch(form){if(form.keyword.value.length == 0){alert('请输入关键词！');form.keyword.focus();}else if(form.searchtype.options[form.searchtype.selectedIndex].value.length == 0 || form.searchtype.options[form.searchtype.selectedIndex].value <= 0){alert('请选择搜索类型！');form.searchtype.focus();}else{return true;}return false;}function regDateControl(txtName){var oInput=document.getElementById(txtName);oInput.middleChar="-";oInput.selectIndex=1;oInput.maxLength=10;oInput.size=9;oInput.style.imeMode="disabled";oInput.onclick=specialText_ClickEvent;oInput.onkeydown=specialText_KeyDownEvent;oInput.onkeyup=specialText_KeyUpEvent;oInput.onfocus=function(){if(oInput.value=='')oInput.value=specialText_GetDate(oInput.middleChar);};oInput.onblur=function(){if(oInput.value=='')return false;specialText_validYear(this);specialText_validMonth(this);specialText_validDate(this);};oInput.oncontextmenu=function(){return false;};oInput.ondrop=function(){return false;}}function specialText_ClickEvent(){event.cancelBubble=true;var oRange=document.selection.createRange();var rngTxt=this.createTextRange();var flag=oRange.getBookmark();rngTxt.collapse();rngTxt.moveToBookmark(flag);rngTxt.moveStart('character',-this.value.length);if(rngTxt.text.length<=5)specialText_SelectYear(this);else if(rngTxt.text.length<=8)specialText_SelectMonth(this);else specialText_SelectDate(this);}function specialText_SelectYear(oInput){var oRange=oInput.createTextRange();oRange.moveStart("character",0);oRange.moveEnd("character",-6);oInput.selectIndex=1;oRange.select();}function specialText_SelectMonth(oInput){var oRange=oInput.createTextRange();oRange.moveStart("character",5);oRange.moveEnd("character",-3);oInput.selectIndex=2;oRange.select();}function specialText_SelectDate(oInput){var oRange=oInput.createTextRange();oRange.moveStart("character",8);oInput.selectIndex=3;oRange.select();}function specialText_validYear(oInput){var arrValue=oInput.value.split(oInput.middleChar);var strYear=arrValue[0];if(strYear.length==0)arrValue[0]="2000";else if(parseInt(strYear,10)==0)arrValue[0]=2000;else if(strYear.length < 4)arrValue[0]=2000 + parseInt(strYear,10);oInput.value=arrValue.join(oInput.middleChar);}function specialText_validMonth(oInput){var arrValue=oInput.value.split(oInput.middleChar);var strMonth=arrValue[1];if(strMonth.length==0)arrValue[1]="01";else if(parseInt(strMonth,10)==0)arrValue[1]="01";else if(parseInt(strMonth,10) > 12)arrValue[1]="12";else if(strMonth.length < 2)arrValue[1]="0" + strMonth;oInput.value=arrValue.join(oInput.middleChar);}function specialText_validDate(oInput){var arrValue=oInput.value.split(oInput.middleChar);var strYear=arrValue[0];var strMonth=arrValue[1];var strDate=arrValue[2];var intMonth=parseInt(strMonth,10);if(strDate.length==0)arrValue[2]="01";else if(parseInt(strDate,10)==0)arrValue[2]="01";else if(strDate.length < 2)arrValue[2]="0" + strDate;else{var monthMaxDates=specialText_getMonthDates(strYear,strMonth);if(parseInt(strDate,10) > monthMaxDates)arrValue[2]=monthMaxDates;}oInput.value=arrValue.join(oInput.middleChar);}function specialText_YearAdd(oInput,isMinus){var arrValue=oInput.value.split(oInput.middleChar);var strYear=arrValue[0];if(isMinus){arrValue[0]=parseInt(strYear,10) - 1;if(parseInt(arrValue[0],10) < 1)arrValue[0]="0001";}else arrValue[0]=parseInt(strYear,10) + 1;oInput.value=arrValue.join(oInput.middleChar);specialText_validYear(oInput);specialText_SelectYear(oInput);}function specialText_MonthAdd(oInput,isMinus){var arrValue=oInput.value.split(oInput.middleChar);var strMonth=arrValue[1];if(isMinus){arrValue[1]=parseInt(strMonth,10) - 1;if(parseInt(arrValue[1],10)==0)arrValue[1]="12";}else{arrValue[1]=parseInt(strMonth,10) + 1;if(parseInt(arrValue[1],10)==13)arrValue[1]="01";}oInput.value=arrValue.join(oInput.middleChar);specialText_validMonth(oInput);specialText_SelectMonth(oInput);}function specialText_DateAdd(oInput,isMinus){var arrValue=oInput.value.split(oInput.middleChar);var strYear=arrValue[0];var strMonth=arrValue[1];var strDate=arrValue[2];var monthMaxDates=specialText_getMonthDates(strYear,strMonth);if(isMinus){arrValue[2]=parseInt(strDate,10) - 1;if(parseInt(arrValue[2],10)==0)arrValue[2]=monthMaxDates;}else{arrValue[2]=parseInt(strDate,10) + 1;if(parseInt(arrValue[2],10)==(monthMaxDates + 1))arrValue[2]="01";}oInput.value=arrValue.join(oInput.middleChar);specialText_validDate(oInput);specialText_SelectDate(oInput);}function specialText_KeyUpEvent(){var keyCode=event.keyCode;if((keyCode >= 48 && keyCode <= 57)||(keyCode >= 96 && keyCode <= 105)){var oRange=document.selection.createRange();var rngTxt=this.createTextRange();var flag=oRange.getBookmark();rngTxt.collapse();rngTxt.moveToBookmark(flag);rngTxt.moveStart('character',-this.value.length);if(rngTxt.text.length==4){specialText_validYear(this);specialText_SelectMonth(this);}else if(rngTxt.text.length==7){specialText_validMonth(this);specialText_SelectDate(this);}}}function specialText_KeyDownEvent(){var keyCode=event.keyCode;if((keyCode >= 48 && keyCode <= 57)||(keyCode >= 96 && keyCode <= 105)){var oRange=document.selection.createRange();if(oRange.text.indexOf(this.middleChar)!=-1)event.returnValue=false;else event.returnValue=true;}else if(keyCode >= 37 && keyCode <= 40){event.returnValue=false;if(keyCode==37) {if(this.selectIndex==1){specialText_validYear(this);specialText_SelectDate(this);}else if(this.selectIndex==2){specialText_validMonth(this);specialText_SelectYear(this);}else if(this.selectIndex==3){specialText_validDate(this);specialText_SelectMonth(this);}}if(keyCode==39){if(this.selectIndex==1){specialText_validYear(this);specialText_SelectMonth(this);}else if(this.selectIndex==2){specialText_validMonth(this);specialText_SelectDate(this);}else if(this.selectIndex==3){specialText_validDate(this);specialText_SelectYear(this);}}if(keyCode==38){if(this.selectIndex==1){specialText_validYear(this);specialText_YearAdd(this,true);}else if(this.selectIndex==2){specialText_validMonth(this);specialText_MonthAdd(this,true);}else if(this.selectIndex==3){specialText_validDate(this);specialText_DateAdd(this,true);}}if(keyCode==40){if(this.selectIndex==1){specialText_validYear(this);specialText_YearAdd(this,false);}else if(this.selectIndex==2){specialText_validMonth(this);specialText_MonthAdd(this,false);}else if(this.selectIndex==3){specialText_validDate(this);specialText_DateAdd(this,false);}}}else if(keyCode==116||keyCode==9)event.returnValue=true;else if(keyCode==16||keyCode==17)return false;else if(keyCode==8||keyCode==46){this.value='';this.blur();}else{event.returnValue=false;event.keyCode=0;}}function specialText_GetDate(middleChar){var oDate=new Date();return oDate.getYear() + middleChar + (oDate.getMonth() < 10 ? ("0" + oDate.getMonth()) : oDate.getMonth()) + middleChar + (oDate.getDate() < 10 ? ("0" + oDate.getDate()) : oDate.getDate());}function specialText_getMonthDates(strYear,strMonth){var intMonth=parseInt(strMonth,10);if(intMonth==1||intMonth==3||intMonth==5||intMonth==7||intMonth==8||intMonth==10||intMonth==12)return 31;else if(intMonth==4||intMonth==6||intMonth==9||intMonth==11)return 30;else{var intYear=parseInt(strYear,10);if((intYear % 4==0 && intYear % 100!=0)||(intYear % 100==0 && intYear % 400==0))return 29;else return 28;}}
stuHover = function(){var cssRule;var newSelector;for (var i = 0;i < document.styleSheets.length;i++)for (var x = 0;x < document.styleSheets[i].rules.length ;x++){cssRule = document.styleSheets[i].rules[x];if (cssRule.selectorText.indexOf("LI:hover") != -1){newSelector = cssRule.selectorText.replace(/LI:hover/gi, "LI.iehover");document.styleSheets[i].addRule(newSelector , cssRule.style.cssText);}}var getElm = document.getElementById("nav").getElementsByTagName("LI");for (var i=0;i<getElm.length;i++){getElm[i].onmouseover=function(){this.className+=" iehover";};getElm[i].onmouseout=function(){this.className=this.className.replace(new RegExp(" iehover\\b"), "");}}};if (window.attachEvent){window.attachEvent("onload", stuHover);}
window.onload=function(){regDateControl('starDate');regDateControl('endDate');}
