Commits

Anton Afanasyev  committed a188a10

spaces to tabs

  • Participants
  • Parent commits 2b29e01
  • Branches extended

Comments (0)

Files changed (1)

File autopagerize.user.js

 var leftMouseDown = false;
 var mouseHoldingEnabled = GetMouseHoldingStatus();
 function mdown(e) {
-    if(!mouseHoldingEnabled)
-        return;
+	if(!mouseHoldingEnabled)
+		return;
 
-    if(e.button == MBTN_LEFT) {
-        leftMouseDown=true;
-    }
+	if(e.button == MBTN_LEFT) {
+		leftMouseDown=true;
+	}
 }
 
 function mup(e) {
-    if(!mouseHoldingEnabled)
-        return;
+	if(!mouseHoldingEnabled)
+		return;
 
-    if(e.button == MBTN_LEFT) {
-        leftMouseDown=false;
-        if(ap && ap.scroll)
-            ap.scroll();
-    }
+	if(e.button == MBTN_LEFT) {
+		leftMouseDown=false;
+		if(ap && ap.scroll)
+			ap.scroll();
+	}
 }
 
 document.addEventListener('mousedown', mdown, false);
 document.addEventListener('mouseup', mup, false);
 
 function enableMouseHolding( status ) {
-    status = !(status == false);
-    if( !status )
-        mup( { button: MBTN_LEFT } );
+	status = !(status == false);
+	if( !status )
+		mup( { button: MBTN_LEFT } );
 
-    mouseHoldingEnabled = status;
-    GM_setValue( 'EnableMouseHolding', mouseHoldingEnabled );
+	mouseHoldingEnabled = status;
+	GM_setValue( 'EnableMouseHolding', mouseHoldingEnabled );
 };
 function GetMouseHoldingStatus() {
-    return GM_getValue( 'EnableMouseHolding' ) != false;
+	return GM_getValue( 'EnableMouseHolding' ) != false;
 }
 
 
 var XHR_TIMEOUT = 30 * 1000;
 // URLs where to take the configs from
 var SITEINFO_IMPORT_URLS = [
-    {
-        name:   'AA',
-        guid:   '35dcc84a-a774-4ff5-8f96-0f0991dcbb47', // any guid will work, so long as they remain constant for the url.
-        url:    'http://home.aa-fam.com/useful/userscripts/autopagerize/items.json',
-        expire: 24 * 60 * 60 * 1000, // daily
-    },
-    {
-        name:   'AutoPager rules',
-        guid:   'ddf24a5a-e7e4-405f-8095-4f66f582e389',
-        url:    'http://rep.teesoft.info/autopager/json',
-        expire: 24 * 60 * 60 * 1000, // daily
-    },
-    {
-        name:   'AutoPagerize rules',
-        guid:   '4d93e476-2e07-40ef-a30e-d8983ea3ae9c',
-        url:    'http://wedata.net/databases/AutoPagerize/items.json',
-        expire: 24 * 60 * 60 * 1000, // daily
-    }
+	{
+		name:   'AA',
+		guid:   '35dcc84a-a774-4ff5-8f96-0f0991dcbb47', // any guid will work, so long as they remain constant for the url.
+		url:    'http://home.aa-fam.com/useful/userscripts/autopagerize/items.json',
+		expire: 24 * 60 * 60 * 1000, // daily
+	},
+	{
+		name:   'AutoPager rules',
+		guid:   'ddf24a5a-e7e4-405f-8095-4f66f582e389',
+		url:    'http://rep.teesoft.info/autopager/json',
+		expire: 24 * 60 * 60 * 1000, // daily
+	},
+	{
+		name:   'AutoPagerize rules',
+		guid:   '4d93e476-2e07-40ef-a30e-d8983ea3ae9c',
+		url:    'http://wedata.net/databases/AutoPagerize/items.json',
+		expire: 24 * 60 * 60 * 1000, // daily
+	}
 ];
 
 // colors for the status indicator
 var COLOR = {
-    on: '#0f0',
-    off: '#ccc',
-    loading: '#0ff',
-    terminated: '#00f',
-    error: '#f0f'
+	on: '#0f0',
+	off: '#ccc',
+	loading: '#0ff',
+	terminated: '#00f',
+	error: '#f0f'
 }
 var SITEINFO = [
 ];
 var MICROFORMAT = {
-    url:          '.*',
-    nextLink:    '//a[@rel="next"] | //link[@rel="next"]',
-    insertBefore: '//*[contains(@class, "autopagerize_insert_before")]',
-    pageElement:  '//*[contains(@class, "autopagerize_page_element")]',
+	url:          '.*',
+	nextLink:    '//a[@rel="next"] | //link[@rel="next"]',
+	insertBefore: '//*[contains(@class, "autopagerize_insert_before")]',
+	pageElement:  '//*[contains(@class, "autopagerize_page_element")]',
 };
 
 var AutoPager = function(info) {
-    this.info = info;
-    if( AUTO_START ) {
-        this.state = getEternalPausePreference( document.location.host ) ? 'disable' : 'enable';
-    } else {
-        this.state = 'disable'
-    }
-    this.shouldLoadAll = false;
-    var self = this;
+	this.info = info;
+	if( AUTO_START ) {
+		this.state = getEternalPausePreference( document.location.host ) ? 'disable' : 'enable';
+	} else {
+		this.state = 'disable'
+	}
+	this.shouldLoadAll = false;
+	var self = this;
 
-    // get next page url
-    var url = getNextURL(info.nextLink, document, location.href);
-    if (!url) {
-        debug("getNextURL returns null.", info.nextLink);
-        return;
-    }
-    
-    // if we have an XPath for the element before which to insert the new page, find it
-    if (info.insertBefore)
-        this.insertPoint = getFirstElementByXPath(info.insertBefore);
+	// get next page url
+	var url = getNextURL(info.nextLink, document, location.href);
+	if (!url) {
+		debug("getNextURL returns null.", info.nextLink);
+		return;
+	}
+	
+	// if we have an XPath for the element before which to insert the new page, find it
+	if (info.insertBefore)
+		this.insertPoint = getFirstElementByXPath(info.insertBefore);
 
-    // dont have an elem before which to insert (either none defined, or it wasnt found)
-    if (!this.insertPoint) {
-        var lastPageElement = this.getPageElements();
-        if(lastPageElement)
-            lastPageElement = lastPageElement.pop();
-        
-        if (lastPageElement) {
-            try {
-                this.insertPoint = getFirstElementByXPath('following-sibling::node()', lastPageElement);
-            } catch(e) {
-                debug('couldnt get "following-sibling::node()" via xpath for ' + lastPageElement);
-            }
+	// dont have an elem before which to insert (either none defined, or it wasnt found)
+	if (!this.insertPoint) {
+		var lastPageElement = this.getPageElements();
+		if(lastPageElement)
+			lastPageElement = lastPageElement.pop();
+		
+		if (lastPageElement) {
+			try {
+				this.insertPoint = getFirstElementByXPath('following-sibling::node()', lastPageElement);
+			} catch(e) {
+				debug('couldnt get "following-sibling::node()" via xpath for ' + lastPageElement);
+			}
 
-            if (!this.insertPoint)
-                this.insertPoint = lastPageElement.nextSibling || lastPageElement.parentNode.appendChild(document.createTextNode(' '));
-        }
-    }
+			if (!this.insertPoint)
+				this.insertPoint = lastPageElement.nextSibling || lastPageElement.parentNode.appendChild(document.createTextNode(' '));
+		}
+	}
 
-    if (!this.insertPoint) {
-        debug("insertPoint not found.", lastPageElement, info.pageElement);
-        return;
-    }
+	if (!this.insertPoint) {
+		debug("insertPoint not found.", lastPageElement, info.pageElement);
+		return;
+	}
 
-    
-    // AA
-    var nc = info.noCues;
-    if(!(true==nc))
-        nc = false;
-    this.noCues = nc;
+	
+	// AA
+	var nc = info.noCues;
+	if(!(true==nc))
+		nc = false;
+	this.noCues = nc;
 
-    // AA
-    var cr = info.replace;
-    if(!(true==cr))
-        cr = false;
-    this.completeReplace = cr;
-    this.toBeRemoved = null; // for complete-replace functionality
-    this.forceForce = false;
+	// AA
+	var cr = info.replace;
+	if(!(true==cr))
+		cr = false;
+	this.completeReplace = cr;
+	this.toBeRemoved = null; // for complete-replace functionality
+	this.forceForce = false;
 
-    this.requestURL = url;
-    this.loadedURLs = {};
-    this.loadedURLs[location.href] = true;
-    var toggle = function() { self.stateToggle(); };
-    this.toggle = toggle;
-    GM_registerMenuCommand('AutoPagerize - on/off', toggle);
-    this.scroll= function() { self.onScroll(); };
-    window.addEventListener("scroll", this.scroll, false);
+	this.requestURL = url;
+	this.loadedURLs = {};
+	this.loadedURLs[location.href] = true;
+	var toggle = function() { self.stateToggle(); };
+	this.toggle = toggle;
+	GM_registerMenuCommand('AutoPagerize - on/off', toggle);
+	this.scroll= function() { self.onScroll(); };
+	window.addEventListener("scroll", this.scroll, false);
 
-    this.initIcon();
-    this.initHelp();
-    this.icon.addEventListener("mouseover", function() { self.viewHelp(); }, true);
+	this.initIcon();
+	this.initHelp();
+	this.icon.addEventListener("mouseover", function() { self.viewHelp(); }, true);
 
-    // AA
-    var aLA = null;
-    try {
-        aLA = info.alwaysLoadAll;
-    } catch(e) {}
-    if(null == aLA) {
-        aLA = false;
-    }
-    this.shouldLoadAll = aLA;
-        
-    // AA
-    var rH = null;
-    try {
-        rH = info.remainHeight;
-    } catch(e) {}
-    if(null == rH || rH.toString() == 'NaN')
-        rH = 0;
+	// AA
+	var aLA = null;
+	try {
+		aLA = info.alwaysLoadAll;
+	} catch(e) {}
+	if(null == aLA) {
+		aLA = false;
+	}
+	this.shouldLoadAll = aLA;
+		
+	// AA
+	var rH = null;
+	try {
+		rH = info.remainHeight;
+	} catch(e) {}
+	if(null == rH || rH.toString() == 'NaN')
+		rH = 0;
 
-    var scrollHeight = getScrollHeight();
-    var bottom = getElementPosition(this.insertPoint).top || this.getPageElementsBottom() || (Math.round(scrollHeight * 0.8));
-    this.remainHeight = scrollHeight - bottom + BASE_REMAIN_HEIGHT + rH;
+	var scrollHeight = getScrollHeight();
+	var bottom = getElementPosition(this.insertPoint).top || this.getPageElementsBottom() || (Math.round(scrollHeight * 0.8));
+	this.remainHeight = scrollHeight - bottom + BASE_REMAIN_HEIGHT + rH;
 
-    var that = this;
-    document.addEventListener('AutoPagerizeToggleRequest', function() { that.toggle(); }, false);
-    document.addEventListener('AutoPagerizeUpdateIconRequest', function() { that.updateIcon(); }, false);
-    that.updateIcon();
-    
-    if( this.info.startPaused )
-        this.stateToggle();
+	var that = this;
+	document.addEventListener('AutoPagerizeToggleRequest', function() { that.toggle(); }, false);
+	document.addEventListener('AutoPagerizeUpdateIconRequest', function() { that.updateIcon(); }, false);
+	that.updateIcon();
+	
+	if( this.info.startPaused )
+		this.stateToggle();
 
-    if (this.shouldLoadAll) {
-        this.request()
-    } else {
-        this.onScroll()
-    }
+	if (this.shouldLoadAll) {
+		this.request()
+	} else {
+		this.onScroll()
+	}
 }
 
 AutoPager.prototype.getPageElements = function(doc) {
-    doc = doc || document;
-    var elems;
+	doc = doc || document;
+	var elems;
 
-    var f = this.info.pageElement;
-    if( typeof( f ) == 'function' )
-        elems = f( doc );
-    else
-        elems = getElementsByXPath( f, doc );
-    
-    return elems;
+	var f = this.info.pageElement;
+	if( typeof( f ) == 'function' )
+		elems = f( doc );
+	else
+		elems = getElementsByXPath( f, doc );
+	
+	return elems;
 }
 
 AutoPager.prototype.loadAll = function() {
-    this.shouldLoadAll = true;
-    //if (this.state == 'enable')
-    {
-        this.request()
-        GM_addStyle('hr.autopagerize_page_separator {clear: both;}')
-    }
+	this.shouldLoadAll = true;
+	//if (this.state == 'enable')
+	{
+		this.request()
+		GM_addStyle('hr.autopagerize_page_separator {clear: both;}')
+	}
 }
 
 AutoPager.prototype.getPageElementsBottom = function() {
-    try {
-        var elem = this.getPageElements();
-        if(elem) {
-            elem = elem.pop();
-            if(elem)
-                return getElementBottom(elem);
-        }
-        
-        return 0;
-    } catch(e) {
-        log(e);
-        this.error();
-        return;
-    }
+	try {
+		var elem = this.getPageElements();
+		if(elem) {
+			elem = elem.pop();
+			if(elem)
+				return getElementBottom(elem);
+		}
+		
+		return 0;
+	} catch(e) {
+		log(e);
+		this.error();
+		return;
+	}
 }
 
 AutoPager.prototype.getPageCount = function( doc ) {
-    if ( !this.info.getPgCount )
-        return undefined;
-    return parseInt( getValueFromFuncOrXPath( this.info.getPgCount, doc ) );
+	if ( !this.info.getPgCount )
+		return undefined;
+	return parseInt( getValueFromFuncOrXPath( this.info.getPgCount, doc ) );
 }
 
 AutoPager.prototype.initPageNum = function() {
-    var pg = this.getCurrentPageNumber();
-    var totalPages = this.getPageCount( document );
-    this.updatePageNum( pg, totalPages );
+	var pg = this.getCurrentPageNumber();
+	var totalPages = this.getPageCount( document );
+	this.updatePageNum( pg, totalPages );
 }
 
 AutoPager.prototype.updatePageNum = function( page, totalPages ) {
-    this.pageNum = page;
-    var url = this.lastRequestURL || document.location.href;
-    var pgTxt = page;
-    if( totalPages )
-        pgTxt += "/" + totalPages;
-    
-    var lnk = "<a class='autopagerize_link' href='" + url + "'>Page: " + pgTxt + "</a>";
-    curPageDiv.innerHTML = lnk;
+	this.pageNum = page;
+	var url = this.lastRequestURL || document.location.href;
+	var pgTxt = page;
+	if( totalPages )
+		pgTxt += "/" + totalPages;
+	
+	var lnk = "<a class='autopagerize_link' href='" + url + "'>Page: " + pgTxt + "</a>";
+	curPageDiv.innerHTML = lnk;
 }
 
 var curPageDiv = null;
 AutoPager.prototype.initHelp = function() {
-    // main popup div
-    var helpDiv = document.createElement('div');
-    helpDiv.setAttribute('id', 'autopagerize_help');
-    helpDiv.setAttribute('style', 'padding:5px; position:fixed; top:-500px; right:3px; font-size:10px; background:#fff; color:#000; border:1px solid #ccc; z-index:256; text-align:left; font-weight:normal; line-height:120%; font-family:verdana;');
+	// main popup div
+	var helpDiv = document.createElement('div');
+	helpDiv.setAttribute('id', 'autopagerize_help');
+	helpDiv.setAttribute('style', 'padding:5px; position:fixed; top:-500px; right:3px; font-size:10px; background:#fff; color:#000; border:1px solid #ccc; z-index:256; text-align:left; font-weight:normal; line-height:120%; font-family:verdana;');
 
-    // div that contains page count
-    curPageDiv = document.createElement('div');
-    curPageDiv.setAttribute('style', 'text-align: right;');
-    this.initPageNum();
+	// div that contains page count
+	curPageDiv = document.createElement('div');
+	curPageDiv.setAttribute('style', 'text-align: right;');
+	this.initPageNum();
 
-    // ON-OFF link div  
-    var toggleDiv = document.createElement('div');
-    toggleDiv.setAttribute('style', 'text-align: right;');
-    var a = document.createElement('a');
-    a.setAttribute('class', 'autopagerize_link');
-    a.innerHTML = 'on/off';
-    a.href = 'javascript:void(0)';
-    var self = this;
-    var toggle = function() {
-        self.stateToggle();
-        helpDiv.style.top = '-500px';
-    };
-    a.addEventListener('click', toggle, false);
-    toggleDiv.appendChild(a);
+	// ON-OFF link div  
+	var toggleDiv = document.createElement('div');
+	toggleDiv.setAttribute('style', 'text-align: right;');
+	var a = document.createElement('a');
+	a.setAttribute('class', 'autopagerize_link');
+	a.innerHTML = 'on/off';
+	a.href = 'javascript:void(0)';
+	var self = this;
+	var toggle = function() {
+		self.stateToggle();
+		helpDiv.style.top = '-500px';
+	};
+	a.addEventListener('click', toggle, false);
+	toggleDiv.appendChild(a);
 
-    // TODO: add paging
-    /*
-    var pagingDiv_prev = document.createElement('div');
-    pagingDiv_prev.setAttribute('style', 'margin:0 0 0 90px; cursor: pointer; text-decoration: underline;')
-    pagingDiv_prev.innerHTML = "";
-    var prevPage = function() {
-        self.stateToggle();
-        helpDiv.style.top = '-200px';
-    }
-    pagingDiv_prev.addEventListener('click', prevPage, false);
-    */
+	// TODO: add paging
+	/*
+	var pagingDiv_prev = document.createElement('div');
+	pagingDiv_prev.setAttribute('style', 'margin:0 0 0 90px; cursor: pointer; text-decoration: underline;')
+	pagingDiv_prev.innerHTML = "";
+	var prevPage = function() {
+		self.stateToggle();
+		helpDiv.style.top = '-200px';
+	}
+	pagingDiv_prev.addEventListener('click', prevPage, false);
+	*/
 
-    // div with link to load all
-    var loadAllDiv = null;
-    if(!this.completeReplace) {
-        loadAllDiv=document.createElement('div');
-        loadAllDiv.setAttribute('style', 'text-align: right;');
-        loadAllDiv.setAttribute('id', 'loadAllDiv');
-        var a = document.createElement('a');
-        a.setAttribute('class', 'autopagerize_link');
-        a.innerHTML = 'Load all';
-        a.href = 'javascript:void(0)';
-        var loadAll = function() {
-            self.loadAll();
-            helpDiv.style.top = '-500px';
-            loadAllDiv.style.visibility = 'hidden';
-            toggleDiv.style.visibility = 'hidden';
-        }
-        a.addEventListener('click', loadAll, false);
-        loadAllDiv.appendChild(a);
-    }
+	// div with link to load all
+	var loadAllDiv = null;
+	if(!this.completeReplace) {
+		loadAllDiv=document.createElement('div');
+		loadAllDiv.setAttribute('style', 'text-align: right;');
+		loadAllDiv.setAttribute('id', 'loadAllDiv');
+		var a = document.createElement('a');
+		a.setAttribute('class', 'autopagerize_link');
+		a.innerHTML = 'Load all';
+		a.href = 'javascript:void(0)';
+		var loadAll = function() {
+			self.loadAll();
+			helpDiv.style.top = '-500px';
+			loadAllDiv.style.visibility = 'hidden';
+			toggleDiv.style.visibility = 'hidden';
+		}
+		a.addEventListener('click', loadAll, false);
+		loadAllDiv.appendChild(a);
+	}
 
-    // div that contains status light color legend
-    var s = '<div style="width:80px; float:left; color: #000000;">';
-    for (var i in COLOR) {
-        s += '<div style="float:left;width:1em;height:1em;' +
-            'margin:0 3px;background-color:' + COLOR[i] + ';' +
-            '"></div><div style="margin:0 3px">' + i + '</div>';
-    }
-    s += '</div>';
-    var colorDiv = document.createElement('div');
-    colorDiv.innerHTML = s;
-    
-    // create table with 2 columns: one for legend, another for controls
-    var tbl = document.createElement('table');
-    tbl.setAttribute('style', 'border: 0; padding: 0; margin: 0; background:#fff;');
-    var tblTR = document.createElement('tr');
-    tblTR.setAttribute('style', 'border: 0; padding: 0; margin: 0; background:#fff;');
-    var leftCol = document.createElement('td');
-    leftCol.setAttribute('style', 'border: 0; padding: 0; margin: 0; background:#fff; padding-right: 3px; font-size: 10px;');
-    var midCol = document.createElement('td');
-    midCol.setAttribute('style', 'border: 0; padding: 0; margin: 0; background: #000000; width:1px;');
-    var rightCol = document.createElement('td');
-    rightCol.setAttribute('style', 'border: 0; padding: 0; margin: 0; background:#fff; padding-left: 3px; font-size: 10px; vertical-align: top; text-align: right;');
+	// div that contains status light color legend
+	var s = '<div style="width:80px; float:left; color: #000000;">';
+	for (var i in COLOR) {
+		s += '<div style="float:left;width:1em;height:1em;' +
+			'margin:0 3px;background-color:' + COLOR[i] + ';' +
+			'"></div><div style="margin:0 3px">' + i + '</div>';
+	}
+	s += '</div>';
+	var colorDiv = document.createElement('div');
+	colorDiv.innerHTML = s;
+	
+	// create table with 2 columns: one for legend, another for controls
+	var tbl = document.createElement('table');
+	tbl.setAttribute('style', 'border: 0; padding: 0; margin: 0; background:#fff;');
+	var tblTR = document.createElement('tr');
+	tblTR.setAttribute('style', 'border: 0; padding: 0; margin: 0; background:#fff;');
+	var leftCol = document.createElement('td');
+	leftCol.setAttribute('style', 'border: 0; padding: 0; margin: 0; background:#fff; padding-right: 3px; font-size: 10px;');
+	var midCol = document.createElement('td');
+	midCol.setAttribute('style', 'border: 0; padding: 0; margin: 0; background: #000000; width:1px;');
+	var rightCol = document.createElement('td');
+	rightCol.setAttribute('style', 'border: 0; padding: 0; margin: 0; background:#fff; padding-left: 3px; font-size: 10px; vertical-align: top; text-align: right;');
 
 
-    leftCol.appendChild(colorDiv);
+	leftCol.appendChild(colorDiv);
 
-    rightCol.appendChild(curPageDiv);
-    rightCol.appendChild(toggleDiv);
-    if(!this.completeReplace)
-        rightCol.appendChild(loadAllDiv)
+	rightCol.appendChild(curPageDiv);
+	rightCol.appendChild(toggleDiv);
+	if(!this.completeReplace)
+		rightCol.appendChild(loadAllDiv)
 
-    tbl.appendChild(tblTR);
-    tblTR.appendChild(leftCol);
-    tblTR.appendChild(midCol);
-    tblTR.appendChild(rightCol);
+	tbl.appendChild(tblTR);
+	tblTR.appendChild(leftCol);
+	tblTR.appendChild(midCol);
+	tblTR.appendChild(rightCol);
 
-    /*if( isDebug() ) {
-        // show the current paging info
-        tblTR = document.createElement('tr');
-        tblTR.setAttribute('style', 'border: 0; padding: 0; margin: 0; background:#fff;');
-        
-        leftCol = document.createElement('td');
-        leftCol.setAttribute('style', 'border: 0; padding: 0; margin: 0; background:#fff; font-size: 10px;');
-        leftCol.setAttribute('colspan', '3');
-        leftCol.innerHTML = "<textarea style='width: 100%; font-size: 10px;'>" + self.info.toSource() + "</textarea>";
-        tblTR.appendChild(leftCol);
-        
-        tbl.appendChild(tblTR);
-    }*/
-    helpDiv.appendChild(tbl);
+	/*if( isDebug() ) {
+		// show the current paging info
+		tblTR = document.createElement('tr');
+		tblTR.setAttribute('style', 'border: 0; padding: 0; margin: 0; background:#fff;');
+		
+		leftCol = document.createElement('td');
+		leftCol.setAttribute('style', 'border: 0; padding: 0; margin: 0; background:#fff; font-size: 10px;');
+		leftCol.setAttribute('colspan', '3');
+		leftCol.innerHTML = "<textarea style='width: 100%; font-size: 10px;'>" + self.info.toSource() + "</textarea>";
+		tblTR.appendChild(leftCol);
+		
+		tbl.appendChild(tblTR);
+	}*/
+	helpDiv.appendChild(tbl);
 
-    /*var versionDiv = document.createElement('div');
-    versionDiv.setAttribute('style', 'clear:both;');
-    versionDiv.innerHTML = '<a href="' + URL + '">AutoPagerize</a> ver ' + VERSION;
-    helpDiv.appendChild(versionDiv);*/
-    document.body.appendChild(helpDiv);
-    
-    var proc = function(e) {
-        var c_style = document.defaultView.getComputedStyle(helpDiv, '');
-        var s = ['top', 'left', 'height', 'width'].map(function(i) { return parseInt(c_style.getPropertyValue(i)); });
-        if (e.clientX < s[1] || e.clientX > (s[1] + s[3] + 11) || e.clientY < s[0] || e.clientY > (s[0] + s[2] + 11)) {
-            helpDiv.style.top = '-200px';
-        }
-    };
-    helpDiv.addEventListener('mouseout', proc, false);
-    this.helpLayer = helpDiv;
-    GM_addStyle('#autopagerize_help a { color: #0f0; text-decoration: underline;} a.autopagerize_link { border: 0;}');
-    
-    
-    SetupShortcutJs();
-    
-    var fnRemShortcuts = function(e) {
-        shortcut.remove("Alt+]");
-        shortcut.remove("Alt+\\");
-        shortcut.remove("Alt+.");
-    };
-    var fnLoadNext = function(e) {
-        self.request();
-    };
-    var fnLoadPause = function(e) {
-        return self.stateToggle();
-    };
-    var fnLoadPauseForever = function(e) {
-        var isEnabled = fnLoadPause();
-        setEternalPausePreference( document.location.host, !isEnabled );
-    };
-    var fnLoadAll = function(e) {
-        fnRemShortcuts();
-        
-        self.loadAll();
-        loadAllDiv.style.visibility = 'hidden';
-        toggleDiv.style.visibility = 'hidden';
-    };
-    shortcut.add("Alt+]",  fnLoadNext, {"type": "keypress"} );
-    shortcut.add("Alt+\\", fnLoadPause, {"type": "keypress"} );
-    shortcut.add("Alt+/", fnLoadPauseForever, {"type": "keypress"} );
-    shortcut.add("Alt+.",  fnLoadAll, {"type": "keypress"} );
+	/*var versionDiv = document.createElement('div');
+	versionDiv.setAttribute('style', 'clear:both;');
+	versionDiv.innerHTML = '<a href="' + URL + '">AutoPagerize</a> ver ' + VERSION;
+	helpDiv.appendChild(versionDiv);*/
+	document.body.appendChild(helpDiv);
+	
+	var proc = function(e) {
+		var c_style = document.defaultView.getComputedStyle(helpDiv, '');
+		var s = ['top', 'left', 'height', 'width'].map(function(i) { return parseInt(c_style.getPropertyValue(i)); });
+		if (e.clientX < s[1] || e.clientX > (s[1] + s[3] + 11) || e.clientY < s[0] || e.clientY > (s[0] + s[2] + 11)) {
+			helpDiv.style.top = '-200px';
+		}
+	};
+	helpDiv.addEventListener('mouseout', proc, false);
+	this.helpLayer = helpDiv;
+	GM_addStyle('#autopagerize_help a { color: #0f0; text-decoration: underline;} a.autopagerize_link { border: 0;}');
+	
+	
+	SetupShortcutJs();
+	
+	var fnRemShortcuts = function(e) {
+		shortcut.remove("Alt+]");
+		shortcut.remove("Alt+\\");
+		shortcut.remove("Alt+.");
+	};
+	var fnLoadNext = function(e) {
+		self.request();
+	};
+	var fnLoadPause = function(e) {
+		return self.stateToggle();
+	};
+	var fnLoadPauseForever = function(e) {
+		var isEnabled = fnLoadPause();
+		setEternalPausePreference( document.location.host, !isEnabled );
+	};
+	var fnLoadAll = function(e) {
+		fnRemShortcuts();
+		
+		self.loadAll();
+		loadAllDiv.style.visibility = 'hidden';
+		toggleDiv.style.visibility = 'hidden';
+	};
+	shortcut.add("Alt+]",  fnLoadNext, {"type": "keypress"} );
+	shortcut.add("Alt+\\", fnLoadPause, {"type": "keypress"} );
+	shortcut.add("Alt+/", fnLoadPauseForever, {"type": "keypress"} );
+	shortcut.add("Alt+.",  fnLoadAll, {"type": "keypress"} );
 }
 
 AutoPager.prototype.viewHelp = function() {
-    this.helpLayer.style.top = '3px';
+	this.helpLayer.style.top = '3px';
 }
 
 AutoPager.prototype.onScroll = function() {
-    if(leftMouseDown)
-        return;
-    removeLastPageData(this, false);
-    var scrollHeight = Math.max(document.documentElement.scrollHeight, document.body.scrollHeight);
-    var remain = scrollHeight - window.innerHeight - window.scrollY;
-    
-    // TODO: add prevLink
-    //                                                          AA
-    if (this.state == 'enable' && remain < this.remainHeight && !this.shouldLoadAll) {
-        this.request();
-    }
+	if(leftMouseDown)
+		return;
+	removeLastPageData(this, false);
+	var scrollHeight = Math.max(document.documentElement.scrollHeight, document.body.scrollHeight);
+	var remain = scrollHeight - window.innerHeight - window.scrollY;
+	
+	// TODO: add prevLink
+	//                                                          AA
+	if (this.state == 'enable' && remain < this.remainHeight && !this.shouldLoadAll) {
+		this.request();
+	}
 }
 
 AutoPager.prototype.stateToggle = function() {
-    if (this.state == 'enable') {
-        this.disable();
-    } else {
-        this.enable();
-        this.onScroll();
-    }
+	if (this.state == 'enable') {
+		this.disable();
+	} else {
+		this.enable();
+		this.onScroll();
+	}
 
-    return this.state == 'enable';
+	return this.state == 'enable';
 }
 
 AutoPager.prototype.enable = function() {
-    this.state = 'enable';
-    this.updateIcon();
+	this.state = 'enable';
+	this.updateIcon();
 }
 
 AutoPager.prototype.disable = function() {
-    this.state = 'disable';
-    this.updateIcon();
+	this.state = 'disable';
+	this.updateIcon();
 }
 
 AutoPager.prototype.updateIcon = function(state) {
-    var st = state || this.state;
-    var rename = {'enable': 'on', 'disable': 'off' };
-    if (rename[st])
-        st = rename[st];
+	var st = state || this.state;
+	var rename = {'enable': 'on', 'disable': 'off' };
+	if (rename[st])
+		st = rename[st];
 
-    var color = COLOR[st];
-    if (color)
-        this.icon.style.background = color;
+	var color = COLOR[st];
+	if (color)
+		this.icon.style.background = color;
 }
 
 AutoPager.prototype.request = function() {
-    if (!this.requestURL || this.lastRequestURL == this.requestURL) {
-        return;
-    }
+	if (!this.requestURL || this.lastRequestURL == this.requestURL) {
+		return;
+	}
 
-    /*// if the page want to load does not have a slash or a backslash, then strip the previous page of everything after the last slash (or backslash), and append the next page
-    var i = Math.max(this.requestURL.indexOf('/'), this.requestURL.indexOf('\\'));
-    if(i<0) {
-        // no slash found, so parse the previous page
-        i = Math.max(this.lastRequestURL.lastIndexOf('\\'), this.lastRequestURL.lastIndexOf('/'));
-        var t = this.lastRequestURL.substring(0, i+1);
-        this.requestURL = t + this.requestURL;
-    }*/
+	/*// if the page want to load does not have a slash or a backslash, then strip the previous page of everything after the last slash (or backslash), and append the next page
+	var i = Math.max(this.requestURL.indexOf('/'), this.requestURL.indexOf('\\'));
+	if(i<0) {
+		// no slash found, so parse the previous page
+		i = Math.max(this.lastRequestURL.lastIndexOf('\\'), this.lastRequestURL.lastIndexOf('/'));
+		var t = this.lastRequestURL.substring(0, i+1);
+		this.requestURL = t + this.requestURL;
+	}*/
 
-    this.lastRequestURL = this.requestURL;
-    var self = this;
-    var mime = 'text/html; charset=' + document.characterSet;
-    var headers = {};
-    if (isSameDomain(this.requestURL)) {
-        headers.Cookie = document.cookie;
-    } else {
-        log("requesting not from same domain");
-        this.error();
-        return;
-    } 
-    var tt = this.requestURL;
-    var opt = {
-        method: 'GET',
-        url: this.requestURL,
-        headers: headers,
-        overrideMimeType: mime,
-        onerror: function(res) {
-            log(tt + "\nrequest error:\nstatus: " + res.status + "\nstatusText: " + res.statusText + "\nreadyState: " + res.readyState + "\nresponseText: " + res.responseText + "\nresponseHeaders: " + res.responseHeaders + "\nfinalUrl: " + res.finalUrl);
-            self.error()
-        },
-        onload: function(res) {
-            if (res.finalUrl) {
-                var url_s = res.finalUrl.split(/[\/\?]/);
-                if (url_s[0] == location.protocol && location.host == url_s[2]) {
-                    self.requestLoad.apply(self, [res]);
-                    return;
-                }
-            }
-            log("loaded, but returned url not same as requested. Loaded: '" + res.finalUrl + "'; Requested: '" + location.host + "'");
-            self.error();
-        }
-    };
-    AutoPager.requestFilters.forEach(function(i) { i(opt); }, this);
-    if (opt.stop) {
-        this.requestURL = opt.url;
-    } else {
-        this.showLoading(true);
-        GM_xmlhttpRequest(opt);
-    }
+	this.lastRequestURL = this.requestURL;
+	var self = this;
+	var mime = 'text/html; charset=' + document.characterSet;
+	var headers = {};
+	if (isSameDomain(this.requestURL)) {
+		headers.Cookie = document.cookie;
+	} else {
+		log("requesting not from same domain");
+		this.error();
+		return;
+	} 
+	var tt = this.requestURL;
+	var opt = {
+		method: 'GET',
+		url: this.requestURL,
+		headers: headers,
+		overrideMimeType: mime,
+		onerror: function(res) {
+			log(tt + "\nrequest error:\nstatus: " + res.status + "\nstatusText: " + res.statusText + "\nreadyState: " + res.readyState + "\nresponseText: " + res.responseText + "\nresponseHeaders: " + res.responseHeaders + "\nfinalUrl: " + res.finalUrl);
+			self.error()
+		},
+		onload: function(res) {
+			if (res.finalUrl) {
+				var url_s = res.finalUrl.split(/[\/\?]/);
+				if (url_s[0] == location.protocol && location.host == url_s[2]) {
+					self.requestLoad.apply(self, [res]);
+					return;
+				}
+			}
+			log("loaded, but returned url not same as requested. Loaded: '" + res.finalUrl + "'; Requested: '" + location.host + "'");
+			self.error();
+		}
+	};
+	AutoPager.requestFilters.forEach(function(i) { i(opt); }, this);
+	if (opt.stop) {
+		this.requestURL = opt.url;
+	} else {
+		this.showLoading(true);
+		GM_xmlhttpRequest(opt);
+	}
 } 
 
 AutoPager.prototype.showLoading = function(sw) {
-    if (sw) {
-        this.updateIcon('loading');
-    } else {
-        this.updateIcon('enable');
-    }
+	if (sw) {
+		this.updateIcon('loading');
+	} else {
+		this.updateIcon('enable');
+	}
 }
 
 AutoPager.prototype.requestLoad = function(res) {
-    AutoPager.responseFilters.forEach(function(i){ i(res, this.requestURL); }, this);
+	AutoPager.responseFilters.forEach(function(i){ i(res, this.requestURL); }, this);
 
-    if (res.finalUrl)
-        this.requestURL = res.finalUrl;
+	if (res.finalUrl)
+		this.requestURL = res.finalUrl;
 
-    var htmlDoc = createHTMLDocumentByString(res.responseText);
-    AutoPager.documentFilters.forEach(function(i) { i(htmlDoc, this.requestURL, this.info); }, this);
-    try {
-        var page = this.getPageElements(htmlDoc);
-        var url = getNextURL(this.info.nextLink, htmlDoc, this.requestURL);
-    } catch(e) {
-        log(e);
-        this.error();
-        return;
-    }
+	var htmlDoc = createHTMLDocumentByString(res.responseText);
+	AutoPager.documentFilters.forEach(function(i) { i(htmlDoc, this.requestURL, this.info); }, this);
+	try {
+		var page = this.getPageElements(htmlDoc);
+		var url = getNextURL(this.info.nextLink, htmlDoc, this.requestURL);
+	} catch(e) {
+		log(e);
+		this.error();
+		return;
+	}
 
-    if (!page || page.length < 1 ) {
-        debug('pageElement not found.' , this.info.pageElement);
-        this.terminate();
-        return;
-    }
+	if (!page || page.length < 1 ) {
+		debug('pageElement not found.' , this.info.pageElement);
+		this.terminate();
+		return;
+	}
 
-    if (this.loadedURLs[this.requestURL]) {
-        debug('page is already loaded.', this.requestURL, this.info.nextLink);
-        this.terminate();
-        return;
-    }
+	if (this.loadedURLs[this.requestURL]) {
+		debug('page is already loaded.', this.requestURL, this.info.nextLink);
+		this.terminate();
+		return;
+	}
 
-    this.loadedURLs[this.requestURL] = true;
-    page = this.addPage(htmlDoc, page);
-    AutoPager.filters.forEach(function(i) { i(page); });
-    this.requestURL = url;
-    this.showLoading(false);
-    if (!url) {
-        debug('nextLink not found.', this.info.nextLink, htmlDoc);
-        this.forceForce = true;
-        this.terminate();
-    } else { // for loading all
-        if(this.shouldLoadAll)
-            this.request();
-        else {
-            this.onScroll();
-        }
-    }
-    var ev = document.createEvent('Event');
-    ev.initEvent('GM_AutoPagerizeNextPageLoaded', true, false);
-    document.dispatchEvent(ev);
+	this.loadedURLs[this.requestURL] = true;
+	page = this.addPage(htmlDoc, page);
+	AutoPager.filters.forEach(function(i) { i(page); });
+	this.requestURL = url;
+	this.showLoading(false);
+	if (!url) {
+		debug('nextLink not found.', this.info.nextLink, htmlDoc);
+		this.forceForce = true;
+		this.terminate();
+	} else { // for loading all
+		if(this.shouldLoadAll)
+			this.request();
+		else {
+			this.onScroll();
+		}
+	}
+	var ev = document.createEvent('Event');
+	ev.initEvent('GM_AutoPagerizeNextPageLoaded', true, false);
+	document.dispatchEvent(ev);
 }
 
 AutoPager.prototype.addPage = function( htmlDoc, page ) {
-    var totalPages = this.getPageCount( htmlDoc );
-    this.updatePageNum( this.pageNum + 1, totalPages );
-    
-    // add hash for paging to work when backing into this page
-    //var loc = document.location;
-    //loc = loc.href.substring(0, loc.href.length - loc.hash.length);
-    /*var anch = document.location.hash;
-    if(0==len(anch))
-    {*/
-        // no anchor
-        //document.location.replace(loc + '#pg_'+this.pageNum);
-    /*}
-    else
-    {
-        if(anch=='#pg_'+(this.pageNum-1))
-        {
-            document.location.replace(loc + '#pg_'+this.pageNum);
-        }
-        else if(endsWith(anch, '%pg_'+(this.pageNum-1)))
-        {
-            anch = anch.substring(
-            document.location.replace(loc + '#pg_'+this.pageNum);
-        }
-        // already have an anchor
-        document.location.replace(loc + '%pg_'+this.pageNum);
-    }*/
-    var self = this;
+	var totalPages = this.getPageCount( htmlDoc );
+	this.updatePageNum( this.pageNum + 1, totalPages );
+	
+	// add hash for paging to work when backing into this page
+	//var loc = document.location;
+	//loc = loc.href.substring(0, loc.href.length - loc.hash.length);
+	/*var anch = document.location.hash;
+	if(0==len(anch))
+	{*/
+		// no anchor
+		//document.location.replace(loc + '#pg_'+this.pageNum);
+	/*}
+	else
+	{
+		if(anch=='#pg_'+(this.pageNum-1))
+		{
+			document.location.replace(loc + '#pg_'+this.pageNum);
+		}
+		else if(endsWith(anch, '%pg_'+(this.pageNum-1)))
+		{
+			anch = anch.substring(
+			document.location.replace(loc + '#pg_'+this.pageNum);
+		}
+		// already have an anchor
+		document.location.replace(loc + '%pg_'+this.pageNum);
+	}*/
+	var self = this;
 
-    // if must add link to the newly loaded page, and not doing a complete replace, add link
-    if(!this.noCues && !this.completeReplace) {
-        var HTML_NS  = 'http://www.w3.org/1999/xhtml';
-        var hr = document.createElementNS(HTML_NS, 'hr');
-        var p  = document.createElementNS(HTML_NS, 'p');
-        hr.setAttribute('class', 'autopagerize_page_separator');
-        p.setAttribute('class', 'autopagerize_page_info');
+	// if must add link to the newly loaded page, and not doing a complete replace, add link
+	if(!this.noCues && !this.completeReplace) {
+		var HTML_NS  = 'http://www.w3.org/1999/xhtml';
+		var hr = document.createElementNS(HTML_NS, 'hr');
+		var p  = document.createElementNS(HTML_NS, 'p');
+		hr.setAttribute('class', 'autopagerize_page_separator');
+		p.setAttribute('class', 'autopagerize_page_info');
 
-        // if we're inserting rows into table, add TR with page link
-        if (page[0] && /tr/i.test(page[0].tagName)) {
-            var insertParent = this.insertPoint.parentNode;
-            var colNodes = getElementsByXPath('child::tr[1]/child::*[self::td or self::th]', insertParent);
+		// if we're inserting rows into table, add TR with page link
+		if (page[0] && /tr/i.test(page[0].tagName)) {
+			var insertParent = this.insertPoint.parentNode;
+			var colNodes = getElementsByXPath('child::tr[1]/child::*[self::td or self::th]', insertParent);
 
-            var colums = 0;
-            for (var i = 0, l = colNodes.length; i < l; i++) {
-                var col = colNodes[i].getAttribute('colspan');
-                colums += parseInt(col, 10) || 1;
-            }
-            var td = document.createElement('td');
-            // td.appendChild(hr)
-            td.appendChild(p);
-            var tr = document.createElement('tr');
-            td.setAttribute('colspan', colums);
-            tr.appendChild(td);
-            insertParent.insertBefore(tr, this.insertPoint);
-        } else {
-            this.insertPoint.parentNode.insertBefore(hr, this.insertPoint);
-            this.insertPoint.parentNode.insertBefore(p, this.insertPoint);
-        }
+			var colums = 0;
+			for (var i = 0, l = colNodes.length; i < l; i++) {
+				var col = colNodes[i].getAttribute('colspan');
+				colums += parseInt(col, 10) || 1;
+			}
+			var td = document.createElement('td');
+			// td.appendChild(hr)
+			td.appendChild(p);
+			var tr = document.createElement('tr');
+			td.setAttribute('colspan', colums);
+			tr.appendChild(td);
+			insertParent.insertBefore(tr, this.insertPoint);
+		} else {
+			this.insertPoint.parentNode.insertBefore(hr, this.insertPoint);
+			this.insertPoint.parentNode.insertBefore(p, this.insertPoint);
+		}
 
-        p.innerHTML = 'page: <a class="autopagerize_link" href="' + this.requestURL.replace(/&/g, '&amp;') + '">' + this.pageNum + '</a>';
-    }
-    removeLastPageData(this, true); // force removal of old stuff
+		p.innerHTML = 'page: <a class="autopagerize_link" href="' + this.requestURL.replace(/&/g, '&amp;') + '">' + this.pageNum + '</a>';
+	}
+	removeLastPageData(this, true); // force removal of old stuff
 
-    this.toBeRemoved = null;
-    if(this.completeReplace) {
-        this.toBeRemoved = this.getPageElements(document);
-    }
-    var self = this;
+	this.toBeRemoved = null;
+	if(this.completeReplace) {
+		this.toBeRemoved = this.getPageElements(document);
+	}
+	var self = this;
 
-    var mapRV = page.map(function(i) {
-        var pe = document.importNode(i, true);
-        self.insertPoint.parentNode.insertBefore(pe, self.insertPoint);
-        var ev = document.createEvent('MutationEvent');
-        ev.initMutationEvent('AutoPagerize_DOMNodeInserted', true, false, self.insertPoint.parentNode, null, self.requestURL, null, null);
-        pe.dispatchEvent(ev);
-        return pe;
-    });
-    if(self.info.postFn) {
-        self.info.postFn(unsafeWindow, mapRV);
-    }
-    
-    return mapRV;
+	var mapRV = page.map(function(i) {
+		var pe = document.importNode(i, true);
+		self.insertPoint.parentNode.insertBefore(pe, self.insertPoint);
+		var ev = document.createEvent('MutationEvent');
+		ev.initMutationEvent('AutoPagerize_DOMNodeInserted', true, false, self.insertPoint.parentNode, null, self.requestURL, null, null);
+		pe.dispatchEvent(ev);
+		return pe;
+	});
+	if(self.info.postFn) {
+		self.info.postFn(unsafeWindow, mapRV);
+	}
+	
+	return mapRV;
 }
 
 AutoPager.prototype.initIcon = function() {
-    var div = document.createElement("div");
-    div.setAttribute('id', 'autopagerize_icon');
-    with (div.style) {
-        fontSize    = '12px';
-        position    = 'fixed';
-        top         = '3px';
-        right       = '3px';
-        background  = COLOR['on'];
-        color       = '#fff';
-        width       = '10px';
-        height      = '10px';
-        zIndex      = '255';
-        if (this.state != 'enable') {
-            background = COLOR['off'];
-        }
-    }
-    document.body.appendChild(div);
-    this.icon = div;
+	var div = document.createElement("div");
+	div.setAttribute('id', 'autopagerize_icon');
+	with (div.style) {
+		fontSize    = '12px';
+		position    = 'fixed';
+		top         = '3px';
+		right       = '3px';
+		background  = COLOR['on'];
+		color       = '#fff';
+		width       = '10px';
+		height      = '10px';
+		zIndex      = '255';
+		if (this.state != 'enable') {
+			background = COLOR['off'];
+		}
+	}
+	document.body.appendChild(div);
+	this.icon = div;
 }
 
 function getValueFromFuncOrXPath( f, doc ) {
-    if( typeof( f ) == 'function' )
-        f = f( doc );
-    else
-        f = getElementsByXPath( f, doc );
+	if( typeof( f ) == 'function' )
+		f = f( doc );
+	else
+		f = getElementsByXPath( f, doc );
 
-    if( !f )
-        return undefined;
+	if( !f )
+		return undefined;
 
-    var fnTexter = function( elem ) {
-        if( typeof( elem ) == 'number' )
-            return elem;
-        if( typeof( elem ) == 'string' )
-            return elem;
-        return elem.textContent;
-    };
-    
-    // arrays get special treatment
-    if( Object.prototype.toString.call( f ) === '[object Array]' ) {
-        var vals = Array(f.length);
-        for(var i=0;i<f.length; ++i) {
-            vals[i] = fnTexter( f[i] );
-        }
+	var fnTexter = function( elem ) {
+		if( typeof( elem ) == 'number' )
+			return elem;
+		if( typeof( elem ) == 'string' )
+			return elem;
+		return elem.textContent;
+	};
+	
+	// arrays get special treatment
+	if( Object.prototype.toString.call( f ) === '[object Array]' ) {
+		var vals = Array(f.length);
+		for(var i=0;i<f.length; ++i) {
+			vals[i] = fnTexter( f[i] );
+		}
 
-        if(f.length==1)
-            return vals[0];
+		if(f.length==1)
+			return vals[0];
 
-        return Math.max(vals);
-    }
-    
-    return fnTexter( f );
+		return Math.max(vals);
+	}
+	
+	return fnTexter( f );
 }
 
 AutoPager.prototype.getCurrentPageNumber = function( doc ) {
-    if (!this.info.getCurPgNum)
-        return 1;
-        
-    var pg = parseInt( getValueFromFuncOrXPath( this.info.getCurPgNum, doc ) );
-    if( isNaN( pg ) )
-        pg = 1;
-    return pg;
+	if (!this.info.getCurPgNum)
+		return 1;
+		
+	var pg = parseInt( getValueFromFuncOrXPath( this.info.getCurPgNum, doc ) );
+	if( isNaN( pg ) )
+		pg = 1;
+	return pg;
 }
 
 function getNextURL(nextLnk, doc, url) {
-    var nextValue = null;
-    var next = null;
-    if(typeof(nextLnk) == 'function')
-        next = nextLnk(doc);
-    else
-        next = getFirstElementByXPath(nextLnk, doc);
+	var nextValue = null;
+	var next = null;
+	if(typeof(nextLnk) == 'function')
+		next = nextLnk(doc);
+	else
+		next = getFirstElementByXPath(nextLnk, doc);
 
-    if (next) {
-        if(typeof(next) == 'string')
-            nextValue = next;
-        else {
-            nextValue = next.getAttribute('href') || next.getAttribute('action') || next.value;
-            if(!nextValue) {
-                //alert(nextLnk);
-                //alert(next);
-            }
-            if (nextValue.match(/^http(s)?:/)) {
-                return nextValue;
-            }
-        }
-        var base = getFirstElementByXPath('//base[@href]', doc);
-        return resolvePath(nextValue, (base ? base.href : url));
-    }
+	if (next) {
+		if(typeof(next) == 'string')
+			nextValue = next;
+		else {
+			nextValue = next.getAttribute('href') || next.getAttribute('action') || next.value;
+			if(!nextValue) {
+				//alert(nextLnk);
+				//alert(next);
+			}
+			if (nextValue.match(/^http(s)?:/)) {
+				return nextValue;
+			}
+		}
+		var base = getFirstElementByXPath('//base[@href]', doc);
+		return resolvePath(nextValue, (base ? base.href : url));
+	}
 }
 
 AutoPager.prototype.terminate = function() {
-    window.removeEventListener('scroll', this.scroll, false);
-    window.removeEventListener('mousedown', mdown, false);
-    window.removeEventListener('mouseup', mup, false);
-    this.updateIcon('terminated');
-    var self = this;
-    setTimeout(function() {
-        if( self.icon ) {
-            self.icon.parentNode.removeChild(self.icon);
-        }
-    }, 1500);
+	window.removeEventListener('scroll', this.scroll, false);
+	window.removeEventListener('mousedown', mdown, false);
+	window.removeEventListener('mouseup', mup, false);
+	this.updateIcon('terminated');
+	var self = this;
+	setTimeout(function() {
+		if( self.icon ) {
+			self.icon.parentNode.removeChild(self.icon);
+		}
+	}, 1500);
 }
 
 AutoPager.prototype.error = function() {
-    this.updateIcon('error');
-    window.removeEventListener('scroll', this.scroll, false);
+	this.updateIcon('error');
+	window.removeEventListener('scroll', this.scroll, false);
 }
 
 // filters for all sorts of shit
 AutoPager.filters = [];
 
 var parseInfo = function(str) {
-    var lines = str.split(/\r\n|\r|\n/);
-    var re = /(^[^:]*?):(.*)$/;
-    var strip = function(str) {
-        return str.replace(/^\s*/, '').replace(/\s*$/, '');
-    }
-    var info = {};
-    for (var i = 0; i < lines.length; i++) {
-        if (lines[i].match(re)) {
-            info[RegExp.$1] = strip(RegExp.$2);
-        }
-    }
-    info.remainHeight = parseInt(info.remainHeight);
-    var isValid = function(info) {
-        var infoProp = ['url', 'nextLink', 'pageElement'];
-        for (var i = 0; i < infoProp.length; i++) {
-            if (!info[infoProp[i]]) {
-                return false;
-            }
-        }
-        return true;
-    }
-    return isValid(info) ? info : null;
+	var lines = str.split(/\r\n|\r|\n/);
+	var re = /(^[^:]*?):(.*)$/;
+	var strip = function(str) {
+		return str.replace(/^\s*/, '').replace(/\s*$/, '');
+	}
+	var info = {};
+	for (var i = 0; i < lines.length; i++) {
+		if (lines[i].match(re)) {
+			info[RegExp.$1] = strip(RegExp.$2);
+		}
+	}
+	info.remainHeight = parseInt(info.remainHeight);
+	var isValid = function(info) {
+		var infoProp = ['url', 'nextLink', 'pageElement'];
+		for (var i = 0; i < infoProp.length; i++) {
+			if (!info[infoProp[i]]) {
+				return false;
+			}
+		}
+		return true;
+	}
+	return isValid(info) ? info : null;
 }
 var launchAutoPager = function(list)
 {
-    if (list.length == 0)
-        return false;
+	if (list.length == 0)
+		return false;
 
-    if(ap)
-        return false;
-    for (var i = 0; i < list.length; i++) {
-        try {
-            var li = list[i];
-            var isMatch = false;
-            if(li.url && location.href.match(li.url)) {
-                isMatch = true;
-            } else if(li.urls && li.urls.length > 0) {
-                for(var cnt=0; cnt<li.urls.length; cnt++) {
-                    if(location.href.match(li.urls[cnt])) {
-                        //alert(li.urls[cnt]);
-                        isMatch = true;
-                        break;
-                    }
-                }
-            } else if(li.urlFunc && li.urlFunc(location.href)) {
-                isMatch = true;
-            }
+	if(ap)
+		return false;
+	for (var i = 0; i < list.length; i++) {
+		try {
+			var li = list[i];
+			var isMatch = false;
+			if(li.url && location.href.match(li.url)) {
+				isMatch = true;
+			} else if(li.urls && li.urls.length > 0) {
+				for(var cnt=0; cnt<li.urls.length; cnt++) {
+					if(location.href.match(li.urls[cnt])) {
+						//alert(li.urls[cnt]);
+						isMatch = true;
+						break;
+					}
+				}
+			} else if(li.urlFunc && li.urlFunc(location.href)) {
+				isMatch = true;
+			}
 
-            if(isMatch) {
-                //log(li);
-                var lnkT = null;
-                lnkT = getNextURL(li.nextLink, document, location.href);
-                if (lnkT) {
-                    //log(lnkT);
-                    ap = new AutoPager(li);
-                    return true;
-                }
-            }
-        } catch(e) {
-            log(e);
-            continue;
-        }
-    }
+			if(isMatch) {
+				//log(li);
+				var lnkT = null;
+				lnkT = getNextURL(li.nextLink, document, location.href);
+				if (lnkT) {
+					//log(lnkT);
+					ap = new AutoPager(li);
+					return true;
+				}
+			}
+		} catch(e) {
+			log(e);
+			continue;
+		}
+	}
 
-    return false;
+	return false;
 }
 
 
 var retrEternalPausePreferences = function() {
-    return eval(GM_getValue('eternalPause')) || {};
+	return eval(GM_getValue('eternalPause')) || {};
 }
 var saveEternalPausePreferences = function( prefs ) {
-    return GM_setValue( 'eternalPause', prefs.toSource() );
+	return GM_setValue( 'eternalPause', prefs.toSource() );
 }
 var setEternalPausePreference = function( domain, isPaused ) {
-    var prefs = retrEternalPausePreferences();
+	var prefs = retrEternalPausePreferences();
 
-    if( isPaused ) {
-        prefs[domain] = { isPaused:true };
-    } else {
-        delete prefs[domain];
-    }
+	if( isPaused ) {
+		prefs[domain] = { isPaused:true };
+	} else {
+		delete prefs[domain];
+	}
 
-    saveEternalPausePreferences( prefs );
+	saveEternalPausePreferences( prefs );
 }
 var getEternalPausePreference = function( domain ) {
-    var prefs = retrEternalPausePreferences();
-    var pref = prefs[domain];
-    if( pref )
-        return pref.isPaused || false;
+	var prefs = retrEternalPausePreferences();
+	var pref = prefs[domain];
+	if( pref )
+		return pref.isPaused || false;
 
-    return false;
+	return false;
 }
 
 
 
 
 var clearCache = function() {
-    GM_setValue('cacheInfo', '');
-    saveEternalPausePreferences( {} );
+	GM_setValue('cacheInfo', '');
+	saveEternalPausePreferences( {} );
 };
 var getCache = function() {
-    //try {
-    //  return JSON.parse(GM_getValue('cacheInfo')) || {};
-    //} catch (e) {
-        return eval(GM_getValue('cacheInfo')) || {};
-    //}
+	//try {
+	//  return JSON.parse(GM_getValue('cacheInfo')) || {};
+	//} catch (e) {
+		return eval(GM_getValue('cacheInfo')) || {};
+	//}
 };
 var AutoPagerPLNS = typeof AutoPagerPLNS != "undefined"?AutoPagerPLNS:{};
 AutoPagerPLNS.SimpleRegExp = function (s) {
-    this.p = s.substr(0,s.indexOf("*")).toLowerCase();
-    this.test = function(str) {
-        return str && str.toLowerCase().indexOf(this.p)==0;
-    };
+	this.p = s.substr(0,s.indexOf("*")).toLowerCase();
+	this.test = function(str) {
+		return str && str.toLowerCase().indexOf(this.p)==0;
+	};
 };
 
 var AutoPagerPL = {
-    Utils: {
-        // Converts a pattern in this programs simple notation to a regular expression.
-        // thanks AdBlock! http://www.mozdev.org/source/browse/adblock/adblock/
-        _simpleRegex : /^[^*]+\*$/,
-        _isSimple : function (s)
-        {
-            return (s && this._simpleRegex.test(s));
-        },
-        _convertToRegExpStr : function( pattern ) {
-            var s = new String( pattern );
-            var res = new String("^");
+	Utils: {
+		// Converts a pattern in this programs simple notation to a regular expression.
+		// thanks AdBlock! http://www.mozdev.org/source/browse/adblock/adblock/
+		_simpleRegex : /^[^*]+\*$/,
+		_isSimple : function (s)
+		{
+			return (s && this._simpleRegex.test(s));
+		},
+		_convertToRegExpStr : function( pattern ) {
+			var s = new String( pattern );
+			var res = new String("^");
 
-            for (var i = 0 ; i < s.length ; i++) {
-                switch(s[i]) {
-                    case '*' :
-                        res += ".*";
-                        break;
+			for (var i = 0 ; i < s.length ; i++) {
+				switch(s[i]) {
+					case '*' :
+						res += ".*";
+						break;
 
-                    case '.' :
-                    case '?' :
-                    case '^' :
-                    case '$' :
-                    case '+' :
-                    case '{' :
-                    case '[' :
-                    case '|' :
-                    case '(' :
-                    case ')' :
-                    case ']' :
-                    case '/' :
-                        res += "\\" + s[i];
-                        break;
+					case '.' :
+					case '?' :
+					case '^' :
+					case '$' :
+					case '+' :
+					case '{' :
+					case '[' :
+					case '|' :
+					case '(' :
+					case ')' :
+					case ']' :
+					case '/' :
+						res += "\\" + s[i];
+						break;
 
-                    case '\\' :
-                        res += "\\\\";
-                        break;
+					case '\\' :
+						res += "\\\\";
+						break;
 
-                    case ' ' :
-                        // Remove spaces from URLs.
-                        break;
+					case ' ' :
+						// Remove spaces from URLs.
+						break;
 
-                    default :
-                        res += s[i];
-                        break;
-                }
-            }
+					default :
+						res += s[i];
+						break;
+				}
+			}
 
-            return res + '$';
-        },
-        ConvertToRegExp: function( pattern ) {
-            if (this._isSimple( pattern ))
-                return new AutoPagerPLNS.SimpleRegExp( pattern );        
-            return new RegExp( this._convertToRegExpStr( pattern ), "i" );
-        },
-        CorrectRegExp: function( pattern ) {
-            var s = new String(pattern);
-            var res = new String("");
-            var escaped = false;
-            var c = '';
-            for (var i = 0 ; i < s.length ; i++) {
-                c = s[i];
-                if(c == '\\')
-                {
-                    escaped = !escaped;
-                    res += c;
-                }else
-                {
-                    if (c == '/' && !escaped)
-                    {
-                        res += "\\";
-                    }
-                    res+=c;
-                    escaped = false;
-                }
-            }
-            return new RegExp(res, "i");
-        }
-    }
+			return res + '$';
+		},
+		ConvertToRegExp: function( pattern ) {
+			if (this._isSimple( pattern ))
+				return new AutoPagerPLNS.SimpleRegExp( pattern );        
+			return new RegExp( this._convertToRegExpStr( pattern ), "i" );
+		},
+		CorrectRegExp: function( pattern ) {
+			var s = new String(pattern);
+			var res = new String("");
+			var escaped = false;
+			var c = '';
+			for (var i = 0 ; i < s.length ; i++) {
+				c = s[i];
+				if(c == '\\')
+				{
+					escaped = !escaped;
+					res += c;
+				}else
+				{
+					if (c == '/' && !escaped)
+					{
+						res += "\\";
+					}
+					res+=c;
+					escaped = false;
+				}
+			}
+			return new RegExp(res, "i");
+		}
+	}
 };
 
 var convertAutoPagerUrlSelectorToRegex = function( shouldBeRegex, urlPattern ) {
-    // the following logic taken directly from the AutoPager's autopager-util.js, and cleaned up
-    if ( !shouldBeRegex ) {
-        return AutoPagerPL.Utils.ConvertToRegExp( urlPattern );
-    }
+	// the following logic taken directly from the AutoPager's autopager-util.js, and cleaned up
+	if ( !shouldBeRegex ) {
+		return AutoPagerPL.Utils.ConvertToRegExp( urlPattern );
+	}
 
-    try {
-        return new RegExp( urlPattern );
-    } catch(re) {
-        try {
-            return new RegExp( AutoPagerPL.Utils.CorrectRegExp( urlPattern ) );
-        } catch(e) {
-            // error creating regexp, try to use it as pattern
-            return AutoPagerPL.Utils.ConvertToRegExp( urlPattern );
-        }        
-    }
+	try {
+		return new RegExp( urlPattern );
+	} catch(re) {
+		try {
+			return new RegExp( AutoPagerPL.Utils.CorrectRegExp( urlPattern ) );
+		} catch(e) {
+			// error creating regexp, try to use it as pattern
+			return AutoPagerPL.Utils.ConvertToRegExp( urlPattern );
+		}        
+	}
 };
 var pickMapFunction = function( anItem ) {
-    var nullMapper = function() { return null; };
+	var nullMapper = function() { return null; };
 
-    var autopagerizeMapper = function(i) { return i.data; };
-    var autopagerMapper = function(i) { 
-        var regexUrlSelectorPattern = convertAutoPagerUrlSelectorToRegex( i.r, i.u );
+	var autopagerizeMapper = function(i) { return i.data; };
+	var autopagerMapper = function(i) { 
+		var regexUrlSelectorPattern = convertAutoPagerUrlSelectorToRegex( i.r, i.u );
 
-        return {
-            _urlRegex:      regexUrlSelectorPattern,
-            urlFunc:        function( url ) {
-                return this._urlRegex.test( url );
-            },
-            nextLink:       i.n,
-            pageElement:    i.x
-        };
-    };
+		return {
+			_urlRegex:      regexUrlSelectorPattern,
+			urlFunc:        function( url ) {
+				return this._urlRegex.test( url );
+			},
+			nextLink:       i.n,
+			pageElement:    i.x
+		};
+	};
 
-    if( !anItem )
-        return nullMapper;
+	if( !anItem )
+		return nullMapper;
 
-    if( anItem.data )
-        return autopagerizeMapper;
+	if( anItem.data )
+		return autopagerizeMapper;
 
-    if( anItem.u && anItem.x && anItem.n )
-        return autopagerMapper;
+	if( anItem.u && anItem.x && anItem.n )
+		return autopagerMapper;
 
-    return nullMapper;
+	return nullMapper;
 };
 var getCacheCallback = function(res, urlInfo) {
-    if (res.status != 200)  {
-        return getCacheErrorCallback(urlInfo);
-    }
+	if (res.status != 200)  {
+		return getCacheErrorCallback(urlInfo);
+	}
 
-    var info;
-    try {
-        var parsedDatas;
-        try {
-            parsedDatas = JSON.parse(res.responseText);
-        } catch(e) {
-            log("couldnt parse json in getCacheCallback("+res + ", " + info + "). trying eval");
-            parsedDatas = eval(res.responseText);
-        }
+	var info;
+	try {
+		var parsedDatas;
+		try {
+			parsedDatas = JSON.parse(res.responseText);
+		} catch(e) {
+			log("couldnt parse json in getCacheCallback("+res + ", " + info + "). trying eval");
+			parsedDatas = eval(res.responseText);
+		}
 
-        var mapFn = pickMapFunction( parsedDatas[0] );
-        info = parsedDatas.map( mapFn ).filter( function(v) { return v!=null; });
-    } catch(e) {
-        log("getCacheCallback("+res + ", " + info + ") error:\r\n"+e);
-        info = [];
-    }
-    if (info.length < 0) {
-        return getCacheErrorCallback(urlInfo);
-    }
+		var mapFn = pickMapFunction( parsedDatas[0] );
+		info = parsedDatas.map( mapFn ).filter( function(v) { return v!=null; });
+	} catch(e) {
+		log("getCacheCallback("+res + ", " + info + ") error:\r\n"+e);
+		info = [];
+	}
+	if (info.length < 0) {
+		return getCacheErrorCallback(urlInfo);
+	}
 
-    var withoutUrl = info.filter(function(i) { return ('urls' in i) || ('urlFunc' in i); });
+	var withoutUrl = info.filter(function(i) { return ('urls' in i) || ('urlFunc' in i); });
 
-    var withUrl = info.filter(function(i) { return ('url' in i); });
-    withUrl.sort(function(a, b) { return (b.url.length - a.url.length); });
+	var withUrl = info.filter(function(i) { return ('url' in i); });
+	withUrl.sort(function(a, b) { return (b.url.length - a.url.length); });
 
-    info = withoutUrl.concat(withUrl);
-    /*info = info.filter(function(i) { return ('url' in i) || ('urls' in i) || ('urlFunc' in i); });
-    info.sort(function(a, b) { return (b.url.length - a.url.length); });*/
+	info = withoutUrl.concat(withUrl);
+	/*info = info.filter(function(i) { return ('url' in i) || ('urls' in i) || ('urlFunc' in i); });
+	info.sort(function(a, b) { return (b.url.length - a.url.length); });*/
 
-    /*
-    var r_keys = ['url', 'nextLink', 'insertBefore', 'pageElement'];
-    info = info.map(function(i) {
-        var item = {};
-        r_keys.forEach(function(key) {
-            if (i[key])
-            {
-                item[key] = i[key];
-            }
-        });
-        return item;
-    });*/
+	/*
+	var r_keys = ['url', 'nextLink', 'insertBefore', 'pageElement'];
+	info = info.map(function(i) {
+		var item = {};
+		r_keys.forEach(function(key) {
+			if (i[key])
+			{
+				item[key] = i[key];
+			}
+		});
+		return item;
+	});*/
 
-    cacheInfo[urlInfo.url] = {
-        url: urlInfo.url,
-        expire: new Date(new Date().getTime() + (urlInfo.expire || CACHE_EXPIRE)),
-        info: info
-    };
-    //try {
-    //  GM_setValue('cacheInfo', JSON.stringify(cacheInfo))
-    //} catch(e) {
-    //  log("couldnt convert to json for GM_setValue in getCacheCallback("+ e.toString() + "). trying toSource()");
-        GM_setValue('cacheInfo', cacheInfo.toSource());
-    //}
+	cacheInfo[urlInfo.url] = {
+		url: urlInfo.url,
+		expire: new Date(new Date().getTime() + (urlInfo.expire || CACHE_EXPIRE)),
+		info: info
+	};
+	//try {
+	//  GM_setValue('cacheInfo', JSON.stringify(cacheInfo))
+	//} catch(e) {
+	//  log("couldnt convert to json for GM_setValue in getCacheCallback("+ e.toString() + "). trying toSource()");
+		GM_setValue('cacheInfo', cacheInfo.toSource());
+	//}
 }
 var getCacheErrorCallback = function(urlInfo) {
-    var expire = new Date(new Date().getTime() + (urlInfo.expire || CACHE_EXPIRE));
-    if (cacheInfo[urlInfo.url]) {
-        cacheInfo[urlInfo.url].expire = expire;
-    } else {
-        cacheInfo[urlInfo.url] = {
-            url: urlInfo.url,
-            expire: expire,
-            info: []
-        };
-    }
+	var expire = new Date(new Date().getTime() + (urlInfo.expire || CACHE_EXPIRE));
+	if (cacheInfo[urlInfo.url]) {
+		cacheInfo[urlInfo.url].expire = expire;
+	} else {
+		cacheInfo[urlInfo.url] = {
+			url: urlInfo.url,
+			expire: expire,
+			info: []
+		};
+	}
 
-    GM_setValue('cacheInfo', cacheInfo.toSource());
+	GM_setValue('cacheInfo', cacheInfo.toSource());
 }
 
 var linkFilter = function(doc, url) {
-    var base = getFirstElementByXPath('//base[@href]', doc);
-    var baseUrl = base ? base.href : url;
-    var isSameBase = isSameBaseUrl(location.href, baseUrl);
-    if (!FORCE_TARGET_WINDOW && isSameBase) {
-        return;
-    }
+	var base = getFirstElementByXPath('//base[@href]', doc);
+	var baseUrl = base ? base.href : url;
+	var isSameBase = isSameBaseUrl(location.href, baseUrl);
+	if (!FORCE_TARGET_WINDOW && isSameBase) {
+		return;
+	}
 
-    // TODU: 
-    if (FORCE_TARGET_WINDOW || !isSameBase) {
-        var anchors = getElementsByXPath('descendant-or-self::a[@href]', doc);
-        anchors.forEach(function(i) {
-            var attrHref = i.getAttribute('href');
-            if (FORCE_TARGET_WINDOW && !attrHref.match(/^#|^javascript:/) && i.className.indexOf('autopagerize_link') < 0) {
-                i.target = '_blank';
-            }
-            if (!isSameBase && !attrHref.match(/^#|^\w+:/)) {
-                i.href = resolvePath(i.getAttribute('href'), baseUrl);
-            }
-        });
-    }
-    
-    if (!isSameBase) {
-        var images = getElementsByXPath('descendant-or-self::img', doc);
-        images.forEach(function(i) {
-            i.src = resolvePath(i.getAttribute('src'), baseUrl);
-        });
-    }
+	// TODU: 
+	if (FORCE_TARGET_WINDOW || !isSameBase) {
+		var anchors = getElementsByXPath('descendant-or-self::a[@href]', doc);
+		anchors.forEach(function(i) {
+			var attrHref = i.getAttribute('href');
+			if (FORCE_TARGET_WINDOW && !attrHref.match(/^#|^javascript:/) && i.className.indexOf('autopagerize_link') < 0) {
+				i.target = '_blank';
+			}
+			if (!isSameBase && !attrHref.match(/^#|^\w+:/)) {
+				i.href = resolvePath(i.getAttribute('href'), baseUrl);
+			}
+		});
+	}
+	
+	if (!isSameBase) {
+		var images = getElementsByXPath('descendant-or-self::img', doc);
+		images.forEach(function(i) {
+			i.src = resolvePath(i.getAttribute('src'), baseUrl);
+		});
+	}
 }
 AutoPager.documentFilters.push(linkFilter);
 
 fixResolvePath();
 
 if (typeof(window.AutoPagerize) == 'undefined') {
-    window.AutoPagerize = {};
-    window.AutoPagerize.addFilter = function(f) {
-        AutoPager.filters.push(f);
-    }
-    window.AutoPagerize.addDocumentFilter = function(f) {
-        AutoPager.documentFilters.push(f);
-    }
-    window.AutoPagerize.addResponseFilter = function(f) {
-        AutoPager.responseFilters.push(f);
-    }
-    window.AutoPagerize.addRequestFilter = function(f) {
-        AutoPager.requestFilters.push(f);
-    }
-    window.AutoPagerize.launchAutoPager = launchAutoPager;
+	window.AutoPagerize = {};
+	window.AutoPagerize.addFilter = function(f) {
+		AutoPager.filters.push(f);
+	}
+	window.AutoPagerize.addDocumentFilter = function(f) {
+		AutoPager.documentFilters.push(f);
+	}
+	window.AutoPagerize.addResponseFilter = function(f) {
+		AutoPager.responseFilters.push(f);
+	}
+	window.AutoPagerize.addRequestFilter = function(f) {
+		AutoPager.requestFilters.push(f);
+	}
+	window.AutoPagerize.launchAutoPager = launchAutoPager;
 
-    var ev = document.createEvent('Event');
-    ev.initEvent('GM_AutoPagerizeLoaded', true, false);
-    document.dispatchEvent(ev);
+	var ev = document.createEvent('Event');
+	ev.initEvent('GM_AutoPagerizeLoaded', true, false);
+	document.dispatchEvent(ev);
 }
 
 GM_registerMenuCommand('AutoPagerize - clear cache', clearCache);
 
 
 function AP_MakeAjaxRequest( url, callback ) {
-    var state = 0;
+	var state = 0;
 
-    var opt = {
-        method: 'GET',
-        url: url,
-        onload: function(res) {
-            state = 1;
-            callback( {
-                result: res,
-                ok: true
-            });
-        },
-        onerror: function(res) {
-            state = 2;
-            callback( {
-                result: res,
-                ok: false
-            });
-        },
-    };
-    setTimeout( function() {
-        if ( state == 0) {
-            callback( {
-                result: null,
-                ok: false
-            });
-        }
-    }, XHR_TIMEOUT);
+	var opt = {
+		method: 'GET',
+		url: url,
+		onload: function(res) {
+			state = 1;
+			callback( {
+				result: res,
+				ok: true
+			});
+		},
+		onerror: function(res) {
+			state = 2;
+			callback( {
+				result: res,
+				ok: false
+			});
+		},
+	};
+	setTimeout( function() {
+		if ( state == 0) {
+			callback( {
+				result: null,
+				ok: false
+			});
+		}
+	}, XHR_TIMEOUT);
 
-    GM_xmlhttpRequest(opt);
+	GM_xmlhttpRequest(opt);
 }
 
 
 
 /*
 refreshSingleSiteInfoImportUrl = (importItem) ->
-    cacheItem = cacheInfo[importItem.url]
-    if (cacheItem && new Date(cacheItem.expire) > dt)
-        return
+	cacheItem = cacheInfo[importItem.url]
+	if (cacheItem && new Date(cacheItem.expire) > dt)
+		return
 
-    await AP_MakeAjaxRequest importItem.url, defer result
+	await AP_MakeAjaxRequest importItem.url, defer result
 
-    if( result.ok )
-        getCacheCallback( result.result, importItem );
-    else
-        getCacheErrorCallback( importItem );
+	if( result.ok )
+		getCacheCallback( result.result, importItem );
+	else
+		getCacheErrorCallback( importItem );
 
 checkUpdateSiteInfoImportUrls = () ->
-    await
-        for importItem,i in SITEINFO_IMPORT_URLS
-            refreshSingleSiteInfoImportUrl importItem
+	await
+		for importItem,i in SITEINFO_IMPORT_URLS
+			refreshSingleSiteInfoImportUrl importItem
 
 tryLaunchSiteInfoImportUrls = () ->
-    for importItem,i in SITEINFO_IMPORT_URLS
-        cacheItem = cacheInfo[importItem.url]
-        if ( launchAutoPager cacheItem.info )
-            return true
-    return false
+	for importItem,i in SITEINFO_IMPORT_URLS
+		cacheItem = cacheInfo[importItem.url]
+		if ( launchAutoPager cacheItem.info )
+			return true
+	return false
 */
 // Generated by IcedCoffeeScript 1.4.0a