$(document).ready(function(){
	$menus = $('#menus > li');
	$menus.each(function(){
		$(this).hover(
			function(){
				$(this).children('ul:eq(0)').show();
			},
			function(){
				$(this).children('ul:eq(0)').hide();
			}
		);
	});
});

var pubLibs = {
	autoScrollMiniblog: function(){
		var $ul = $("#miniblog").children("ul:eq(0)");
		$ul.children("li:last").prependTo($ul);
		setTimeout('pubLibs.autoScrollMiniblog()',4000);
	},
	allSelect: function(objName){//全选
		$('#'+objName+' :checkbox').attr('checked','checked');
	},
	otherSelect: function(objName){//反选
		$('#'+objName+' :checkbox').each(function(){
			if($(this).attr('checked')){
				$(this).attr('checked','');
			}
			else{
				$(this).attr('checked','checked');
			}
		});
	},
	player: function(objName){//连放
		var isiPad = navigator.userAgent.match(/iPad|iPhone|iPod/i) != null;
		var mIdSrt = '';
		$('#'+objName+' :checkbox').each(function(){
			if($(this).attr('checked')){
				mIdSrt += $(this).val() + ',';
			}
		});
		if(mIdSrt){
			window.open('/playsong.php?id=' + mIdSrt.substr(0, mIdSrt.length-1), 'p');
		}
		else{
			alert('您没有选择要连放的舞曲！');
		}
	},
	getPage: function(maxpage){
		if ($("#pagenum").val()==""){
			err_alert("请输入要转向的页数！");
		}else if(parseInt(maxpage)<parseInt($("#pagenum").val())){
			err_alert("本类最大页数为"+maxpage+"！");
		}else{
			window.location.href="../"+$("#pagenum").val()+"/"
		}
	}
}
