<table width="100%" border="0" cellpadding="8" cellspacing="0">
  <tr>
    <td height="100"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td>
		<?php if($leftbanner[0]->simage!='' and file_exists('./static/uploadfiles/banners/'.$leftbanner->simage)){?>
        <img class="img-responsive" name="leftbannerimg" src="./utility/processImage.php?imageName=<?php echo urlencode($leftbanner[0]->simage); ?>&w=255&h=93&mod=2&type=2&<?php echo date("HisdmY");?>" <?php if($leftbanner[0]->surl!=''){?> style="cursor:pointer" onclick="saveClick_left()"<?php }?> /><?php }?></td>
		
		<script language="javascript">

		/*
		Random image slideshow- By Tyler Clarke (tyler@ihatecoffee.com)
		For this script and more, visit http://www.javascriptkit.com
		*/
		var curindex_left=0;
		
		var randomimages_left=new Array()
		var randomurl_left=new Array()
		var randomtype_left=new Array()
		var randomid_left=new Array()
		<?php 
		$i=0;
		foreach($leftbanner as $tb){
			if($tb->simage !='' and file_exists('./static/uploadfiles/banners/'.$tb->simage)){
			?>
				randomimages_left[<?php echo $i?>]="<?php echo "./utility/processImage.php?imageName=".urlencode($tb->simage)."&w=430&h=80&mod=2&type=2&".date("HisdmY");?>";
				randomurl_left[<?php echo $i?>]='<?php echo str_replace('http://','',$tb->surl)?>';
				randomtype_left[<?php echo $i?>]='top';
				randomid_left[<?php echo $i?>]='<?php echo $tb->id?>'
			<?php
			}
			$i++;
		}
		?>
		
		function rotateimage_left(){
		
		if (curindex_left==(tempindex_left=Math.floor(Math.random()*(randomimages_left.length)))){
		curindex_left=curindex_left==0? 1 : curindex_left-1
		}
		else
		curindex_left=tempindex_left
		
			document.images.leftbannerimg.src=randomimages_left[curindex_left];
				document.getElementById("leftbanner_u").value = randomurl_left[curindex_left];
				document.getElementById("leftbanner_type").value = randomtype_left[curindex_left];
				document.getElementById("leftbanner_id").value = randomid_left[curindex_left];
		}
		
		setInterval("rotateimage_left()",delay)
		
		</script>
		
        <td align="center"><?php if($bottombanner[0]->simage!='' and file_exists('./static/uploadfiles/banners/'.$bottombanner[0]->simage)){?><img class="img-responsive" name="bottombannerimg" src="./utility/processImage.php?imageName=<?php echo urlencode($bottombanner[0]->simage); ?>&w=490&h=90&mod=2&type=2&<?php echo date("HisdmY");?>" <?php if($bottombanner[0]->surl!=''){?> style="cursor:pointer" onclick="saveClick_bottom()"<?php }?> /><?php }?></td>
		
		<script language="javascript">

		/*
		Random image slideshow- By Tyler Clarke (tyler@ihatecoffee.com)
		For this script and more, visit http://www.javascriptkit.com
		*/
		var curindex_bottom=0;
		
		var randomimages_bottom=new Array()
		var randomurl_bottom=new Array()
		var randomtype_bottom=new Array()
		var randomid_bottom=new Array()
		<?php 
		$i=0;
		foreach($bottombanner as $tb){
			if($tb->simage !='' and file_exists('./static/uploadfiles/banners/'.$tb->simage)){
			?>
				randomimages_bottom[<?php echo $i?>]="<?php echo "./utility/processImage.php?imageName=".urlencode($tb->simage)."&w=430&h=80&mod=2&type=2&".date("HisdmY");?>";
				randomurl_bottom[<?php echo $i?>]='<?php echo str_replace('http://','',$tb->surl)?>';
				randomtype_bottom[<?php echo $i?>]='top';
				randomid_bottom[<?php echo $i?>]='<?php echo $tb->id?>'
			<?php
			}
			$i++;
		}
		?>
		
		function rotateimage_bottom(){
		
		if (curindex_bottom==(tempindex_bottom=Math.floor(Math.random()*(randomimages_bottom.length)))){
		curindex_bottom=curindex_bottom==0? 1 : curindex_bottom-1
		}
		else
		curindex_bottom=tempindex_bottom
		
			document.images.bottombannerimg.src=randomimages_bottom[curindex_bottom];
				document.getElementById("bottombanner_u").value = randomurl_bottom[curindex_bottom];
				document.getElementById("bottombanner_type").value = randomtype_bottom[curindex_bottom];
				document.getElementById("bottombanner_id").value = randomid_bottom[curindex_bottom];
		}
		
		setInterval("rotateimage_bottom()",delay)
		
		</script>
		
        <td align="right"><?php if($rightbanner[0]->simage!='' and file_exists('./static/uploadfiles/banners/'.$rightbanner[0]->simage)){?><img class="img-responsive" name="rightbannerimg" src="./utility/processImage.php?imageName=<?php echo urlencode($rightbanner[0]->simage); ?>&w=255&h=93&mod=2&type=2&<?php echo date("HisdmY");?>" <?php if($rightbanner[0]->surl!=''){?> style="cursor:pointer" onclick="saveClick_right()"<?php }?> /><?php }?></td>
		
		<script language="javascript">

		/*
		Random image slideshow- By Tyler Clarke (tyler@ihatecoffee.com)
		For this script and more, visit http://www.javascriptkit.com
		*/
		var curindex_right=0;
		
		var randomimages_right=new Array()
		var randomurl_right=new Array()
		var randomtype_right=new Array()
		var randomid_right=new Array()
		<?php 
		$i=0;
		foreach($rightbanner as $tb){
			if($tb->simage !='' and file_exists('./static/uploadfiles/banners/'.$tb->simage)){
			?>
				randomimages_right[<?php echo $i?>]="<?php echo "./utility/processImage.php?imageName=".urlencode($tb->simage)."&w=430&h=80&mod=2&type=2&".date("HisdmY");?>";
				randomurl_right[<?php echo $i?>]='<?php echo str_replace('http://','',$tb->surl)?>';
				randomtype_right[<?php echo $i?>]='top';
				randomid_right[<?php echo $i?>]='<?php echo $tb->id?>'
			<?php
			}
			$i++;
		}
		?>
		
		function rotateimage_right(){
		
		if (curindex_right==(tempindex_right=Math.floor(Math.random()*(randomimages_right.length)))){
		curindex_right=curindex_right==0? 1 : curindex_right-1
		}
		else
		curindex_right=tempindex_right
		
			document.images.rightbannerimg.src=randomimages_right[curindex_right];
				document.getElementById("rightbanner_u").value = randomurl_right[curindex_right];
				document.getElementById("rightbanner_type").value = randomtype_right[curindex_right];
				document.getElementById("rightbanner_id").value = randomid_right[curindex_right];
		}
		
		setInterval("rotateimage_right()",delay)
		
		</script>
      </tr>
    </table></td>
  </tr>
</table>

