$(function (){
	$('.flashTrun label span,.itemMode label span').css({"position":"relative"})
	$('.flashTrun label span img,.itemMode label span img').css({"display":"none","position":"absolute","left":"-30px","top":"22px"})
	$('.flashTrun label,.itemMode label,.verCodeBox').mouseover(function (){
		$(this).find('img').css({"display":""})
		$(this).hover(function (){
			
		},function (){
			$(this).find('img').css({"display":"none"})
		});
	});

	CheckStati();
	CheckShare();
	CheckShareNews();
	CheckTopLogoMode();
	CheckWeather();

	CheckNavHome();
	CheckNavMessage();
	CheckNavBbs();

	CheckHomeFlashMode();
	CheckHomeAnnoun();
	CheckHomeMarImg();
	CheckHomeMessage();
	CheckHomeReply();

	CheckNewsVote();
	CheckNewsReply();
	CheckMessage();

	CheckHtmlHome();
	CheckHtmlUrlSel();

	WindowHeight(0);setTimeout("WindowHeight(0)",500);

});

// 检测表单
function CheckForm(){

}


function CheckShowBox(str){
	if (str=="open" || str=="sysBase"){ BoxTrunBtn('sysBase',1); }else{ BoxTrunBtn('sysBase',2); }
	if (str=="open" || str=="webTopSet"){ BoxTrunBtn('webTopSet',1); }else{ BoxTrunBtn('webTopSet',2); }
	if (str=="open" || str=="webBottomSet"){ BoxTrunBtn('webBottomSet',1); }else{ BoxTrunBtn('webBottomSet',2); }
	if (str=="open" || str=="webNav"){ BoxTrunBtn('webNav',1); }else{ BoxTrunBtn('webNav',2); }
	if (str=="open" || str=="homeSet"){ BoxTrunBtn('homeSet',1); }else{ BoxTrunBtn('homeSet',2); }
	if (str=="open" || str=="listShow"){ BoxTrunBtn('listShow',1); }else{ BoxTrunBtn('listShow',2); }
	if (str=="open" || str=="htmlSet"){ BoxTrunBtn('htmlSet',1); }else{ BoxTrunBtn('htmlSet',2); }
	if (str=="open" || str=="htmlUrl"){ BoxTrunBtn('htmlUrl',1); }else{ BoxTrunBtn('htmlUrl',2); }
}

// 清除JS脚本内容
function ClearJsData(){
	if (confirm("你确定要清除JS脚本内容？\n\n当该页面保存提交时，如果出现安全狗拦截或提示有危险代码不能提交才需要点击该按钮。")==true){
		$id('statiCode').value = "";
		$id('shareCode').value = "";
		$id('topWeatherCode').value = "";
		alert("已清除[统计代码][“分享到”代码][页头天气预报代码]该3栏内容。");
	}

}

// 检测关闭时间框是否打开
function CheckCloseK(){
	if ($id("isClose").value=="15" || $id("isClose").value=="5"){
		$id("closeTimeK").style.display="";
	}else{
		$id("closeTimeK").style.display="none";
	}
	if ($id("isClose").value=="15" || $id("isClose").value=="10" || $id("isClose").value=="5"){
		$id("closeNoteK").style.display="";
	}else{
		$id("closeNoteK").style.display="none";
	}
	WindowHeight(0);
}


// 检测统计代码框
function CheckStati(){
	if ($id('isStati1').checked){
		$id("statiBox").style.display="";
	}else{
		$id("statiBox").style.display="none";
	}
	WindowHeight(0);
}

// 检测“分享到”代码框
function CheckShare(){
	if ($id('isShare1').checked){
		$id("shareBox").style.display="";
	}else{
		$id("shareBox").style.display="none";
	}
	WindowHeight(0);
}

// 检测内容页“分享到”代码框
function CheckShareNews(){
	if ($id('isShareNews1').checked){
		$id("shareNewsBox").style.display="";
	}else{
		$id("shareNewsBox").style.display="none";
	}
	WindowHeight(0);
}


// 检测页头logo模式
function CheckTopLogoMode(){
	if ($id('topLogoMode1').checked){
		$id("fullLogoBox").style.display="";
		$id("logoBox").style.display="none";
	}else{
		$id("fullLogoBox").style.display="none";
		$id("logoBox").style.display="";
	}
	WindowHeight(0);
}

// 检测天气预报代码框
function CheckWeather(){
	if ($id('isTopWeather1').checked){
		$id("weatherBox").style.display="";
	}else{
		$id("weatherBox").style.display="none";
	}
	WindowHeight(0);
}

// 设置页头天气预报代码
function GetTopWeatherCode(num){
	var codeStr="";

	switch (num){
		case 1:
			codeStr = "<iframe id='weatherBox' src='http://m.weather.com.cn/m/pn7/weather.htm' width='195' height='20' marginwidth='0' marginheight='0' hspace='0' vspace='0' frameborder='0' allowtransparency='true' scrolling='no' style='margin-top:4px;'></iframe>";
			break;

		case 2:
			codeStr = "<iframe name='weather_inc' src='http://tianqi.xixik.com/cframe/5' width='157' height='30' frameborder='0' allowtransparency='true' marginwidth='0' marginheight='0' scrolling='no' ></iframe>";
			break;
	
	}
	$id('topWeatherCode').value=codeStr;
}

// 检测导航首页菜单
function CheckNavHome(){
	if ($id('isNavHome1').checked){
		$id("navHomeBox").style.display="";
	}else{
		$id("navHomeBox").style.display="none";
	}
	WindowHeight(0);
}

// 检测导航留言本菜单
function CheckNavMessage(){
	if ($id('isNavMessage1').checked){
		$id("navMessageBox").style.display="";
	}else{
		$id("navMessageBox").style.display="none";
	}
	WindowHeight(0);
}

// 检测导航论坛菜单
function CheckNavBbs(){
	if ($id('isNavBbs1').checked){
		$id("navBbsBox").style.display="";
	}else{
		$id("navBbsBox").style.display="none";
	}
	WindowHeight(0);
}

// 检测首页幻灯片
function CheckHomeFlashMode(){
	if ($id('homeFlashMode100').checked){
		$id("homeVideoBox").style.display="";
		$id("homeFlashBox").style.display="none";
	}else{
		$id("homeVideoBox").style.display="none";
		$id("homeFlashBox").style.display="";
	}
	WindowHeight(0);
}

// 检测首页公告栏目
function CheckHomeAnnoun(){
	if ($id('isHomeAnnoun1').checked){
		$id("homeAnnounBox").style.display="";
	}else{
		$id("homeAnnounBox").style.display="none";
	}
	WindowHeight(0);
}

// 检测首页滚动图片
function CheckHomeMarImg(){
	if ($id('isHomeMarImg1').checked){
		$id("homeMarImgBox").style.display="";
	}else{
		$id("homeMarImgBox").style.display="none";
	}
	WindowHeight(0);
}

// 检测首页最新留言
function CheckHomeMessage(){
	if ($id('isHomeMessage1').checked){
		$id("homeMessageBox").style.display="";
	}else{
		$id("homeMessageBox").style.display="none";
	}
	WindowHeight(0);
}

// 检测首页最新评论
function CheckHomeReply(){
	if ($id('isHomeReply1').checked){
		$id("homeReplyBox").style.display="";
	}else{
		$id("homeReplyBox").style.display="none";
	}
	WindowHeight(0);
}

// 检测文章投票
function CheckNewsVote(){
	if ($id('isNewsVote1').checked){
		$id("newsVoteBox").style.display="";
	}else{
		$id("newsVoteBox").style.display="none";
	}
	WindowHeight(0);
}

// 检测文章评论
function CheckNewsReply(){
	if ($id('isNewsReply0').checked){
		$id("newsReplyBox").style.display="none";
	}else{
		$id("newsReplyBox").style.display="";
	}
	WindowHeight(0);
}

// 检测留言
function CheckMessage(){
	if ($id('isMessage0').checked){
		$id("messageBox").style.display="none";
	}else{
		$id("messageBox").style.display="";
	}
	WindowHeight(0);
}

// 检测首页静态页
function CheckHtmlHome(){
	if ($id('isHtmlHome1').checked){
		$id("htmlHomeBox").style.display="";
	}else{
		$id("htmlHomeBox").style.display="none";
	}
	WindowHeight(0);
}


// 文章路径模式
function CheckHtmlUrlSel(){
	$id('newsListUrlMode1Label').style.display='';
	$id('newsListUrlMode2Label').style.display='';
	$id('newsListUrlMode3Label').style.display='';
	$id('newsShowUrlMode1Label').style.display='';
	$id('newsShowUrlMode2Label').style.display='';
	$id('newsShowUrlMode3Label').style.display='';
	if ($id('htmlUrlSel2').checked){
		$id('newsListUrlMode2Label').style.display='none';
		$id('newsShowUrlMode2Label').style.display='none';
		if ($id('newsListUrlMode2').checked){ $id('newsListUrlMode1').checked=true; }
		if ($id('newsShowUrlMode2').checked){ $id('newsShowUrlMode1').checked=true; }
	}else{
		$id('newsListUrlMode2Label').style.display='';
		$id('newsShowUrlMode2Label').style.display='';
	}
	if (! $id('htmlUrlSel2').checked){
		if ($id('htmlUrlSel3').checked){
			$id('newsListUrlMode2Label').style.display='none';
			$id('newsListUrlMode3Label').style.display='none';
			$id('newsShowUrlMode3Label').style.display='none';
			if ($id('newsListUrlMode3').checked || $id('newsListUrlMode2').checked){ $id('newsListUrlMode1').checked=true; }
			if ($id('newsShowUrlMode3').checked){ $id('newsShowUrlMode2').checked=true; }
		}else{
			$id('newsListUrlMode2Label').style.display='';
			$id('newsListUrlMode3Label').style.display='';
			$id('newsShowUrlMode3Label').style.display='';
		}
	}
	CheckNewsListUrlMode();
	CheckNewsShowUrlMode();
}

// 文章列表路径选择
function CheckNewsListUrlMode(){
	if ($id('newsListUrlMode1').checked){
		$id('newsListUrlMode1box').style.display="";
	}else{
		$id('newsListUrlMode1box').style.display="none";
	}
	if ($id('newsListUrlMode2').checked){
		$id('newsListUrlMode2box').style.display="";
	}else{
		$id('newsListUrlMode2box').style.display="none";
	}
	if ($id('newsListUrlMode3').checked){
		$id('newsListUrlMode3box').style.display="";
	}else{
		$id('newsListUrlMode3box').style.display="none";
	}

	if ($id('htmlUrlSel1').checked){
		// 网钛模式
		if ($id('newsListUrlMode1').checked){
			$id('newsListFileName').value="newsList.asp";
			$id('newsListVarTypeStr').value="typeStr";
			$id('newsListVarTypeID').value="typeID";
			$id('newsListVarPageID').value="page";

			$id('newsListFileName1').innerHTML="newsList.asp";
			$id('newsListVarTypeID1').innerHTML="typeID";
			$id('newsListVarPageID1').innerHTML="page";
			
		}else if ($id('newsListUrlMode2').checked){
			$id('newsListFileName').value="news";
			$id('newsListVarTypeStr').value="";
			$id('newsListVarTypeID').value="";
			$id('newsListVarPageID').value="";

			$id('newsListFileName2').innerHTML="news";

		}else if ($id('newsListUrlMode3').checked){
			$id('newsListFileName').value="news";
			$id('newsListVarTypeStr').value="";
			$id('newsListVarTypeID').value="";
			$id('newsListVarPageID').value="";

			$id('newsListFileName3').innerHTML="news";

		}

	}else if ($id('htmlUrlSel2').checked){
		// ok3w模式
		if ($id('newsListUrlMode1').checked){
			$id('newsListFileName').value="list.asp";
			$id('newsListVarTypeStr').value="typeStr";
			$id('newsListVarTypeID').value="id";
			$id('newsListVarPageID').value="PageNo";

			$id('newsListFileName1').innerHTML="list.asp";
			$id('newsListVarTypeID1').innerHTML="id";
			$id('newsListVarPageID1').innerHTML="PageNo";
			
		}else if ($id('newsListUrlMode2').checked){
			// ok3w 无伪静态

		}else if ($id('newsListUrlMode3').checked){
			$id('newsListFileName').value="article";
			$id('newsListVarTypeStr').value="";
			$id('newsListVarTypeID').value="";
			$id('newsListVarPageID').value="";

			$id('newsListFileName3').innerHTML="article";

		}

	}else if ($id('htmlUrlSel3').checked){
		// 老Y模式
		if ($id('newsListUrlMode1').checked){
			$id('newsListFileName').value="Class.asp";
			$id('newsListVarTypeStr').value="typeStr";
			$id('newsListVarTypeID').value="ID";
			$id('newsListVarPageID').value="page";

			$id('newsListFileName1').innerHTML="Class.asp";
			$id('newsListVarTypeID1').innerHTML="ID";
			$id('newsListVarPageID1').innerHTML="page";
			
		}else if ($id('newsListUrlMode2').checked){
			$id('newsListFileName').value="Html";
			$id('newsListVarTypeStr').value="";
			$id('newsListVarTypeID').value="";
			$id('newsListVarPageID').value="";

			$id('newsListFileName2').innerHTML="Html";

		}else if ($id('newsListUrlMode3').checked){
			// 老Y 无纯静态

		}

	}
	WindowHeight(0);

}

// 文章内容路径选择
function CheckNewsShowUrlMode(){
	if ($id('newsShowUrlMode1').checked){
		$id('newsShowUrlMode1box').style.display="";
	}else{
		$id('newsShowUrlMode1box').style.display="none";
	}
	if ($id('newsShowUrlMode2').checked){
		$id('newsShowUrlMode2box').style.display="";
	}else{
		$id('newsShowUrlMode2box').style.display="none";
	}
	if ($id('newsShowUrlMode3').checked){
		$id('newsShowUrlMode3box').style.display="";
	}else{
		$id('newsShowUrlMode3box').style.display="none";
	}

	if ($id('htmlUrlSel1').checked){
		// 网钛模式
		if ($id('newsShowUrlMode1').checked){
			$id('newsShowFileName').value="newsShow.asp";
			$id('newsShowVarDataID').value="dataID";
			$id('newsShowVarPageID').value="page";

			$id('newsShowFileName1').innerHTML="newsShow.asp";
			$id('newsShowVarDataID1').innerHTML="dataID";
			$id('newsShowVarPageID1').innerHTML="page";
			
		}else if ($id('newsShowUrlMode2').checked){
			$id('newsShowFileName').value="news";
			$id('newsShowVarDataID').value="";
			$id('newsShowVarPageID').value="";

			$id('newsShowFileName2').innerHTML="news";

		}else if ($id('newsShowUrlMode3').checked){
			$id('newsShowFileName').value="news";
			$id('newsShowVarDataID').value="";
			$id('newsShowVarPageID').value="";

			$id('newsShowFileName3').innerHTML="news";

		}

	}else if ($id('htmlUrlSel2').checked){
		// ok3w模式
		if ($id('newsShowUrlMode1').checked){
			$id('newsShowFileName').value="show.asp";
			$id('newsShowVarDataID').value="id";
			$id('newsShowVarPageID').value="PageNo";

			$id('newsShowFileName1').innerHTML="show.asp";
			$id('newsShowVarDataID1').innerHTML="id";
			$id('newsShowVarPageID1').innerHTML="PageNo";
			
		}else if ($id('newsShowUrlMode2').checked){
			// ok3w 无伪静态

		}else if ($id('newsShowUrlMode3').checked){
			$id('newsShowFileName').value="article";
			$id('newsShowVarDataID').value="";
			$id('newsShowVarPageID').value="";

			$id('newsShowFileName3').innerHTML="article";

		}
	}else if ($id('htmlUrlSel3').checked){
		// 老Y模式
		if ($id('newsShowUrlMode1').checked){
			$id('newsShowFileName').value="List.asp";
			$id('newsShowVarDataID').value="ID";
			$id('newsShowVarPageID').value="Page";

			$id('newsShowFileName1').innerHTML="List.asp";
			$id('newsShowVarDataID1').innerHTML="ID";
			$id('newsShowVarPageID1').innerHTML="Page";
			
		}else if ($id('newsShowUrlMode2').checked){
			$id('newsShowFileName').value="Html";
			$id('newsShowVarDataID').value="";
			$id('newsShowVarPageID').value="";

			$id('newsShowFileName2').innerHTML="Html";

		}else if ($id('newsShowUrlMode3').checked){
			// 老Y 无纯静态

		}
	}
	WindowHeight(0);

}
// 展开/收缩
function BoxTrunBtn(str,mode){
	if ($id(str +'Box')){
		if (mode==0){
			if ($id(str +'Box').style.display==''){
				$id(str +'Box').style.display='none';
				$id(str +'Btn').innerHTML='[展开]';
				$id(str +'Span').style.color='';
			}else{
				$id(str +'Box').style.display='';
				$id(str +'Btn').innerHTML='[收缩]';
				$id(str +'Span').style.color='blue';
			}
			
		}else if (mode==1){
			$id(str +'Box').style.display='';
			$id(str +'Btn').innerHTML='[收缩]';
			$id(str +'Span').style.color='blue';
		}else if (mode==2){
			$id(str +'Box').style.display='none';
			$id(str +'Btn').innerHTML='[展开]';
			$id(str +'Span').style.color='';
		}
	}
	WindowHeight(0);
}


function InputDefShare(str){
	if (str=="shareCode"){
		$id(str).value=""+
			"<!-- Baidu Button BEGIN -->\n"+
			"<script type=\"text/javascript\" id=\"bdshare_js\" data=\"type=slide&img=0&uid=379763\" ></script>\n"+
			"<script type=\"text/javascript\" id=\"bdshell_js\"></script>\n"+
			"<script type=\"text/javascript\">\n"+
			"	document.getElementById(\"bdshell_js\").src = \"http://bdimg.share.baidu.com/static/js/shell_v2.js?t=\" + new Date().getHours();\n"+
			"</script>\n"+
			"<!-- Baidu Button END -->";
	}else if (str=="shareNewsCode"){
		$id(str).value=""+
			"<!-- Baidu Button BEGIN -->\n"+
			"<div id=\"bdshare\" class=\"bdshare_t bds_tools get-codes-bdshare\">\n"+
			"	<span class=\"bds_more\">分享到：</span>\n"+
			"	<a class=\"bds_qzone\">QQ空间</a>\n"+
			"	<a class=\"bds_tsina\">新浪微博</a>\n"+
			"	<a class=\"bds_renren\">人人网</a>\n"+
			"	<a class=\"bds_kaixin001\">开心网</a>\n"+
			"	<a class=\"bds_hi\">百度空间</a>\n"+
			"	<a class=\"bds_hx\">和讯</a>\n"+
			"	<a class=\"bds_ty\">天涯社区</a>\n"+
			"	<a class=\"shareCount\"></a>\n"+
			"</div>\n"+
			"<script type=\"text/javascript\" id=\"bdshare_js\" data=\"type=tools&amp;uid=379763\" ></script>\n"+
			"<script type=\"text/javascript\" id=\"bdshell_js\"></script>\n"+
			"<script type=\"text/javascript\">\n"+
			"	document.getElementById(\"bdshell_js\").src = \"http://bdimg.share.baidu.com/static/js/shell_v2.js?t=\" + new Date().getHours();\n"+
			"</script>\n"+
			"<!-- Baidu Button END -->";
	}
}
