<div class="content_title"><a href="/master/domains">Domeny</a> > wykresy pozycji w google</div>
<?php $this->load->view('admin/switch_domain');?>

	<?php
		$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="/master/domain_positions_charts/<?php echo $domain_id; ?>/1">dzienne</a></div>
		<div class="mediumButton"><a class="gray_link" <?php if($kategoriaId==2) echo 'style="color:#ec2323"'; ?> href="/master/domain_positions_charts/<?php echo $domain_id; ?>/2">tygodniowe</a></div> 
		<div class="mediumButton"><a class="gray_link" <?php if($kategoriaId==3) echo 'style="color:#ec2323"'; ?> href="/master/domain_positions_charts/<?php echo $domain_id; ?>/3">miesieczne</a></div>  
		<div class="mediumButton"><a class="gray_link" <?php if($kategoriaId==4) echo 'style="color:#ec2323"'; ?> href="/master/domain_positions_charts/<?php echo $domain_id; ?>/4">kwartalne</a></div>  
		<div class="mediumButton"><a class="gray_link" <?php if($kategoriaId==5) echo 'style="color:#ec2323"'; ?> href="/master/domain_positions_charts/<?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 	
		
		
		$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 />
	<a href="/master/domains" class="simpleButton">WSTECZ</a>
										
<script type="text/javascript">
	//skrypty do wykresów flashowych
	function ofc_ready()
	{
	   // alert('ofc_ready');
	}
	var data = null;
	
	function open_flash_chart_data()
	{
	    //alert( 'reading data' );
	    return JSON.stringify(data);
	}
	
	function findSWF(movieName) {
	  if (navigator.appName.indexOf("Microsoft")!= -1) {
	    return window[movieName];
	  } else {
	    return document[movieName];
	  }
	}
		
      $(document).ready(function() {
	  	
		var url = "<?php echo base_url(); ?>" +$("#my_chart").text();	 
		$.getJSON(url,
		        function(param){
				   data = param;	
		           swfobject.embedSWF("/files/open-flash-chart.swf", "my_chart", "595", "400", "9.0.0");
		        });			 
	         		
      });
	  //end of skrypty do wykresów flashowych
</script>	