$(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').mouseover(function (){
		$(this).find('img').css({"display":""})
		$(this).hover(function (){
			
		},function (){
			$(this).find('img').css({"display":"none"})
		});
	});

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

	CheckNavHome();
	CheckNavMessage();

	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); }
}

// 检测关闭时间框是否打开
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 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('newsListUrlMode2Label').style.display='';
	$id('newsListUrlMode3Label').style.display='';
	$id('newsShowUrlMode2Label').style.display='';
	$id('newsShowUrlMode3Label').style.display='';
	CheckNewsListUrlMode();
	CheckNewsShowUrlMode();
}

// 文章列表路径选择
function CheckNewsListUrlMode(){
	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('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";

	}

	WindowHeight(0);

}

// 文章内容路径选择
function CheckNewsShowUrlMode(){
	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('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";

	}

	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 -->";
	}
}
