	function Mennu_bar2(id_pre,curcss,outcss)
	{
		var _this=this;
		this.t_id='';
		this.isopen = 0;
		this.obj_head = document.getElementById(id_pre+'-slow');
		this.obj_main = document.getElementById(id_pre);
		this.init = function()
		{
			this.obj_head.onmouseover = function()
			{
			
				_this.show();
			}
			
			
			this.obj_head.onmouseout = this.waite_hide;
			this.obj_main.onmouseover=this.keep_show;
			this.obj_main.onmouseout = this.waite_hide;
		}
		this.waite_hide=function()
		{
			
			_this.t_id = window.setTimeout(_this.hide,200);
		}
		this.hide = function()  
		{
			_this.obj_head.className=outcss;
			jQuery(_this.obj_main).slideUp('fast',_this.change_status);	
			
		}
		this.show = function()
		{
			_this.obj_head.className=curcss;
			if(_this.isopen==0)
			{
				jQuery(_this.obj_main).slideDown('fast',_this.change_status);
			}
			else
			{
				_this.keep_show();	
			}
		}
		this.change_status=function()
		{
			
			_this.isopen = _this.isopen==1?0:1;	
		}
		this.keep_show = function()
		{
			_this.obj_head.className=curcss;
			if(_this.t_id)
			{
				window.clearTimeout(_this.t_id)	
			}
		}
	}
	
	function upSideDown()
	{
		var _this=this;
		this.current_index=0;
		this.list_length= document.getElementById('contentInner').getElementsByTagName('li').length;
		this.obj = document.getElementById('content');
		this.list = document.getElementById('contentInner').getElementsByTagName('li');
		this.up_obj = document.getElementById('up');
		this.down_obj = document.getElementById('down');
		this.init_scroll=0;
		this.init = function()
		{
			//创建一个临时的方便滚动 第一个插在下边
			var  new_url = document.createElement('ul');
			new_url.id = "contentInnerTemp";
			new_url.innerHTML = document.getElementById('contentInner').innerHTML;
			this.obj.appendChild(new_url);
			//插入上边
			var new_ul = document.createElement('ul');
			new_ul.id = "contentInnerTemp2";
			new_ul.innerHTML = document.getElementById('contentInner').innerHTML;
			this.obj.insertBefore(new_ul,document.getElementById('contentInner'));
			this.init_scroll = this.list_length*this.list[0].offsetHeight;
			
			this.obj.scrollTop = this.init_scroll;
			try
			{
				this.up_obj.onclick=this.up;
				this.down_obj.onclick=this.down;
			}
			catch(e)
			{
					
			}
			//自动滚动
			
			window.setInterval(this.down,3000);
		}
		this.up=function()
		{
			if(_this.current_index>=1)
			{
				_this.scol(_this.list[_this.current_index].offsetHeight,-1);
				_this.current_index--;
			}
			else
			{
				_this.scol(_this.list[_this.current_index].offsetHeight,-1,-2);
				_this.current_index=-1;//临时状态
			}
		}
		this.down=function()
		{
			if(_this.current_index<(_this.list_length-1))
			{
				_this.scol(_this.list[_this.current_index].offsetHeight,1);
				_this.current_index++;
			}
			else
			{
				_this.scol(_this.list[_this.current_index].offsetHeight,1,-1);
				_this.current_index=-1;//临时状态
			}
		}
		this.lock_button=function(flag)
		{
			if(flag)
			{
				_this.up.onclick=function(){};
				_this.down.onclick=function(){};
			}
			else
			{
				_this.up_obj.onclick=_this.up;
				_this.down_obj.onclick=_this.down;
			}
		}
		this.scol = function(height,step,istemp)
		{
			_this.lock_button(true);
			if(height>0)
			{
				_this.obj.scrollTop+=step;
				window.setTimeout(function(){_this.scol(--height,step,istemp);},10);
			}
			else
			{
				_this.lock_button(false);
				if(istemp==-1)
				{
					_this.current_index=0;
					_this.obj.scrollTop=0;
				}
				else if(istemp==-2)
				{
					_this.current_index=_this.list_length-1;
					
					_this.obj.scrollTop = _this.init_scroll+(_this.list_length-1)*_this.list[0].offsetHeight;
				}
			}
			
		}
		
	}
	
	function Program()
			{
				var $ = jQuery;
				var d = new Date();
				time = d.getHours()+':'+d.getMinutes();
				$.ajax({
					  type: "post",
					  url: '/program/ajax_html/current_program.php',
					  dataType:"text",
					  data: 'w='+d.getDay()+'&time='+time,
					  beforeSend: function(XMLHttpRequest){
					  jQuery("#contentInner").html('正在加载当前节目...');
					  },
					  success: function(data){
						  try
						  {
						   		eval("var result = "+data);
								var html='';
								for(i=0;i<result.length;i++)
								{
									if(typeof(which_tv)!='undefined')
									{
										if(result[i].tvid==which_tv)
										{
											html+='<li><a href="portal.php?mod=live_room&class=jump&act=jump&jid='+result[i].aid+'"><font>[ '+result[i].program+' ]</font><em>-</em>'+result[i].title+'<em>-</em>'+result[i].master+'</a></li>';		
										}
									}
									else
									{
										html+='<li><a href="portal.php?mod=live_room&class=jump&act=jump&jid='+result[i].aid+'"><font>[ '+result[i].program+' ]</font><em>-</em>'+result[i].title+'<em>-</em>'+result[i].master+'</a></li>';	
									}
								}
								html = (html=='')?'当前无节目':html;
								jQuery("#contentInner").html(html);
								var upsidedown = new upSideDown();
								upsidedown.init();
							  
						  }
						  catch(e)
						  {
							    alert(e.message)
						  		alert(data);
						  }
					  }
				})
				
			}
	function showUserMsg()
	{
		var $ = jQuery;
	  	$.ajax({
	      type: "post",
	      url: "/home/getstatus.php",
	      dataType:"text/html",
	      data: "",
	      beforeSend: function(XMLHttpRequest){
	         jQuery("#userloading").html('正在加载...');
	      },
	      success: function(data){
	    	
	    		eval("var data_json="+data);
	    		
	    		if( data_json && data_json.uid )
	    		{
	    			 username = data_json.username;
	    			 uid = data_json.uid;
	    			str = '欢迎您：<a target="_blank" href="/home/space.php?'+uid+'">'+username+'</a>&nbsp;'
	    			+'<a target="_blank" href="/home/space.php?'+uid+'">我的空间</a>&nbsp;&nbsp;'+'<a href="javascript:void()" onclick="user_loginout()">退出</a>';
	    			jQuery("#userloading").html(str);
	    		}else
	    		{
					var user_init = '<a href="/home/member.php?mod=logging&action=login&refer=/home/" onclick="showWindow(\'login\', this.href)">登录</a><em>|</em><a href="/home/member.php?mod=register.php">注册</a>';
	    			jQuery("#userloading").html(user_init);
	    		}
	      }
	  	});
   }
  
  
   function user_loginout()
   {
	  var $ = jQuery;
	 	$.ajax({
		      type: "post",
		      url: "/home/logout.php",
		      dataType:"text/html",
		      data: "",
		      beforeSend: function(XMLHttpRequest){
		         jQuery("#userloading").html('正在退出...');
		      },
		      success: function(data){
		    	  showUserMsg();
		      }
		  	});
   }
  var data_list = '<dl  onClick=\"play_radio(\'\',this,3)\">          <dt><a href=\"portal.php?mod=online_radio#\" ><img src=\"images/logo/105_logo.png\" width=\"50\" height=\"50\" /></a></dt>          <dd>            <strong><a href=\"portal.php?mod=online_radio#\">交通广播</a></strong>            <span>智者乐行</span>          </dd>        </dl>                <dl onClick=\"play_radio(\'\',this,7)\">          <dt><a href=\"portal.php?mod=online_radio#\" ><img src=\"images/logo/792_logo.png\" width=\"50\" height=\"50\" /></a></dt>          <dd>            <strong><a href=\"portal.php?mod=online_radio#\">都市广播</a></strong>            <span>爱家爱生活</span>          </dd>        </dl>                <dl  onClick=\"play_radio(\'\',this,5)\">          <dt><a href=\"portal.php?mod=online_radio#\"><img src=\"images/logo/101_logo.png\" width=\"50\" height=\"50\" /></a></dt>          <dd>            <strong><a href=\"portal.php?mod=online_radio#\">动感101</a></strong>            <span>大声听音乐</span>          </dd>        </dl>                <dl onClick=\"play_radio(\'\',this,6)\">          <dt><a href=\"portal.php?mod=online_radio#\"><img src=\"images/logo/103_logo.png\" width=\"50\" height=\"50\" /></a></dt>          <dd>            <strong><a href=\"portal.php?mod=online_radio#\">Love Radio</a></strong>            <span>听见你的最爱</span>          </dd>        </dl>                <dl onClick=\"play_radio(\'\',this,1)\">          <dt><a href=\"portal.php?mod=online_radio#\" ><img src=\"images/logo/947_logo.png\" width=\"50\" height=\"50\" /></a></dt>          <dd>            <strong><a href=\"portal.php?mod=online_radio#\">经典947</a></strong>            <span>经典你的音乐生活</span>          </dd>        </dl>                <dl onClick=\"play_radio(\'\',this,2)\">          <dt><a href=\"portal.php?mod=online_radio#\" ><img src=\"images/logo/97_logo.png\" width=\"50\" height=\"50\" /></a></dt>          <dd>            <strong><a href=\"portal.php?mod=online_radio#\">戏剧曲艺</a></strong>            <span>传承百年活力呈现</span>          </dd>        </dl>                <dl onClick=\"play_radio(\'\',this,4)\">          <dt><a href=\"portal.php?mod=online_radio#\" ><img src=\"images/logo/107_logo.png\" width=\"50\" height=\"50\" /></a></dt>          <dd>            <strong><a href=\"portal.php?mod=online_radio#\">故事广播</a></strong>            <span>缤纷故事闪亮生活</span>          </dd>        </dl>                                <dl onClick=\"play_radio(\'\',this,8)\">          <dt><a href=\"portal.php?mod=online_radio#\" ><img src=\"images/logo/dgxw.png\" width=\"50\" height=\"50\" /></a></dt>          <dd>            <strong><a href=\"portal.php?mod=online_radio#\">东广新闻</a></strong>            <span></span>          </dd>        </dl>                <dl onClick=\"play_radio(\'\',this,10)\">          <dt><a href=\"portal.php?mod=online_radio#\" ><img src=\"images/logo/dycj.png\" width=\"50\" height=\"50\" /></a></dt>          <dd>            <strong><a href=\"portal.php?mod=online_radio#\">第一财经</a></strong>            <span></span>          </dd>        </dl>                <dl onClick=\"play_radio(\'\',this,9)\">          <dt><a href=\"portal.php?mod=online_radio#\" ><img src=\"images/logo/shrmdt.png\" width=\"50\" height=\"50\" /></a></dt>          <dd>            <strong><a href=\"portal.php?mod=online_radio#\">上海人民广播</a></strong>            <span></span>          </dd>        </dl>                <dl onClick=\"play_radio(\'\',this,11)\">          <dt><a href=\"portal.php?mod=online_radio#\" ><img src=\"images/logo/typd.png\" width=\"50\" height=\"50\" /></a></dt>          <dd>            <strong><a href=\"portal.php?mod=online_radio#\">五星体育</a></strong>            <span></span>          </dd>        </dl>';
