/*
*	modello框架
**
*	author 贺博
*	version 2007-8-28
**
*	收费库
*/
VWebFav = Class.create(CWebFav);
VWebFav.register("com.duxiu.js.VWebFav");

VWebFav.construct = function($self, $class){
	
	this.transformHTML = function(xml){
		return UtilTool.transformXml("/vrp_showfav.xsl" , xml);		
	}
	
	this.checkConsume = function(){
		if(this.getRepType()==0||this.pageController.getCurPage()<=3){			
			return true;		
		}
		return false;	
	}
	
	this.getUrl =  function(action ,  obj ){		
		var url = action + "?rpid=" +obj.repid
			+"&cataid=-1"
			+"&linkname="	+	notNull(encodeURIComponent(obj.linkName))
			+"&curpage="	+	notNull(obj.curpage)
			+"&show="	+	notNull(obj.bshow)
			+"&sw="		+	notNull(encodeURIComponent(obj.sw))
			+"&searchType="	+	notNull(obj.searchType)
			+"&type=1"
			+"&"+this.toUrlTimestamps();
		return url;
	}
		
	this.reprintPage = function(){
		g('pageController1').innerHTML
			= g('pageController2').innerHTML 
			= this.pageController.toNavigationHTML(true);
		
	}	
	
	var istitle;
	this.goToCatalog = function(cid , lnk , _parent_xml , _istitle){
		istitle = formatNumber(_istitle,0);
		var page  = this.pageController.getPageByIndex(istitle);
		if(page ==0 ) page=1;		
		
		this.pageController.skipToPage(page , true);
	}
	
	this.afterResetPage = function(){		
		if(istitle!=0){	
			var i = (istitle+4)%5;
			var c =  document.getElementsByName('favid');
			setTimeout(function(){
				  window.scroll(0, UtilTool.getDomOffset(c[i] , true).y-10);
			}, 500);			
			istitle=0;
		}
		else{
			window.scroll(0, 0);	
		}
	}
}
