// JavaScript Document

function g(o){return document.getElementById(o);}
function iFQTab(o,s,n){
for(var i=1;i<=s;i++){g(o+'t'+i).className='bbtc';g(o+'c'+i).className='undis';}g(o+'c'+n).className='dis';g(o+'t'+n).className='bbtb';
}

function changepicstyle(o,eve) {
	if(eve.offsetX <= o.clientWidth/2 ) {
		if( !o.style.cursor.match("pre") )
			o.style.cursor = "url("+"http://www.cnfq.com/images/cursor/pre.ani"+")";
		if( o.title != "点击跳到上一张" )
			o.title = "点击跳到上一张";
	}
	else if( !o.style.cursor.match("next") ){	
		o.style.cursor="url("+"http://www.cnfq.com/images/cursor/next.ani"+")";
		if( o.title != "点击跳到下一张" )
			o.title = "点击跳到下一张";
	}
	return;
}

function picwidth(o) {
	if(o.width>640 ) {
		o.width=640;
	}
	return;
}
function picopen(o) {
	window.open(o)
	return;
}

function gotopicpage(Csu,Isu,o,eve) {
	u = document.location.href
	aIsu = Isu + 1
	bIsu = Isu - 1
	if(eve.offsetX <= o.clientWidth/2){
		if (Isu == 1){
			ru = u.substring(u.lastIndexOf("."));
			window.location.href= u.replace(ru,"_" + Csu + ru);
		}else if(bIsu == 1){
			window.location.href=u.replace(u.substring(u.lastIndexOf("_")),u.substring(u.lastIndexOf(".")));
		}else{
			window.location.href=u.replace(u.substring(u.lastIndexOf("_")),"_" + bIsu + u.substring(u.lastIndexOf(".")));
		}
	}
	else{
		if (Csu == Isu){
			window.location.href=u.replace(u.substring(u.lastIndexOf("_")),u.substring(u.lastIndexOf(".")));
			return false;
		}else{
			if (Isu == 1){
				//alert(u.lastIndexOf("."));
				ru = u.substring(u.lastIndexOf("."));
				window.location.href= u.replace(ru,"_" + aIsu + ru);
			}else{
				window.location.href=u.replace(u.substring(u.lastIndexOf("_")),"_" + aIsu + u.substring(u.lastIndexOf(".")));
			}
		}
	}
	return;
}

function CheckPl(obj){
	if(obj.saytext.value==""){
		alert("您没什么话要说吗？");
		obj.saytext.focus();
		return false;
	}
	return true;
}