<?php
	if( !is_array($_G['project']) ){
		ob_clean();
		exit("Forbidden");	
	}
?>

    <tr>
        <td><strong>广告控制：</strong></td>
        <td>
        
        	<script type="text/javascript">
			
			Mo("#bind_size a").bind("click",function( ele ){
				var size = ele.innerHTML.split('*');
				Mo('#width').value( size[0] );
				Mo('#height').value( size[1] );
			});
			
			/*广告类型扩展*/
			function doChanged(s){
				
				<?php
				//商业版开始
				if( file_exists("api.php") ){
				?>
	
				for(var i=1; i<<?php echo count($_G['module']['adsview']["type"]);?>; i++){
					//禁用子元素
					Mo('#extra_'+i+" *").disabled();
					Mo('#extra_'+i).hide();
				}
				
				//启用子元素
				Mo('#extra_'+s+" *").enabled();
				Mo('#extra_'+s).show();
				
				<?php
				}
				//商业版结束
				?>
				
			}
			
			/*文字广告风格*/
			function doStyle(s){
				
				/*定义*/
				var BORDER = "";
				var TITLE = "";
				var BG = "";
				var TEXT = "";
				var LINK = "";
				
				switch(s){
				
					case "blue":
						
						BORDER = "#CCCCCC";
						TITLE = "#1111CC";
						BG = "#FFF";
						TEXT = "#000000";
						LINK = "#008000";
					
					break;	
				
					case "yellow":
						
						BORDER = "#CCCCCC";
						TITLE = "#ff0000";
						BG = "#FFF";
						TEXT = "#333333";
						LINK = "#008000";
					
					break;	
				
					case "black":
						
						BORDER = "#CCCCCC";
						TITLE = "#000000";
						TEXT = "#333333";
					
					break;	
					
				}
				
				/*设置*/
				Mo("input[name='config[COLOR-BORDER]']").value( BORDER );
				Mo("input[name='config[COLOR-TITLE]']").value( TITLE );
				Mo("input[name='config[COLOR-BG]']").value( BG );
				Mo("input[name='config[COLOR-TEXT]']").value( TEXT );
				Mo("input[name='config[COLOR-LINK]']").value( LINK );
				
			}
			
			</script>
            
            <table cellpadding="0" cellspacing="1" border="0" class="gird">
                <thead>
                    <td>
                     广告尺寸
                    </td>
                    <td>
                    
                    </td>
                </thead>
                <tr>
                    <td>
                    <input name="width" type="text" class="text" id="width" value="<?php echo $row["width"];?>" size="5" fix_name="广告宽度" fix_number="no" />
                    ×
                    <input name="height" type="text" class="text" id="height" value="<?php echo $row["height"];?>" size="5" fix_name="广告高度" fix_number="no" />
                    
                    <select id="bind_size">
                    	<option value="">常见尺寸</option>
                    	<option value="960*60">960*60</option>
                    	<option value="475*60">475*60</option>
                    	<option value="315*60">315*60</option>
                    	<option value="120*250">120*250</option>
                    </select>
                    </td>
                    <td>
                    
                    </td>
                </tr>
                <thead>
                    <td>
                     标签嵌套
                    </td>
                    <td>
                    标签样式
                    </td>
                </thead>
                <tr>
                    <td>
                    <select name="tag" id="tag" style="width:150px;">
                        <option value="">无</option>
                        <option value="div">div</option>
                        <option value="span">span</option>
                        <option value="td">td</option>
                        <option value="li">li</option>
                        <option value="p">p</option>
                    </select>
					<script type="text/javascript">Mo.Tools("Tip","<strong>标签嵌套</strong><br />每条广告使用输出格式，例如: li / div / td 等，部分广告类型不适用");</script>
                    </td>
                    <td>
                    <input name="config[TAG-CLASS]" type="text" class="text" value="<?php echo $config["TAG-CLASS"];?>" size="12" />
					<script type="text/javascript">Mo.Tools("Tip","<strong>标签样式</strong><br />附加 class 属性，用于控制广告展示样式，同时自动附加 ad-*-class 样式（*为索引值，从0开始）");</script>
                    </td>
                </tr>
                <thead>
                    <td>
                     广告类型
                    </td>
                    <td>
                    显示数量
                    </td>
                </thead>
                <tr>
                    <td>
                    <select name="show" id="show" onchange="doChanged( Mo( this ).value() );" style="width:150px;">
						<?php
                        for($i=1;$i<count($_G['module']['adsview']["type"]);$i++){
                            echo '<option value="'.$i.'">'.$_G['module']['adsview']["type"][$i].'</option>';
                        }
                        ?>
                    </select>
                    </td>
                    <td>
                    <input type="text" name="number" id="number" title="显示数量" class="text digi" onclick="Mo.Soler( this, event, this.value, 'mo-soler', { '显示数量' : (function(){ var a = []; for(var i=1;i<=35;i++){a.push(i);} return a; })() }, function( value ){ this.value = value; }, 1 , 23 );" readonly="true" value="<?php echo $row["number"] ? $row["number"] : "1";?>" />

					<script type="text/javascript">Mo.Tools("Tip","此广告位最多同时显示广告的数量");</script>
                    </td>
                </tr>
             </table>
        
        </td>
    </tr>    
            
	<script type="text/javascript">
        Mo("#show").value("<?php echo $row["show"];?>");
        Mo("#tag").value("<?php echo $row["tag"];?>");
    </script>                                  
    
    <?php
    //商业版开始
    if( file_exists("api.php") ){
    ?>		

    <tr>
        <td><strong>显示控制：</strong></td>
        <td>                    
            
            <div id="extra_1">无</div>
            
            <div id="extra_2">无</div>
            
            <div id="extra_3">
                <select id="SCREEN-X" name="config[SCREEN-X]">
                    <option value="">最小屏幕宽度</option>
                    <option value="800">800</option>
                    <option value="1024">1024</option>
                    <option value="1280">1280</option>
                    <option value="1440">1440</option>
                </select>
                <script type="text/javascript">Mo.Tools("Tip","小于此尺寸时不显示广告");</script>
                
                <label>
                <input name="config[SCREEN-ROLL]" type="checkbox" class="checkbox" value="Y">
                随页面滚动
                </label>
                
                <label>
                <input name="config[SHOW-CLOSE]" type="checkbox" class="checkbox" value="Y">
                关闭按钮
                </label>
                
                <label>
                <input name="config[SMART-MEMORY]" type="checkbox" class="checkbox" value="Y">
                记住关闭状态
                </label>
                
                <!--广告按“左”“右”顺序依次显示-->
                
                <div style="clear:both; margin-top:10px;"></div>
                
                <table cellpadding="0" cellspacing="1" border="0" class="gird">
                    <tr>
                        <td>
                        	距顶部高度<br />
                            <input name="config[STYLE-TOP]" type="text" size="10" class="text" value="<?php echo $config["STYLE-TOP"];?>">
                            px
                        </td>
                        <td>
                        	距外围空隙<br />
                        	<input name="config[STYLE-GAP]" type="text" size="10" class="text" value="<?php echo $config["STYLE-GAP"];?>">
                        	px
                        </td>
                    </tr>
                </table>
                
            </div>
            
            <div id="extra_4">
            <table cellpadding="0" cellspacing="1" border="0" class="gird">
                <tr>
                    <td>
                    边框<br />                                
                    <input type="text" class="text" size="10" name="config[COLOR-BORDER]" value="<?php echo $config["COLOR-BORDER"];?>" style="color:<?php echo $config["COLOR-BORDER"];?>;"  onfocus="Mo.Color( this, event, 'mo-color', function( color, obj ){ obj.value = color ; }, 0, 22 );" />
                        
                    </td>
                    <td>
                    标题<br />
                    <input type="text" class="text" size="10" name="config[COLOR-TITLE]" value="<?php echo $config["COLOR-TITLE"];?>" style="color:<?php echo $config["COLOR-TITLE"];?>;"  onfocus="Mo.Color( this, event, 'mo-color', function( color, obj ){ obj.value = color ; }, 0, 22 );" />
                    </td>
                </tr>
                <tr>
                    <td>
                    背景<br />
                        <input type="text" class="text" size="10" name="config[COLOR-BG]" value="<?php echo $config["COLOR-BG"];?>" style="color:<?php echo $config["COLOR-BG"];?>;" onfocus="Mo.Color( this, event, 'mo-color', function( color, obj ){ obj.value = color ; }, 0, 22 );" />
                    </td>
                    <td>
                    文字<br />
                    <input type="text" class="text" size="10" name="config[COLOR-TEXT]" value="<?php echo $config["COLOR-TEXT"];?>" style="color:<?php echo $config["COLOR-TEXT"];?>;" onfocus="Mo.Color( this, event, 'mo-color', function( color, obj ){ obj.value = color ; }, 0, 22 );" />
                    </td>
                </tr>
                <tr>
                    <td>
                    网址<br />
                    <input type="text" class="text" size="10" name="config[COLOR-LINK]" value="<?php echo $config["COLOR-LINK"];?>" style="color:<?php echo $config["COLOR-LINK"];?>;" onfocus="Mo.Color( this, event, 'mo-color', function( color, obj ){ obj.value = color ; }, 0, 22 );" />
                    </td>
                    <td>                            
                    换行<br />
                    <select id="SHOW-BREAK" name="config[SHOW-BREAK]">
                        <option value=0>无换行</option> 
                        <option value=1>隔1项换行</option> 
                        <option value=2>隔2项换行</option> 
                        <option value=3>隔3项换行</option> 
                        <option value=4>隔4项换行</option> 
                        <option value=5>隔5项换行</option> 
                        <option value=6>隔6项换行</option> 
                        <option value=7>隔7项换行</option> 
                        <option value=8>隔8项换行</option> 
                        <option value=9>隔9项换行</option> 
                    </select>
                    </td>
                </tr>
            </table>
            风格：
            <a href="javascript:void(0);" onclick="doStyle('blue');">蓝色</a>
            -
            <a href="javascript:void(0);" onclick="doStyle('yellow');">橙色</a>
            -
            <a href="javascript:void(0);" onclick="doStyle('black');">黑色</a>
            </div>
            
            <div id="extra_5">直接显示广告，并在倒计时后隐藏</div>
            
            <div id="extra_6">
                <label>
                <input name="config[OPEN-TIME]" type="radio" class="radio" value="load">
                进入页面时
                </label>
                <label>
                <input name="config[OPEN-TIME]" type="radio" class="radio" value="unload">
                离开页面时
                </label>
            </div>
             
            <div id="extra_7">无</div>
            
            <div id="extra_8">            
                <select name="config[SHOW-ENTER]">
                    <option value="">直接显示</option>
                    <option value="slow">慢慢显示</option>
                </select>                
                
                <select name="config[SHOW-OUTLET]">
                    <option value="">直接隐藏</option>
                    <option value="slow">慢慢隐藏</option>
                </select>
                显示时间和间隔请到具体的广告中设置
            </div>
            
            <div id="extra_9">
                <select id="SHOW-TITLE" name="config[SHOW-TITLE]">
                    <option value="">标题位置</option>
                    <option value="0">顶部</option>
                    <option value="1">底部</option>
                    <option value="2">顶部（透明）</option>
                    <option value="-1">隐藏</option>
                </select>
                                        
                <select id="SHOW-OPACITY" name="config[SHOW-OPACITY]">
                    <option value="">背景透明度</option>
                    <option value="0">完全透明</option>
                    <?php
                    for($i=1;$i<10;$i++){
                        echo '<option value="'.$i.'0">'.$i.'0%</option>';
                    }
                    ?>
                    <option value="100">不透明</option>
                </select>                            
                <select id="SHOW-SPEED" name="config[SHOW-SPEED]">
                    <option value="">播放速度</option>
                    <option value="2">2秒</option>
                    <option value="3">3秒</option>
                    <option value="5">5秒</option>
                    <option value="8">8秒</option>
                </select>                            
                <select id="SHOW-TWEEN" name="config[SHOW-TWEEN]">
                    <option value="">过渡效果</option>
                    <option value="0">亮度过渡</option>
                    <option value="1">透明度过渡</option>
                    <option value="2">模糊过渡</option>
                    <option value="3">运动模糊过渡</option>
                </select>   
                                         
                <label>
                <input id="SHOW-BUTTON" name="config[SHOW-RANDOM]" type="checkbox" class="checkbox" value="Y">
                随机排序
                </label>
                                         
                <label>
                <input id="SHOW-BUTTON" name="config[SHOW-BUTTON]" type="checkbox" class="checkbox" value="Y">
                显示按钮
                </label>
                自动解除跨域限制
            </div>
            
            <div id="extra_10">
                <select id="POSITION-X" name="config[POSITION-X]">
                    <option value="">相对于页面 X</option>
                    <option value="left">左</option>
                    <option value="center">中</option>
                    <option value="right">右</option>
                </select>
                
                <select id="POSITION-Y" name="config[POSITION-Y]">
                    <option value="">相对于页面 Y</option>
                    <option value="top">上</option>
                    <option value="center">中</option>
                    <option value="bottom">下</option>
                </select>
                                         
                <label>
                <input name="config[SHOW-CLOSE]" type="checkbox" class="checkbox" value="Y">
                显示关闭按钮（将忽略"展示时间"）
                </label>
            </div>
            
            <div id="extra_11">页面中随意漂浮移动的广告</div>
            
            <div id="extra_12">
                                        
                <select id="SHOW-SPEED" name="config[SHOW-SPEED]">
                    <option value="1">播放速度</option>
                    <option value="2">2秒</option>
                    <option value="3">3秒</option>
                    <option value="5">5秒</option>
                    <option value="8">8秒</option>
                </select>                            
                                         
                <label>
                <input name="config[SHOW-EFFECT]" type="checkbox" class="checkbox" value="Y">
                动态效果（仅 IE 浏览器）
                </label>
                                         
                <label>
                <input name="config[SHOW-RANDOM]" type="checkbox" class="checkbox" value="Y">
                随机排序
                </label>
            </div>
            
            <div id="extra_13">
                                        
                <p>
                    <a href="javascript:void(0);" onmouseover='Mo.Tips(this,event,"tips","链接地址，将自动为图片和标签增加链接","mouseout",0,-50,{"unique":"tips"});' onclick="Mo('textarea[name=\'config[SHOW-TEMPLATE]\']').value(this.innerHTML,true)">{TEXT:文本框}</a>
                    
                    <a href="javascript:void(0);" onmouseover='Mo.Tips(this,event,"tips","图片地址，将会在插入的位置显示一个图片","mouseout",0,-50,{"unique":"tips"});' onclick="Mo('textarea[name=\'config[SHOW-TEMPLATE]\']').value(this.innerHTML,true)">{FILE:上传框}</a>
                </p>
                <textarea name="config[SHOW-TEMPLATE]" cols="82" rows="5"><?php echo $config["SHOW-TEMPLATE"];?></textarea>
                
            </div>
            
            <script type="text/javascript">
				
				doChanged( Mo("#show").value() );
		
				//config
				Mo("select[name='config[SHOW-TITLE]']").value("<?php echo $config['SHOW-TITLE'];?>");
                
                Mo("select[name='config[SHOW-ENTER]']").value("<?php echo $config['SHOW-ENTER'];?>");
                Mo("select[name='config[SHOW-OUTLET]']").value("<?php echo $config['SHOW-OUTLET'];?>");
				
				Mo("input[name='config[SHOW-EFFECT]']").value("<?php echo $config['SHOW-EFFECT'];?>");
				Mo("input[name='config[SHOW-RANDOM]']").value("<?php echo $config['SHOW-RANDOM'];?>");
				Mo("input[name='config[SHOW-BUTTON]']").value("<?php echo $config['SHOW-BUTTON'];?>");
				
				Mo("select[name='config[SHOW-SPEED]']").value("<?php echo $config['SHOW-SPEED'];?>");
				Mo("select[name='config[SHOW-TWEEN]']").value("<?php echo $config['SHOW-TWEEN'];?>");
				Mo("select[name='config[SHOW-OPACITY]']").value("<?php echo $config['SHOW-OPACITY'];?>");
				
				Mo("#bind_size").bind("change",function( ele ){
					
					var size = Mo( this ).value();
					var size = size ? size.split("*") : ['',''];
					
					Mo("input[name='width']").value( size[0] );
					Mo("input[name='height']").value( size[1] );
					
				});
				
				Mo('#SCREEN-X').value("<?php echo $config['SCREEN-X'];?>");
				Mo("input[name='config[SCREEN-ROLL]']").value("<?php echo $config['SCREEN-ROLL'];?>");
				
				Mo('#POSITION-X').value("<?php echo $config['POSITION-X'];?>");
				Mo('#POSITION-Y').value("<?php echo $config['POSITION-Y'];?>");
				Mo("input[name='config[SHOW-CLOSE]']").value("<?php echo $config['SHOW-CLOSE'];?>");
				Mo("input[name='config[SMART-MEMORY]']").value("<?php echo $config['SMART-MEMORY'];?>");
				
				Mo("input[name='config[OPEN-TIME]']").value("<?php echo $config['OPEN-TIME'];?>");
				
				Mo('#SHOW-BREAK').value("<?php echo $config["SHOW-BREAK"];?>");
					
			</script>                                  
                                  
        </td>
        
    </tr>                

    <?php
    }
    //商业版结束
    ?>        
