// JavaScript Document
$(function(){
	$().ajaxStart($.blockUI).ajaxStop($.unblockUI);
});

//flash幻灯广告
var getFlashAdvs = function(xml,w,h,ofocus){
	var focus_width=w; //图片框的宽度 
	var focus_height=h; //图片框的高度 
	
	html = "";
	html += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" '
	html += ' codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"';
	html += ' width="'+ focus_width +'" height="'+ focus_height +'">'; 
	html += '<param name="allowscriptAccess" value="sameDomain"><param name="movie" value="'+ofocus+'">';
	html += '<param name="quality" value="high"><param name="bgcolor" value="#F2F2F2">'; 
	html += '<param name="menu" value="false"><param name=wmode value="opaque">'; 
	html += '<param name="FlashVars" value="bcastr_xml_url='+xml+'">'; 
	html += '<embed src="'+ofocus+'" wmode="opaque" FlashVars="bcastr_xml_url='+xml+'" menu="false"';
	html += ' bgcolor="#F2F2F2" quality="high" width="'+ focus_width +'" height="'+ focus_height +'"'
	html += 'allowscriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
	return html;
}
//FLASH播放javascript
function getFlash(setWidth,setHeight,setUrl){
	if(parseInt(setHeight)<1){
		setHeight = "100%";	
	}
	if(parseInt(setWidth)<1){
		setWidth = "100%";	
	}
	document.write('<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='+setWidth+' height='+setHeight+'>')
	document.write('<param name="movie" value='+setUrl+'>')
	document.write('<param name="quality" value="high">')
	document.write('<param name="wmode" value="transparent" /> ')
	document.write('<embed src='+setUrl+' quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width='+setWidth+' height='+setHeight+' wmode="transparent"></embed></object>')
}
//菜单切换
function nTabs(tabObj,obj){
	var tabList = document.getElementById(tabObj).getElementsByTagName("li");
	for(i=0; i <tabList.length; i++){
		if (tabList[i].id == obj.id){
			document.getElementById(tabObj+"_te_"+i).className = "sli"; 
    		document.getElementById(tabObj+"_co_"+i).style.display = "block";
		}else{
			document.getElementById(tabObj+"_te_"+i).className = ""; 
			document.getElementById(tabObj+"_co_"+i).style.display = "none";
		}
	} 
}
//清空FORM表单中的内容
var s = function(){
	var count = document.getElementsByTagName("form").length;
	for (i=0;i<count;i++){
		document.forms[i].reset()
	}
}

function pageSubmit(){
	var d = document.login;
	username = d.username.value;
	password = d.password.value;
	if(username.length<3||username.length>20){
		alert("请输入正确的用户名！");
		d.username.focus();
		return false;
	}
						
	if(password.length<3||password.length>20){
		alert("请输入正确的用户密码！");
		d.password.focus();
		return false;
	}
						
	d.submit();
}