/**
 * @requires StringUtil.js
 */
if(typeof(Page) == "undefined")
	Page = {};

Page.Theme = {
	showTodayTheme: function(obj, index, maxcount) {
		for (i = 0 ; i < maxcount ; i++) {
			if(index == i) {
				$("popular_menu" +i).className = 'list_on';
				$("popular_theme" +i).show();
			}else {
				$("popular_menu" +i).className = '';
				$("popular_theme" +i).hide();
			}
		}
	},
	
	changeTab: function(opt) {
	    if (opt != this.tabopt) {
	        var url = "/page/home/get_uplink_xml.php";
	        var postdata = "opt=" + opt;
	        
			new Ajax.Request(url, {
				method: 'post',
				parameters: postdata,
				onSuccess: function (transport) {
					var response = transport.responseText;
					$('mylink').update(response);
				}
			});
			
	        this.tabopt = opt;
	        if (opt == 1) {
	            $("linktab1").className = "left_tap_on";
	            $("linktab1bg").className = "tap_on";
	            $("linktab2").className = "right_tap_off";
	            $("linktab2bg").className = "tap_off";
	        }
	        else if (opt == 2) {
	            $("linktab1").className = "left_tap_off";
	            $("linktab1bg").className = "tap_off";
	            $("linktab2").className = "right_tap_on";
	            $("linktab2bg").className = "tap_on";
	        }
	        return true;
	    }
	}
}
