//滑动窗口
function setTab1(name,cursel,n){
	 for(i=1;i<=n;i++){
		  var menu=document.getElementById(name+i);
		  var con=document.getElementById("con_"+name+"_"+i);
		  menu.className=i==cursel?"hover":"";
		  con.style.display=i==cursel?"block":"none";
	 }
	 if(cursel==1){
		document.getElementById("con_one_4").style.display="block";
	 }
	 else{
		document.getElementById("con_one_4").style.display="none";
	 }
}

$(function(){
	$(".listCon ul").hover(function(){
		$(this).css("background-color","#e6f4ff");
	},function(){
		$(this).css("background-color","#fff");
	});
});



function editTitle(aid)
{
   var show = document.getElementById("show_news");
  
   var myajax = new DedeAjax(show,false,false,"","","");
   myajax.SendGet2("ajax.php?id="+aid);
   DedeXHTTP = null;
}

//触发函数
function AlertMsg(title,id){
	var msgw,msgh,msgbg,msgcolor,bordercolor,titlecolor,titlebg,content; 
	//弹出窗口设置
	msgw = 770;		//窗口宽度 
	msgh = 60;		//窗口高度 
	msgbg = "#FFF";			//内容背景
	msgcolor = "#000";		//内容颜色
	bordercolor = "#aaa"; 	//边框颜色 
	titlecolor = "#254015";	//标题颜色
	titlebg = "#fdf5f5 url(img/tbg.gif)";		//标题背景
	//遮罩背景设置 
	var contents = 	document.getElementById("tex").value;
	if(contents=="" || contents=="请输入你要查找的游戏名"){
	 alert("请输入标题进行搜索!");
	 return false;
	}
	content = "<div id=show_news></div>";
		
	var sWidth,sHeight; 
	sWidth = screen.availWidth; 
	if(screen.availHeight > document.body.scrollHeight){
		sHeight = screen.availHeight;	//少于一屏
	}else{
		sHeight = document.body.scrollHeight;	//多于一屏 
	}
	
	//mask遮罩层
    var newMask = document.createElement("div");
    newMask.id = "mask";
    newMask.style.position = "absolute";
    newMask.style.zIndex = "1";
    _scrollWidth = Math.max(document.body.scrollWidth,document.documentElement.scrollWidth);
    _scrollHeight = Math.max(document.body.scrollHeight,document.documentElement.scrollHeight);
    newMask.style.width = _scrollWidth + "px";
    newMask.style.height = _scrollHeight + "px";
    newMask.style.top = "0px";
    newMask.style.left = "0px";
    newMask.style.background = "#33393C";
    newMask.style.filter = "alpha(opacity=40)";
    newMask.style.opacity = "0.40";
    document.body.appendChild(newMask);

	//创建弹出窗口
	var msgObj = document.createElement("div") 
	msgObj.setAttribute("id","msgdiv"); 
	msgObj.style.position ="absolute";
	//msgObj.style.top = (screen.availHeight - msgh) / 2 + "px";
	msgObj.style.left = (screen.availWidth - msgw) / 2 + "px";
	msgObj.style.top = "150px";
	//msgObj.style.left = "100px";
	msgObj.style.width = msgw + "px";
	msgObj.style.height = msgh + "px";
	msgObj.style.fontSize = "12px";
	msgObj.style.background = msgbg;
	//msgObj.style.border = "1px solid " + bordercolor; 
	msgObj.style.zIndex = "10001"; 
	//创建标题
	var thObj = document.createElement("div");
	thObj.setAttribute("id","msgth"); 
	thObj.className = "DragAble";
	thObj.style.color = titlecolor;
	thObj.style.fontWeight = 'bold';
	var titleStr = "<a class='close' title='关闭' onclick='CloseMsg()'>关闭</a>"+"<span>"+ title +"</span>";
	//var titleStr = "<input class='close' type='submit' value='关闭'  onclick='CloseMsg()' />"+"<span>"+ title +"</span>";
	thObj.innerHTML = titleStr;
	//创建内容
	var bodyObj = document.createElement("div");
	bodyObj.setAttribute("id","msgbody"); 
	bodyObj.style.padding = "0px";
	bodyObj.style.lineHeight = "18px";
	var txt = document.createTextNode(content);
	bodyObj.appendChild(txt);
	bodyObj.innerHTML = content;
	//生成窗口
	document.body.appendChild(msgObj);
	document.getElementById("msgdiv").appendChild(thObj);
	document.getElementById("msgdiv").appendChild(bodyObj);
	editTitle(contents);
}
function CloseMsg(){
	//移除对象
	//document.body.removeChild($("maskdiv")); 
	document.getElementById("msgdiv").removeChild(document.getElementById("msgth")); 
	document.getElementById("msgdiv").removeChild(document.getElementById("msgbody")); 
	document.body.removeChild(document.getElementById("msgdiv")); 
	document.body.removeChild(document.getElementById("mask")); 
}

//document.onmousedown = initDrag;   
document.onmouseup = new Function("isdrag=false");  


