function cateSch(fa){
	//地区 性别 星座 排序（周人气、总人气、年龄-从小到大-没有年龄的排最后）
	this.frmAction = fa;
	this.container = document.getElementById("cscontainer");
	this.gbar = "<select name=\"g\" id=\"gender\"><option>Loading...<\/option><\/select>";
	this.cbar = "<select name=\"c\" id=\"country\"><option>Loading...<\/option><\/select>";
	this.conbar = "<select name=\"cons\" id=\"constellation\"><option>Loading...<\/option><\/select>";
	this.sbar = "<select name=\"sort\" id=\"sort\"><option>Loading...<\/option><\/select>";
	this.btn = "<input type=\"button\" id=\"submitBtn\" value=\"search\" />"
	this.params = document.location.search;
	this.nbox = '';

	this._c = this._g = this._con = this._s = "";
	this._country_ary = [1,'Afghanistan',2,'Albania',3,'Algeria',4,'Andorra',5,'Angola',6,'Antigua and Barb',7,'Argentina',8,'Armenia',9,'Aruba',10,'Australia',11,'Austria',12,'Azerbaijan',13,'Bahamas',14,'Bahrain',15,'Bangladesh',16,'Barbados',17,'Belarus',18,'Belgium',19,'Belize',20,'Benin',21,'Bhutan',22,'Bolivia',23,'Bosnia-Herzegov',24,'Botswana',25,'Brazil',26,'Bulgaria',27,'Burkina Faso',28,'Burma',29,'Burundi',30,'Cambodia',31,'Cameroon',32,'Canada',33,'Cape Verde',34,'Central African',35,'Chad',36,'Chile',37,'China',38,'Colombia',39,'Congo',40,'Costa Rica',41,'Croatia',42,'Cuba',43,'Cyprus',44,'Czech Republic',45,'Czechoslovakia',46,'Democratic Republic of Congo',47,'Denmark',48,'Djibouti',49,'Dominican Republic',50,'East Germany',51,'Ecuador',52,'Egypt',53,'El Salvador',54,'Eritrea',55,'Estonia',56,'Ethiopia',57,'Federal Republic of Yugoslavia',58,'Finland',59,'France',60,'Gabon',61,'Georgia',62,'Germany',63,'Ghana',64,'Greece',65,'Greenland',66,'Guadeloupe',67,'Guatemala',68,'Guinea',69,'Guinea-Bissau',70,'Guyana',71,'Haiti',72,'Honduras',73,'Hong Kong',74,'Hungary',75,'Iceland',76,'India',77,'Indonesia',78,'Iran',79,'Iraq',80,'Ireland',81,'Israel',82,'Italy',83,'Ivory Coast',84,'Jamaica',85,'Japan',86,'Jordan',87,'Kazakhstan',88,'Kenya',89,'Korea',90,'Kosovo',91,'Kuwait',92,'Kyrgyzstan',93,'Laos',94,'Latvia',95,'Lebanon',96,'Libya',97,'Liechtenstein',98,'Lithuania',99,'Luxembourg',100,'Macau',101,'Madagascar',102,'Malaysia',103,'Mali',104,'Malta',105,'Martinique',106,'Mauritania',107,'Mauritius',108,'Mexico',109,'Moldova',110,'Monaco',111,'Mongolia',112,'Morocco',113,'Mozambique',114,'Namibia',115,'Nepal',116,'Netherlands',117,'New Zealand',118,'Nicaragua',119,'Niger',120,'Nigeria',121,'Niue',122,'North Korea',123,'North Vietnam',124,'Norway',125,'Oman',126,'Pakistan',127,'Palestine',128,'Panama',129,'Papua New Guinea',130,'Paraguay',131,'Peru',132,'Philippines',133,'Poland',134,'Portugal',135,'Puerto Rico',136,'Republic of Mac',137,'Romania',138,'Russia',139,'Rwanda',140,'San Marino',141,'Saudi Arabia',142,'Senegal',143,'Serbia and Monte',144,'Seychelles',145,'Siam',146,'Singapore',147,'Slovakia',148,'Slovenia',149,'Somalia',150,'South Africa',151,'South Korea',152,'Soviet Union',153,'Spain',154,'Sri Lanka',155,'Sudan',156,'Suriname',157,'Sweden',158,'Switzerland',159,'Syria',160,'Taiwan',161,'Tajikistan',162,'Tanzania',163,'Thailand',164,'Togo',165,'Tonga',166,'Trinidad And Tobago',167,'Tunisia',168,'Turkey',169,'Turkmenistan',170,'Uganda',171,'UK',172,'Ukraine',173,'United Arab Emirates',174,'Uruguay',175,'USA',176,'Uzbekistan',177,'Venezuela',178,'Vietnam',179,'West Germany',180,'Yugoslavia',181,'Zaire',182,'Zambia',183,'Zimbabwe'];
	this._sort_ary = [2,'views',3,'age'];
	this._cons_ary = ['Capricorn','Aquarius','Pisces','Aries','Taurus','Gemini','Cancer','Leo','Virgo','Libra','Scorpio','Sagittarius'];
	this._gender_ary = [1,'male',2,'female'];
}

cateSch.prototype.init = function(){
	//gender=[gender]&country=[country]&constellation=[year]&order=[week_view|year|total_view]&page=<page>
	re = /\?gender\=(.*?)\&country\=(.*?)\&constellation\=(.*?)\&order\=(.*?)&page=.*/g;
	
	this._g = this.params.replace(re,"$1");
	this._c = this.params.replace(re,"$2");
	this._con = this.params.replace(re,"$3");
	this._s = this.params.replace(re,"$4");

	var sbuilder = new stringBuilder();
	sbuilder.Append("country:");
	sbuilder.Append(this.cbar);
	sbuilder.Append("gender:");
	sbuilder.Append(this.gbar);
	sbuilder.Append("constellation:");
	sbuilder.Append(this.conbar);
	sbuilder.Append("sorted by:");
	sbuilder.Append(this.sbar);
	sbuilder.Append(this.btn);
	this.container.innerHTML = sbuilder.toString("");
}

cateSch.prototype.showSchGBar = function(){
		this._buildBar("==select gender==",this._gender_ary,"gender",2,1,this._g,'');
}

cateSch.prototype.showSchCBar = function(){
		this._buildBar("==select country==",this._country_ary,"country",2,1,this._c,'');
}

cateSch.prototype.showSchConBar = function(){
		this._buildBar("==select constellation==",this._cons_ary,"constellation",1,0,this._con,'');
}

cateSch.prototype.showSchSBar = function(){
		this._buildBar("views",this._sort_ary,"sort",2,1,this._s,1);
}

cateSch.prototype._buildBar = function(stitle,ary,soid,t,tt,sv,dvalue){
	var oc = document.getElementById(soid);
	for(var i = 0;i<oc.options.length;i++){
		oc.options[i] = null;
	}
	var oOption = document.createElement("OPTION");
	oc.options.add(oOption);
	oOption.innerHTML = stitle;
	oOption.value = dvalue;

	var j = 1;
	for(i=0;i<ary.length;i+=t){
		oOption = document.createElement("OPTION");
		oc.options.add(oOption);
		oOption.innerHTML = ary[i+tt];
		oOption.value = ary[i];
		if(!isNaN(ary[i])){
			if(sv == ary[i]){
				oc.options[j].selected = true;
			}
		}else{
			if(sv.toLowerCase() == ary[i].toLowerCase()){
				oc.options[j].selected = true;
			}
		}
		j++;
	}
}

cateSch.prototype._submitBtn_onclicked = function(){
	try{
		var cc = document.getElementById('country');
		var gg = document.getElementById('gender');
		var con = document.getElementById('constellation');
		var ss = document.getElementById('sort');

		this._c = cc.options[cc.selectedIndex].value;
		this._g = gg.options[gg.selectedIndex].value;
		this._con = con.options[con.selectedIndex].value;
		this._s = ss.options[ss.selectedIndex].value;
		
		window.location.href = this.frmAction + "?gender="+this._g+"&country="+this._c+"&constellation="+escape(this._con)+"&order="+this._s+"&Page=1";
		return;
	}
	catch(ex){}

	throw new Error("Submit Error!");
}