function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function login()	 {
	if (document.frmLogin.UserName.value=='')
	{
		alert('请输入用户名！');
		return false;
	}else if (document.frmLogin.PassWord.value=='')
	{
		alert('请输入密码！');
		return false;
	}else	{
		return true;
	}
}

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 checkName()	{
	if (document.form_pl.username.value=='')
	{
		alert('请输入您的姓名！');
	}else if(document.form_pl.content.value=='')	{
		alert('请输入评论内容！');
	}else	{
		document.form_pl.btnSubmit.disabled=true;
		document.form_pl.submit();
	}
}

function search_news()	{
	if (document.search_form_news.keyword.value=='')
	{
		alert('请输入搜索关键字！');
	}else if (document.search_form_news.search_range.value=='')
	{
		alert('请选择搜索范围！');
	}else{
		document.search_form_news.submit();
	}
}

function feedback()	{
	txt=document.feedback.yourEmail.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.feedback.submit();
	}
}

function set_index()	 {
	this.style.behavior="url(#default#homepage)";this.setHomePage("http://www.itnetbuy.com")
}

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()",20);
}

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");
	}
	var oTextRange=document.selection.createRange();
}

//鼠标滚轮缩放图片，用法<img src='xxx' onmousewheel="return bbimg(this)" >
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 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 ;
}