<!--<?php
# MetInfo Enterprise Content Management System 
# Copyright (C) MetInfo Co.,Ltd (http://www.metinfo.cn). All rights reserved.
require_once template('head');

echo <<<EOT
-->
<title>{$lang_function_settings}</title>
</head>
<link rel="stylesheet" media="screen" type="text/css" href="../../templates/met/images/colorpicker/css/colorpicker.css" />
<script type="text/javascript" src="../../templates/met/images/colorpicker/js/colorpicker.js"></script>
<body>
<!--
EOT;
$title="{$lang_the_menu} > {$lang_function_settings}";
require_once template('app/wap/top');
$motop[1]="now";
echo <<<EOT
-->
<form method="post" name="myform" action="menu_set.php?lang={$lang}&anyid={$anyid}&cs={$cs}&action=modify" target="_self">
<div class="v52fmbx_tbmax">
<div class="v52fmbx_tbbox">
<div class="lablelist">
	<ul>
		<li class="round $motop[2]"><a href="custommenu.php?id=$mptid&lang=$lang&anyid={$anyid}&cs={$cs}" title="{$lang_menu_management}">{$lang_menu_management}</a></li>
		<li class="round $motop[1]"><a href="menu_set.php?id=$mptid&lang=$lang&anyid={$anyid}&cs={$cs}" title="{$lang_function_settings}">{$lang_function_settings}</a></li>
	</ul>
</div>
<div class="v52fmbx">

<!--
EOT;
$displaycontents='style="display:none"';
$displaycontentst='style="display:none"';
if($met_menu_ok==1){
	$menu_ok1[1]='checked="checked"';
}else{
	$menu_ok1[2]='checked="checked"';
}
if($met_menu_oks==1){
	$menu_oks1[1]='checked="checked"';
}else{
	$menu_oks1[2]='checked="checked"';
}
$textbg=$met_menu_rgb;
$dyestuff=array('0','#0065bc','#ffc0cb','#000000','#f7ff00','#1cdb29','#d91f1f','#6e6e75');
$isnot=2;
for($i=1;$i<9;$i++){
	if($textbg==$dyestuff[$i]){
		$menu_type1[$i]="selected='selected'";
		$isnot=1;
	}
}
$valsmun=strlen($textbg);
if($isnot==2){
	if($valsmun>7){
	$menu_type1[9]="selected='selected'";
	$displaycontentst='';
	$textbgs='';
	}else{
	$menu_type1[8]="selected='selected'";
	$displaycontents='';
	$textbgs=$textbg;
	}
}
echo <<<EOT
-->
<div class="v52fmbx_dlbox">
	<dl>
		<dt style="width: 132px; ">{$lang_menu_functions}{$lang_marks}</dt>
		<dd style="width: 946px; ">
			<label><input name="met_menu_ok" type="radio" value="1" $menu_ok1[1]>&nbsp;{$lang_open}</label>
			<label><input name="met_menu_ok" type="radio" value="0" $menu_ok1[2]>&nbsp;{$lang_close}</label>
			<span class='tips'>{$lang_menu_functions1}</span>
		</dd>
	</dl>
	</div>
	<div class="v52fmbx_dlbox">
	<dl>
		<dt style="width: 132px; ">{$lang_display_effect}{$lang_marks}</dt>
		<dd style="width: 946px; ">
			<label><input name="met_menu_oks" type="radio" value="1" onclick="return originate('1')" $menu_oks1[1]>&nbsp;{$lang_display_effect1}</label>
			<label><input name="met_menu_oks" type="radio" value="2" onclick="return originate('2')" $menu_oks1[2]>&nbsp;{$lang_display_effect2}</label>
			<span class='tips'>{$lang_display_effect3}</span>
		</dd>
	</dl>
	</div>
		<div class="metsliding_box metsliding_box_1">
		<div class="v52fmbx_dlbox">
		<dl>
			<dt>{$lang_background_color}{$lang_marks}</dt>
			<dd id='originate'>
<!--
EOT;
if($met_menu_oks==1){
echo <<<EOT
-->
		<select id='met_menu_type' name='met_menu_rgb' onchange='return changetype()' >
        <option value='#0065bc' $menu_type1[1]>{$lang_setimgBlue}</option>
		<option value='#ffc0cb' $menu_type1[2]>{$lang_pink}</option>
		<option value='#000000' $menu_type1[3]>{$lang_setimgBlack}</option>
		<option value='#f7ff00' $menu_type1[4]>{$lang_setimgYellow}</option>
		<option value='#37cf19' $menu_type1[5]>{$lang_onlinegreen}</option>
		<option value='#d91f1f' $menu_type1[6]>{$lang_setimgRed}</option>
		<option value='#6e6e75' $menu_type1[7]>{$lang_onlinegray}</option>
		<option value='5' $menu_type1[8]>{$lang_custom_colors}</option>
		</select>
<!--
EOT;
}else{
echo <<<EOT
-->
		<select id='met_menu_type' name='met_menu_rgb' onchange='return changetype()' >
        <option value='#0065bc' $menu_type1[1]>{$lang_setimgBlue}</option>
		<option value='#ffc0cb' $menu_type1[2]>{$lang_pink}</option>
		<option value='#000000' $menu_type1[3]>{$lang_setimgBlack}</option>
		<option value='#f7ff00' $menu_type1[4]>{$lang_setimgYellow}</option>
		<option value='#1cdb29' $menu_type1[5]>{$lang_onlinegreen}</option>
		<option value='#d91f1f' $menu_type1[6]>{$lang_setimgRed}</option>
		<option value='#6e6e75' $menu_type1[7]>{$lang_onlinegray}</option>
		<option value='5' $menu_type1[8]>{$lang_custom_colors}</option>
		<option value='6' $menu_type1[9]>{$lang_custom_picture}</option>
		</select>
<!--
EOT;
}
echo <<<EOT
-->
			</dd>
		</dl>
		</div>

		
</div>
<div class="v52fmbx_dlbox caidantype_5" $displaycontents>
         <dl>
		<dt style="width: 108px; ">{$lang_custom_colors}{$lang_marks}</dt>
		<dd style="width: 970px; ">
					<input type="hidden" name="rgb_name" value="">
					<input name="menu_textbg_metinfo" type="text" class="text med float_input" value='$textbgs'>
					<div class="colorpickerbox colorpickerbox_Column2_bg2"><div style="background-color: $textbgs"></div></div>
					<div class="clear"></div>
					<span class="tips">{$lang_custom_colors1}</span>
					<script type="text/javascript">
					$(document).ready(function(){
						$('.colorpickerbox_Column2_bg2').ColorPicker({
							color: '#0000ff',
							onShow: function (colpkr) {
								$(colpkr).fadeIn(500);
								return false;
							},
							onHide: function (colpkr) {
								$(colpkr).fadeOut(500);
								return false;
							},
							onChange: function (hsb, hex, rgb) {
								$('.colorpickerbox_Column2_bg2 div').css('backgroundColor', '#' + hex);
								$("input[name='menu_textbg_metinfo']").val('#'+hex);
								$("input[name='rgb_name']").val('#'+rgb);
							}
						});
					});
					</script>
				
		</dd>
	</dl>

</div>
<div class="v52fmbx_dlbox caidantype_6" $displaycontentst>
		<dl>
			<dt>{$lang_custom_picture}{$lang_marks}</dt>
			<dd>
				<input name="met_menu_bg" type="text" class="text" value="{$met_menu_bg}" />
				<input name="met_upsql" type="file" id="file_upload" />
				<script type='text/javascript'>
					$(document).ready(function(){
						metuploadify('#file_upload','upimage','met_menu_bg');
					});
				</script>
				<span class='tips'>{$lang_custom_picture1}</span>
			</dd>
		</dl>
</div>


<div class="v52fmbx_submit"><input type="submit" id="add" onclick="return dimensional()" name="Submit" value="{$lang_Submit}" class="submit" onclick="return check($(this),'myform')" /></div>
</form>
</div>
</div>
</div>
</div>
<script type="text/javascript">
function get_length(s){
	var char_length = 0;
	for (var i = 0; i < s.length; i++){
		var son_char = s.charAt(i);
		encodeURI(son_char).length > 2 ? char_length += 2 : char_length += 1;
	}
	return char_length;
}
function check(my,from){
	var len=get_length($("[name='menu_name']").val());

if(len>6){
alert('名称的字符数不能超过6个！');
return false;
}
	return Smit(my,from);
	//return false;
}
function check11(){
var len=get_length($("[name='menu_name']").val());

if(len>10){
alert('字符数过多！');
return false;
}
}
function check1(){
	var len=get_length($("[name='menu_name']").val());
		var len=$("[name='menu_name']").val();

		if(len==""){
		alert('字符数过多！');
		return false;
		}
		if(len>10){
			alert('字符数过多！');
			return false;
		}
		

	
}
function changetype(){
	var type=$('#met_menu_type').val();
	$("[class*=caidantype_]").hide();
	$(".caidantype_"+type).show();
	ifreme_methei();
}
function originate(id){
	/*
		$.ajax({
			url: 'originate.php?lang={$lang}&id='+id,
			type: 'GET',
			cache: false,
			success: function(data) {
				$('#originate').html(data);
			}
		});
	*/	
	//alert($("#met_menu_type").html());
	var type=$("#met_menu_type").val();
	if(id==1){
		$("#met_menu_type").html("<option value='#0065bc'>蓝色</option><option value='#ffc0cb'>粉色</option><option value='#000000'>黑色</option><option value='#f7ff00'>黄色</option><option value='#1cdb29'>绿色</option><option value='#d91f1f'>红色</option><option value='#6e6e75'>灰色</option><option value='5'>自定义颜色</option>");
	}
	if(id==2){
		$("#met_menu_type").html("<option value='#0065bc'>蓝色</option><option value='#ffc0cb'>粉色</option><option value='#000000'>黑色</option><option value='#f7ff00'>黄色</option><option value='#1cdb29'>绿色</option><option value='#d91f1f'>红色</option><option value='#6e6e75'>灰色</option><option value='5'>自定义颜色</option><option value='6'>自定义图片</option>");
	}
	$("#met_menu_type option[value='"+type+"']").attr("selected", true);
/*
	if(type==5){
		$(".caidantype_5").show();
		$(".caidantype_6").hide();
	}else if(type==6){
		$(".caidantype_5").hide();
		$(".caidantype_6").show();
	}else{
		$(".caidantype_5").hide();
		$(".caidantype_6").hide();
	}
*/	
	if(id==1&&type==6){
		$(".caidantype_6").hide();
		$(".caidantype_5").show();
		$("#met_menu_type option[value='5']").attr("selected", true);
	}
	//alert(id);
}
</script>
</body>
</html>
<!--
EOT;
# This program is an open source system, commercial use, please consciously to purchase commercial license.
# Copyright (C) MetInfo Co., Ltd. (http://www.metinfo.cn). All rights reserved.
?>-->