<div id="rightBox">
	<table border="0" cellpadding="0" cellspacing="0" class="rightBox_table">
		<tr>
			<td><img src="/files/contentBoxTop.jpg" alt="" width="690" height="16"/></td>
		</tr>
		<tr>
			<td valign="top" style="background-image: url(/files/contentBoxMiddle.jpg); width: 690px; height: 547px; background-position: center top; background-repeat: no-repeat;">
				<div id="rightBox_content">
					<?php
						if($this->uri->segment('1')=='superadmin') 
							$link = 'superadmin';
						else		
							$link = 'admin';
							
						$kategoriaId = $this->uri->segment('4');
						if($kategoriaId == 0)
							$kategoriaId = 1;
					?>
					
						<div class="mediumButton"><a class="gray_link" <?php if($kategoriaId==1) echo 'style="color:#ec2323"'; ?> href="/<?=$link;?>/show_domain_chart/<?php echo $domain_id; ?>/1">dzienne</a></div>
						<div class="mediumButton"><a class="gray_link" <?php if($kategoriaId==2) echo 'style="color:#ec2323"'; ?> href="/<?=$link;?>/show_domain_chart/<?php echo $domain_id; ?>/2">tygodniowe</a></div> 
						<div class="mediumButton"><a class="gray_link" <?php if($kategoriaId==3) echo 'style="color:#ec2323"'; ?> href="/<?=$link;?>/show_domain_chart/<?php echo $domain_id; ?>/3">miesieczne</a></div>  
						<div class="mediumButton"><a class="gray_link" <?php if($kategoriaId==4) echo 'style="color:#ec2323"'; ?> href="/<?=$link;?>/show_domain_chart/<?php echo $domain_id; ?>/4">kwartalne</a></div>  
						<div class="mediumButton"><a class="gray_link" <?php if($kategoriaId==5) echo 'style="color:#ec2323"'; ?> href="/<?=$link;?>/show_domain_chart/<?php echo $domain_id; ?>/5">roczne</a></div>
					<br /><br /><br />
					
					<?php
					
						$type = $this->uri->segment(4);
						
						
						if ($type==null)
						{
							$type=1;
						}
						
					switch($type)
										{
										case 1: {
										    			// "Dzienne"; 
													//echo '<img src="/charts/chart_line/'.$domain_id.'" />';
														echo '<div id="my_chart">charts/flash_chart_line/'.$domain_id.'</div>';
														break;
													}
										case 2: {
										    			// "tygodniowe"; 
														//echo '<img src="/charts/chart_line_weekly/'.$domain_id.'" />';
														echo '<div id="my_chart">charts/flash_chart_line_weekly/'.$domain_id.'</div>';
														break;
													}
										case 3: {
										    			// "miesieczne"; 
														//echo '<img src="/charts/chart_line_monthly/'.$domain_id.'" />';	
														echo '<div id="my_chart">charts/flash_chart_line_monthly/'.$domain_id.'</div>';							
														break;
													}
										case 4: {
										   			// "kwartalne"; 
													//echo '<img src="/charts/chart_line_quartely/'.$domain_id.'" />';
													echo '<div id="my_chart">charts/flash_chart_line_quartely/'.$domain_id.'</div>';								
													break;
												}
										
										case 5: {
							    			// "roczne"; 
											//echo '<img src="/charts/chart_line_yearly/'.$domain_id.'" />';
											echo '<div id="my_chart">charts/flash_chart_line_yearly/'.$domain_id.'</div>';		
											break;
										}						
					}
					?>
					
					<br /><br />
					<div>
					<?php 	
							
							/*
							$colors[0] = 'rgb(100, 149, 237)';
							$colors[1] = 'rgb(240, 128, 128)';
							$colors[2] = 'rgb(50, 205, 50)';
							$colors[3] = 'rgb(255, 215, 0)';
							$colors[4] = 'rgb(131, 111, 255)';
							$colors[5] = 'rgb(144, 238, 144)';
							$colors[6] = 'rgb(70, 130, 180)';
							$colors[7] = 'rgb(244, 164, 96)';
							$colors[8] = 'rgb(139, 121, 94)';
							$colors[9] = 'rgb(190, 190, 190)';
							*/
							/*
							$colors[0] = 'rgb(255, 0, 0)';
							$colors[1] = 'rgb(255, 255, 0)';
							$colors[2] = 'rgb(0, 255, 0)';
							$colors[3] = 'rgb(0, 255, 255)';
							$colors[4] = 'rgb(0, 0, 255)';
							$colors[5] = 'rgb(255, 0, 255)';
							$colors[6] = 'rgb(149, 149, 149)';
							$colors[7] = 'rgb(96, 57, 19)';
							$colors[8] = 'rgb(130, 123, 0)';
							$colors[9] = 'rgb(0, 88, 38)';
							$colors[10] = 'rgb(247, 151, 151)';
							$colors[11] = 'rgb(146, 39, 143)';
							$colors[12] = 'rgb(54, 54, 54)';
							$colors[13] = 'rgb(96, 92, 169)';
							$colors[14] = 'rgb(60, 184, 120)';
							$colors[15] = 'rgb(13, 0, 76)';
							$colors[16] = 'rgb(199, 178, 154)';
							$colors[17] = 'rgb(75, 0, 73)';
							*/								
						
						$i=0;
						foreach($keywords as $keyword)
						{
							$querystring = 'search?q='.str_replace(' ','+',$keyword['keyword']).'&num=10';
							echo '<div style="float:left;text-align:left;width:32px; height:14px; background-color:'.$colors[$i].'">&nbsp;</div><div style="float:left;"> &nbsp;&nbsp;&nbsp; <a href="http://google.'.$google_region.'/'.$querystring.'" target="_blank">'.$keyword['keyword'].'</a></div><br style="clear:both"/><br />';
							$i++;
						}
					?>
							<div style="float:left;text-align:left;width:32px; height:14px; background-color:#ffffff">PZ</div>
							<div style="float:left;"> &nbsp;&nbsp;&nbsp; poza zakresem</div>
					</div>	
						<br style="clear:both"/><br />
					<div class="smallButton2"><a class="gray_link" href="/<?=$link;?>/domain">WSTECZ</a></div>
				</div>
			</td>	
		</tr>
		<tr>
			<td><img src="/files/contentBoxBottom.jpg" alt="" width="690" height="17"/></td>
		</tr>
	</table>
</div>	

