if (top.location !== self.location) {
 top.location=self.location;
}
try{
    tophref=top.location.href.toLowerCase();
    thishref=this.location.href.toLowerCase();
}catch(e){};
if(this != top && tophref!=null && tophref.indexOf("localhost") < 0 || thishref!=null && thishref.indexOf("localhost") < 0){
    try{    if(this != top && top.location.href.toLowerCase().indexOf("txsm.com") < 0 && top.location.href.toLowerCase().indexOf("txnsg.com") < 0 && top.location.href.toLowerCase().indexOf("mmbook.com") < 0 && top.location.href.toLowerCase().indexOf("fbook.net") < 0) top.location.href="http://www.fbook.net";}catch(e){};
    if (this.location.href.toLowerCase().indexOf("txsm.com") < 0 && top.location.href.toLowerCase().indexOf("fbook.net") < 0 && top.location.href.toLowerCase().indexOf("mmbook.com") < 0 && top.location.href.toLowerCase().indexOf("txnsg.com") < 0) {  
top.location.href = "http://www.txnsg.com"
 }
}
function fucCheckNUM(NUM){
	var i,j,strTemp; 
	strTemp="0123456789"; 
	if(NUM.length==0) 
	return 0 
	for(i=0;i<NUM.length;i++){ 
		j=strTemp.indexOf(NUM.charAt(i)); 
		if(j==-1){
			return 0; 
		}
	} 
	return 1; 
}

function onlogin_bg(id){
	document.getElementById(id).className="login_FormFocus";
	document.getElementById(id).style.background="";
}

function setCookie(cookieName,cookieValue){
  var today = new Date();
  var expire = new Date();
  expire.setTime(today.getTime() + 3600000 * 356 * 24);
  document.cookie = cookieName+'='+escape(cookieValue)+ ";path= / ;"; 
}
function setCookies(cookieName,cookieValue){
  var today = new Date();
  var expire = new Date();
  expire.setTime(today.getTime() + 3600000 * 356 * 24);
  document.cookie = cookieName+'='+escape(cookieValue)+ ';expires = '+expire.toGMTString() + ";path= / ;"; 
}

function getCookie(cookieName){
	var theCookie=''+document.cookie;
	var ind=theCookie.indexOf(cookieName);
	if (ind==-1 || cookieName=='') return ''; 
	var ind1=theCookie.indexOf(';',ind);
	if (ind1==-1) ind1=theCookie.length;
	return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
}

function arouseFocus(varname){
	document.getElementById(varname).focus();  
}
function requestURL(string){
	var url = decodeURI(location.href);
	var url = url.toLowerCase();
	string = string.toLowerCase();
	if(url.indexOf(string)<1) return false;
	var urlA = url.split(string + "=");
	if(urlA[1].indexOf("&") >= 0){
		var urlB = urlA[1].split("&");
		return urlB[0];
	}else{
		var urlB = urlA[1];
		return urlB;
	}
}
function bookFavorites(x,y){
	if(x.length>0){
		x = "http://www.txnsg.com/bookintro/"+x+".htm";
		var title = bookname + " - 天下女生阁,小说阅读,玄幻小说,网游小说,武侠小说,言情小说,小说下载";
	}else if(x==""){
		x = location.href;
		var title = "天下女生阁,小说阅读,玄幻小说,网游小说,武侠小说,言情小说,小说下载";
	}
	switch(y){
		case "favorites":
			window.external.AddFavorite(x,title)
			break;
		case "default":
			document.body.style.behavior='url(#default#homepage)';
			document.body.setHomePage(x);
		break;
	}
}
function readNode(bookid,articleid){
	if(bookid!="" && articleid!=""){
		window.open("/vip/vipRead.asp?articleid="+articleid+"&bookid="+bookid);
	}
}
function readvip_baoyue(bookid){
	if(bookid!=""){
		window.open("/baoyue_vip/vipRead.asp?bookid="+bookid);
	}
}
function addRack(){
	window.open("/shareadd.asp?bookid="+bookid)	
}
function addRacks(strs1){
	window.open("/shareadd.asp?bookid="+strs1)
}
function readAll(){
	window.open("http://readall.fbook.net/"+bookid+".htm")	
}
var menuTimer =null;
function showmenu(state){
	
	var obj1 = "downbookBut"
	var obj2 = "downbookMenu"
	var location = "bottom";
	
    var btn=document.getElementById(obj1);
    var obj=document.getElementById(obj2);
    var h=btn.offsetHeight;
    var w=btn.offsetWidth;
    var x=btn.offsetLeft;
    var y=btn.offsetTop;
    obj.onmouseover =function(){
        showmenu(obj1,obj2,'show',location);
    }
    obj.onmouseout =function(){
        showmenu(obj1,obj2,'hide',location);
    }
    while(btn=btn.offsetParent){y+=btn.offsetTop;x+=btn.offsetLeft;}
    var hh=obj.offsetHeight;
    var ww=obj.offsetWidth;
    var xx=obj.offsetLeft;//style.left;
    var yy=obj.offsetTop;//style.top;
    var obj2state=state.toLowerCase();
    var obj2location=location.toLowerCase();
    var showx,showy;
    if(obj2location=="left" || obj2location=="l" || obj2location=="top" || obj2location=="t" || obj2location=="u" || obj2location=="b" || obj2location=="r" || obj2location=="up" || obj2location=="right" || obj2location=="bottom"){
        if(obj2location=="left" || obj2location=="l"){showx=x-ww;showy=y;}
        if(obj2location=="top" || obj2location=="t" || obj2location=="u"){showx=x;showy=y-hh;}
        if(obj2location=="right" || obj2location=="r"){showx=x+w;showy=y;}
        if(obj2location=="bottom" || obj2location=="b"){showx=x;showy=y+h;}
    }else{ 
        showx=xx;showy=yy;
    }
    obj.style.left=showx+"px";
    obj.style.top=showy+1+"px";
    if(state =="hide"){
		//hiddenmenu()
        menuTimer =setTimeout("hiddenmenu()", 500);
    }else{
        clearTimeout(menuTimer);
        obj.style.visibility ="visible";
    }
}
function hiddenmenu(){
    document.getElementById("downbookMenu").style.visibility ="hidden";
}
function downBook(){}
function readChapter(bookid,chapterid){
	window.open("/read/readChapter.asp?bookid="+bookid+"&chapterid="+chapterid);
}
document.write('<script src="http://pstatic.xunlei.com/js/webThunderDetect.js"></script><script src="http://pstatic.xunlei.com/js/base64.js"></script>');
