function do_zoom(size)
{
	document.getElementById('zoom').style.fontSize	=	size+'px';
}

function check_login()
{
	if (document.login.user_name.value=='')
	{
		alert('请输入用户名！')	 ;
		document.login.user_name.focus()	;
	}else
	{
		if (document.login.user_pwpd.value=='')
		{
			alert('请输入密码！')	 ;
			document.login.user_pwd.focus()	;
		}else
		{
			return true	;
		}
	}

	return false	;
}

var xml_obj	= null	;
var xml_obj2	=	null	;
var str ;
var chg ;
var pos ;

function get_xml_object()
{
	is_ie	=	(document.all) ? true : false	;

	if (xml_obj==null)
	{

		if (is_ie)
		{
			xml_obj	=	new ActiveXObject("Microsoft.XMLHTTP")	;
		}else
		{
			xml_obj	=	new XMLHttpRequest()	;
		}
	}else
	{
		if (is_ie)
		{
			xml_obj2	=	new ActiveXObject("Microsoft.XMLHTTP")	;
		}else
		{
			xml_obj2	=	new XMLHttpRequest()	;
		}
	}

}//-- end of functions `get_xml_object`

function gogogo(page)
{
	pg	=	parseInt(document.getElementById('mypg').value)	;
	
	if (pg>0)
	{
		window.location	=	page+'?pg='+pg;
	}
}


// common functions
function MM_openBrWindow(theURL,winName,features) 
{
  window.open(theURL,winName,features);
}

// Scale Image's size while mouse wheeling
function bbimg(o)
{
	var zoom=parseInt(o.style.zoom, 10)||100;
	zoom+=event.wheelDelta/12;
	if (zoom>0) o.style.zoom=zoom+'%';
	return false;
}


function set_index(website_url)	 
{
	var strHref=window.location.href;
	this.style.behavior='url(#default#homepage)';
	this.setHomePage('http://'+website_url);
}

function doZoom(size)
{
	document.getElementById('zoom').style.fontSize=size+'px'
	setTailPosition()
}

function bookmark_it()
{
	if ( document.all )
	{
		window.external.AddFavorite(window.document.location,window.document.title);
	}
}

function tuijian() {
txt=document.mail_page.email.value;
if (txt.indexOf("@")<3)
{ 
	alert("邮件地址必须包含@'");
}else if ((txt.indexOf(".com")<5)&&(txt.indexOf(".org")<5)
	&&(txt.indexOf(".gov")<5)&&(txt.indexOf(".net")<5)
	&&(txt.indexOf(".mil")<5))
	{
		alert("邮件地址"
		+"必须包含"
		+".com,.net,.org,.gov,.mil");
	}else{
		document.mail_page.submit();
	}

}


function setBarPosition()
{
	document.getElementById('toolBar').style.top=0
	document.getElementById('toolBar').style.left=613
	document.getElementById('toolBar').style.display='block'
}

function setTailPosition(){

}

//鼠标双击滚屏开始
var currentpos,timer;

function initialize()
{
	timer=setInterval("scrollwindow()",50);
}

function sc(){
	clearInterval(timer);
}

function scrollwindow()
{
	currentpos=document.body.scrollTop;
	window.scroll(0,++currentpos);
	if (currentpos != document.body.scrollTop)
	sc();
}
document.onmousedown=sc
document.ondblclick=initialize
//鼠标双击滚屏结束

//页面最小化
function min_page()
{

	window.blur();

}

//页面最大化
function max_page()
{

	self.moveTo(0,0)
	self.resizeTo(screen.availWidth,screen.availHeight)

}

//选择全部
function select_all()
{
	var zoom=document.all("zoom");
	var oTextRange=document.body.createTextRange();
	with (oTextRange) {
	moveToElementText(zoom);
	execCommand("SelectAll");
	execCommand("Copy");
	}
	var oTextRange=document.selection.createRange();
	alert('内容已经成功复制到剪贴板，您可以试用Ctrl+V将内容粘贴到需要的地方。');
}


function vote_submit(vote_flag)
{
	vote_form.vote_flag.value=vote_flag;
	window.open('','vote','scrollbars=yes,status=no,width=420,height=340');
	vote_form.submit();
}


function link_jump(targ,selObj,restore)
{ //v3.0
	 if(selObj.options[selObj.selectedIndex].value)
	 { 
	 window.open(selObj.options[selObj.selectedIndex].value,'new','');
	 }
}



	function setPointer(theRow, thePointerColor)
	{
	    if (typeof(theRow.style) == 'undefined' || typeof(theRow.cells) == 'undefined') {
	        return false;
	    }
	
	    var row_cells_cnt           = theRow.cells.length;
	    for (var c = 0; c < row_cells_cnt; c++) {
	        theRow.cells[c].bgColor = thePointerColor;
	    }
	
	    return true;
	} // end of the 'setPointer()' function


//title特效开始
//***********默认设置定义.*********************

var sPop = null;
var postSubmited = false;

document.write("<style type='text/css'id='defaultPopStyle'>");
document.write(".cPopText { font-family: Verdana, Tahoma; background-color: #DDEEFF; border: 1px #8899AA dashed; font-size: 12px; padding-right: 4px; padding-left: 4px; height: 20px; padding-top: 2px; padding-bottom: 2px; visibility: hidden; filter: Alpha(Opacity=80)}");

document.write("</style>");
document.write("<div id='popLayer' style='position:absolute;z-index:1000;' class='cPopText'></div>");


function showPopupText() {
	var o=event.srcElement;
	MouseX=event.x;
	MouseY=event.y;
	if(o.alt!=null && o.alt!="") { o.pop=o.alt;o.alt="" }
        if(o.title!=null && o.title!=""){ o.pop=o.title;o.title="" }
	if(o.pop!=sPop) {
		sPop=o.pop;
		if(sPop==null || sPop=="") {
			popLayer.style.visibility="hidden";	
		} else {
			if(o.dyclass!=null) popStyle=o.dyclass 
			else popStyle="cPopText";
			popLayer.style.visibility="visible";
			showIt();
		}
	}
}

function showIt() {
	popLayer.className=popStyle;
	popLayer.innerHTML=sPop.replace(/<(.*)>/g,"&lt;$1&gt;").replace(/\n/g,"<br>");;
	popWidth=popLayer.clientWidth;
	popHeight=popLayer.clientHeight;
	if(MouseX+12+popWidth>document.body.clientWidth) popLeftAdjust=-popWidth-24
		else popLeftAdjust=0;
	if(MouseY+12+popHeight>document.body.clientHeight) popTopAdjust=-popHeight-24
		else popTopAdjust=0;
	popLayer.style.left=MouseX+12+document.body.scrollLeft+popLeftAdjust;
	popLayer.style.top=MouseY+12+document.body.scrollTop+popTopAdjust;
}

function ctlent(obj) {
	if(postSubmited == false && (event.ctrlKey && window.event.keyCode == 13) || (event.altKey && window.event.keyCode == 83)) {
		if(this.document.input.pmsubmit) {
			postSubmited = true;
			this.document.input.pmsubmit.disabled = true;
			this.document.input.submit();
		} else if(validate(this.document.input)) {
			postSubmited = true;
			if(this.document.input.topicsubmit) this.document.input.topicsubmit.disabled = true;
			if(this.document.input.replysubmit) this.document.input.replysubmit.disabled = true;
			if(this.document.input.editsubmit) this.document.input.editsubmit.disabled = true;
			this.document.input.submit();
		}
	}
}
function checkall(form, prefix) {
	for(var i = 0; i < form.elements.length; i++) {
		var e = form.elements[i];
		if(e.name != 'chkall' && (!prefix || (prefix && e.name.match(prefix)))) {
			e.checked = form.chkall.checked;
		}
	}
}

function findobj(n, d) {
	var p,i,x; if(!d) d=document;
	if((p=n.indexOf("?"))>0 && parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document;
		n=n.substring(0,p);
	}
	if(!(x=d[n])&&d.all) x=d.all[n];
	for(i=0;!x && i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x && d.layers&&i>d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	return x;
}

function copycode(obj) {
	var rng = document.body.createTextRange();
	rng.moveToElementText(obj);
	rng.scrollIntoView();
	rng.select();
	rng.execCommand("Copy");
	rng.collapse(false);
}

document.onmouseover=showPopupText;

		function setFrameRows(rowstr){
			if (typeof(parent.frmright)!="undefined"){
		 		if (typeof(parent.frmright.frmMain)!="undefined") {
						parent.frmright.frmMain.rows=rowstr //"*,220"
				}
			}
		}

function switchSysBar(){
if (switchPoint.innerText==4){
switchPoint.innerText=3
document.all("frmTitle").style.display="none"
}else{
switchPoint.innerText=4	
document.all("frmTitle").style.display=""
}}

function FCKeditor_OnComplete( editorInstance )
{
	var oCombo = document.getElementById( 'cmbLanguages' ) ;
	for ( code in editorInstance.Language.AvailableLanguages )
	{
		AddComboOption( oCombo, editorInstance.Language.AvailableLanguages[code] + ' (' + code + ')', code ) ;
	}
	oCombo.value = editorInstance.Language.ActiveLanguage.Code ;
}	

function AddComboOption(combo, optionText, optionValue)
{
	var oOption = document.createElement("OPTION") ;

	combo.options.add(oOption) ;

	oOption.innerHTML = optionText ;
	oOption.value     = optionValue ;
	
	return oOption ;
}

function ChangeLanguage( languageCode )
{
	window.location.href = window.location.pathname + "?Lang=" + languageCode ;
}

//	前台图片相关js

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function copyText(obj) {
ie = (document.all)? true:false
if (ie){
var rng = document.body.createTextRange();
rng.moveToElementText(obj);
rng.scrollIntoView();
rng.select();
rng.execCommand("Copy");
rng.collapse(false);
}
}

function kill_errors() {
return true;
}

window.onerror = kill_errors;

if (window.Event) 
  document.captureEvents(Event.MOUSEUP); 
 
function nocontextmenu() 
{
 event.cancelBubble = true
 event.returnValue = false;
 
 return false;
}
 
function norightclick(e) 
{
 if (window.Event) 
 {
  if (e.which == 2 || e.which == 3)
   return false;
 }
 else
  if (event.button == 2 || event.button == 3)
  {
   event.cancelBubble = true
   event.returnValue = false;
   return false;
  }
 
}
 
document.oncontextmenu = nocontextmenu;  // for IE5+
//document.onmousedown = norightclick;  // for all others
document.onkeydown=keydown()	;

function keydown()
{ 
	if( (window.event.ctrlKey&&event.keyCode == 78) || event.button==2)
    return false;
  else
    return true;
}
