<?php
$this->load_template('_header.php');
$this->load_template('_top.php');
?>
<script>
var msgdelete = '<?php echo $this->lang('dashboard_myads_txt_msgdeletealert'); ?>';
</script>
<script type="text/javascript" src="<?php echo $C->SITE_URL?>themes/<?php echo $C->THEME ?>/js/js_dashboard.js"></script>
<div id="generalspace">
        
    <div id="container">
    
    	<div id="column1"><?php $this->load_template('_verticalmenu-dashboard.php'); ?></div>
        
        <div id="column2">

			<div id="dashboard2">
                
                <div id="listads">
                
                	<div class="boxdash">
                
                        <div class="title"><?php echo $this->lang('dashboard_myads_title')?></div>
                        
                        <div class="spaceinfo">
                        
                        	
                            
                            <div class="mrg30B">
                            
                                <div id="formadd" class="hide">                                
                                
									<div class="editarea">
                                    
                                    	<div class="subtitle"><?php echo $this->lang('dashboard_myads_txt_createpage'); ?></div>
                    
			                            <div id="form01" class="mrg30B">
            			            		<form id="form1" name="form1" method="post" action="">
                                            <div>
                                                <div class="mrg10T grey1"><?php echo $this->lang('dashboard_myads_txt_headline')?>:</div>
                                                <div><input onFocus="showNum('numheadline',1)" onBlur="showNum('numheadline',0)" onKeyUp="return maxLong(this,25,'numheadline')" name="headline" type="text" id="headline" class="boxinput withbox"/><span id="numheadline" class="grey1 hide mrg5L">25</span></div>
                                            </div>
                        
                        					<div class="mrg10T grey1"><?php echo $this->lang('dashboard_myads_txt_descriptionline')?> 1:</div>
                        					<div><input onFocus="showNum('numdescription1',1)" onBlur="showNum('numdescription1',0)" onKeyUp="return maxLong(this,30,'numdescription1')" name="description1" type="text" id="description1" class="boxinput withbox"/><span id="numdescription1" class="grey1 hide mrg5L">30</span></div>

                        					<div class="mrg10T grey1"><?php echo $this->lang('dashboard_myads_txt_descriptionline')?> 2:</div>
                        					<div><input onFocus="showNum('numdescription2',1)" onBlur="showNum('numdescription2',0)" onKeyUp="return maxLong(this,30,'numdescription2')" name="description2" type="text" id="description2" class="boxinput withbox" /><span id="numdescription2" class="grey1 hide mrg5L">30</span></div>

                        					<div class="mrg10T grey1"><?php echo $this->lang('dashboard_myads_txt_displayurl')?>:</div>
                        					<div><input onFocus="showNum('numdisplayurl',1)" onBlur="showNum('numdisplayurl',0)" onKeyUp="return maxLong(this,30,'numdisplayurl')" name="displayurl" type="text" id="displayurl" class="boxinput withbox" /><span id="numdisplayurl" class="grey1 hide mrg5L">30</span></div>

                        					<div class="mrg10T grey1"><?php echo $this->lang('dashboard_myads_txt_destinationurl')?>:</div>
                        					<div><input name="destinationurl" type="text" id="destinationurl" class="boxinput withbox" /></div>

                                            <div id="msgerror" class="redbox"></div>
                                            <div class="mrg10T mrg5B">
                                                <span><input type="submit" name="bsave" id="bsave" value="<?php echo $this->lang('dashboard_myads_txt_bsubmit')?>" class="bblue hand"/></span> <span id="lcancelf" class="mrg20L onlyblue hand"><?php echo $this->lang('dashboard_myads_txt_bcancel'); ?></span>
                                            </div>
                      
					                      </form>
                                        </div>
                                
                                    </div>
                                
                                
                                </div>
                                
                                <?php if (empty($D->htmlAds)) { ?>
                                <div id="spacelink" class="mrg30T">
                                    <div class="txtsize00 centered">
                                        <div><?php echo $this->lang('dashboard_myads_txt_noads'); ?></div>
                                        <div class="mrg20T"><span id="linkadd" class="btn btn-green"><?php echo $this->lang('dashboard_myads_txt_createpage'); ?></span></div>
                                    </div>
                                </div>
                                <?php } else { ?>
                                
                                <div id="spacelink" class="tright"><span id="linkadd" class="btn btn-green mrg10R"><?php echo $this->lang('dashboard_myads_txt_createpage'); ?></span></div>
                                <div class="mrg10T"><?php echo $D->htmlAds?></div>
                                
                                <?php } ?>                            
                            
								<script>
								function showNum(divnum, action) {
									if (action == 0) $('#' + divnum).hide('fast');
									else $('#' + divnum).show('fast');
								}
																
                                $('#linkadd').click(function(){
                                    $('#spacelink').slideUp('low',function(){
                                        $('#formadd').slideDown('low');
                                    });
                                })

                                $('#lcancelf').click(function(){
                                    $('#formadd').slideUp('low',function(){
                                        $('#spacelink').slideDown('low');
                                    });
                                })
                                
                                var txt_err_headline='<?php echo $this->lang('dashboard_myads_error_headline')?>';
                                var txt_err_descrip1='<?php echo $this->lang('dashboard_myads_error_descriptionline1')?>';
                                var txt_err_descrip2='<?php echo $this->lang('dashboard_myads_error_descriptionline2')?>';
                                var txt_err_displayu='<?php echo $this->lang('dashboard_myads_error_displayurl')?>';
                                var txt_err_displayi='<?php echo $this->lang('dashboard_myads_error_displayurlinvalid')?>';
                                var txt_err_destinau='<?php echo $this->lang('dashboard_myads_error_destinationurl')?>';
                                var txt_err_destinai='<?php echo $this->lang('dashboard_myads_error_destinationurlinvalid')?>';
                                $('#bsave').click(function(){
                                    createAds('#msgerror', '#bsave');
                                    return false;
                                });
    
                                </script>
                                
                            </div>
                        
                    	</div>
                
                	</div>
        
        		</div>
        
        	</div>
        
        </div>
        
        <div id="divseparator" class="sh"></div>
        
        <div id="column3"><?php $this->load_template('_accessories-dashboard.php'); ?></div>
        
        <div class="sh"></div>
    
    </div>
            
</div>    

<?php
$this->load_template('_foot.php');
$this->load_template('_footer.php');
?>