<?xml version="1.0" encoding="iso-8859-1"?>
<template version="0.1">
  <insert type="data">
    <![CDATA[ 
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<link rel="stylesheet" type="text/css" href="file:///tpa/preset/system/wap/rss/internal.css">
<style type="text/css">

@media all {
  .item {
    clear:both;
    margin-top:5px;
    padding:0px;
  }

  .control{
    float:left;
    clear:left;
    margin:8px 5px 0px 5px;
    width:9px;
    height:9px;
    background-image:url(file:///tpa/preset/system/wap/rss/expandcollapse.gif);
  }

  .feedImage {
    border:0px;
    clear:both;
    margin-top:5px;
  }    

  .more {
    float:left;
    display:block; 
    height:20px; 
    width: 30px; 
    background-image: url(file:///tpa/preset/system/wap/rss/readmore.png);
    margin-bottom:5px;
    margin-right: 5px;
  }

  .send {
    float:left;
    display:block;
    height:20px;
    width:24px;
    background-image: url(file:///tpa/preset/system/wap/rss/smsto.png);
    margin-bottom:5px;
    margin-right: 5px;
  }

  .enc_image{
    float:left;
    display:block;
    height:20px;
    width:24px;
    background-image: url(file:///tpa/preset/system/wap/rss/enc_image.png);
    margin-bottom:5px;
    margin-right: 5px;
  }

  .enc_video{
    float:left;
    display:block;
    height:20px;
    width:24px;
    background-image: url(file:///tpa/preset/system/wap/rss/enc_video.png);
    margin-bottom:5px;
    margin-right: 5px;
  }

  .enc_audio{
    float:left;
    display:block;
    height:20px;
    width:24px;
    background-image: url(file:///tpa/preset/system/wap/rss/enc_audio.png);
    margin-bottom:5px;
    margin-right: 5px;
  }

  .hide{
    display: none;
  }

  .links{
    float: right;  
    clear: both;
  }
  
  .clear{
    clear: both;
  }
  
  .lastRow{
    height: 30px;
  }
}  
</style>
]]>
</insert>

<if variable="feed-rightaligned-text-language" condition="exists">
<insert type="data">
  <![CDATA[
<style type="text/css">
  .title {
    text-align:right;
  }

  .titlewithborder {
    text-align:right;
  }

  .description {
    text-align:right;
  }

  .descriptionwithborder {
    text-align:right;
  }
  
  .more {
    float:right;
    margin-left: 5px;
  }

  .send {
    float:right;
    margin-left: 5px;
  }

  .enc_image{
    float:right;
    margin-left: 5px;
  }

  .enc_video{
    float:right;
    margin-left: 5px;
  }

  .enc_audio{
    float:;
    margin-left: 5px;
  }

  .links{
    float: left; 
  }
</style>
]]>
</insert>
</if>

<insert type="data">
<![CDATA[<script type="text/javascript"> 
<!--
preload_image = new Image()
preload_image.src="file:///tpa/preset/system/wap/rss/expandcollapse.gif"
var readmorelink
var send
var enclosure
var savedIndex = -1;

function toggle(objId){
  var o=document.getElementById('descr'+objId)
  var t=document.getElementById('title'+objId)
  var i=document.getElementById('img'+objId).style

  if(o && t && i){
    if(o.style.display=='none'){
      // Show the description
      o.style.display='block'
      i.backgroundPosition="0px -9px"

      // Scroll to the item; try to make both the top and bottom edges
      // visible.
      var m = document.getElementById('more'+objId)
      var topEdge = t.offsetTop - 2
      var bottomEdge = m.offsetTop + m.offsetHeight + 2

      if (bottomEdge > window.scrollY + window.innerHeight)
      {
        window.scrollTo(0, bottomEdge - window.innerHeight)
      }
      if (topEdge < window.scrollY)
      {
        window.scrollTo(0, topEdge)
      }
      showItemBorder(objId);
      savedIndex=objId;
      t.focus();
    }else{
      // Hide the description
      o.style.display='none'
      i.backgroundPosition="0px 0px"
      removeItemBorder(objId);
      if(savedIndex==objId)
        savedIndex = -1;
      t.focus();
    }
  }
}

function setup(items){
  readmorelink=new Array(items)
  send=new Array(items)
  enclosure=new Array(items)
  for(t=0;t<items;t++)
  {
    readmorelink[t]=document.getElementById( "more" + t ).style
    send[t]=document.getElementById( "send" + t ).style
    if(document.getElementById( "enclosure" + t ) != null)
     {
       enclosure[t]=document.getElementById( "enclosure" + t ).style
     }
  }
  // Set focus on an item
  var i=location.hash.slice(2)
  var k=document.getElementById('link'+i)
  
  if(location.hash.slice(1,2) == "e")
  {
    // Show expanded item
    toggle(i)
  }
  else
  {
    k.focus();
  }
}


function sel(i, item){
  if(item[i] != null)
    item[i].backgroundPosition="0px -20px"

  // Hide the last expanded border
  if (savedIndex != -1 && savedIndex != i){
    removeItemBorder(savedIndex);
  }
  // Show border if expanded
  var o=document.getElementById("descr"+i);
  if(o.style.display == "block"){
    showItemBorder(i);
    savedIndex=i;
  }  	
}

function unsel(i, item){
  if(item[i] != null)
    item[i].backgroundPosition="0px 0px"
}

function focusTitle(v){
 // Hide the last expanded border
 if (savedIndex != -1 && savedIndex != v){
  removeItemBorder(savedIndex);
 }
 // Show border if expanded
 var o=document.getElementById("descr"+v);
 if(o.style.display == "block"){
  showItemBorder(v);
  savedIndex=v;
 }
}

function removeItemBorder(v){
  document.getElementById("title"+v).className="title";
  document.getElementById("descr"+v).className="description";
}

function showItemBorder(v){
  document.getElementById("title"+v).className="titlewithborder";
  document.getElementById("descr"+v).className="descriptionwithborder";
}

-->
</script>
</head>
<body onload="javascript:setup(]]>
  </insert>
  <insert type="feed-nbr-items" />
  <insert type="data"><![CDATA[)">]]></insert>

  <insert type="data">
    <![CDATA[ 
        <div class="phone" id="top">
      ]]>
  </insert>

  <!-- Insert feed image if exists -->
  <if variable="feed-image" condition="exists">
    <insert type="data">
      <![CDATA[ 
        <div class="feedImage" id="feedimage" align="center">
        <a href="]]>
    </insert>
    <insert type="feed-image-link" />
    <insert type="data"><![CDATA[ "><img src="]]></insert>
    <insert type="feed-image-path" />
    <insert type="data">
      <![CDATA[ "></a>
        </div>
      ]]>
    </insert>
  </if>


  <!-- Insert all items -->
  <for condition="all-items">
    <if variable="estimated-ram-usage" condition="is-enough">
      <insert type="data">
        <![CDATA[ 

          <div class="item">
					<div class="control" id="img]]></insert>
      <insert type="item-id" />
      <insert type="data">
        <![CDATA["></div>
			 
            <a class="title" id="title]]></insert>
      <insert type="item-id" />
      <insert type="data"><![CDATA[" onfocus="JavaScript:focusTitle(]]></insert>
      <insert type="item-id" />
      <insert type="data"><![CDATA[);" href="javascript:toggle(]]></insert>
      <insert type="item-id" />
      <insert type="data"><![CDATA[)">]]></insert>
      <insert type="item-title" />
      <insert type="data">
        <![CDATA[ 
          </a>
          <div class="description" style="display: none;" id="descr]]></insert>
      <insert type="item-id" />
      <insert type="data">
        <![CDATA[">
        ]]>
      </insert>
      <insert type="item-description" />

      <insert type="data">
        <![CDATA[ 
          <div class="links">]]>
      </insert>

      <if variable="item-enclosure" condition="exists">
        <insert type="data"><![CDATA[<a class="]]></insert>
        <insert type="item-enclosure-type"/>
        <insert type="data"><![CDATA[" id="enclosure]]></insert>
        <insert type="item-id" />
        <insert type="data"><![CDATA[" onblur="JavaScript:unsel(]]></insert>
        <insert type="item-id" />
        <insert type="data"><![CDATA[, enclosure)" onfocus="JavaScript:sel(]]></insert>
        <insert type="item-id" />
        <insert type="data"><![CDATA[, enclosure)" href="x-semc-sca-enc://]]></insert>
        <insert type="item-enclosure-id" />
        <insert type="data"><![CDATA["></a>]]></insert>
      </if>

      <insert type="data">
        <![CDATA[ 
            <a class="send" id="send]]></insert>
      <insert type="item-id" />
      <insert type="data"><![CDATA[" onblur="JavaScript:unsel(]]></insert>
      <insert type="item-id" />
      <insert type="data"><![CDATA[, send)" onfocus="JavaScript:sel(]]></insert>
      <insert type="item-id" />
      <insert type="data"><![CDATA[, send)" href="smsto:?body=]]></insert>
      <insert type="item-smsto-title" />
      <insert type="data"><![CDATA[%0d%0a]]></insert>
      <insert type="item-smsto-link" />
      <insert type="data"><![CDATA["></a>]]></insert>


      <insert type="data">
        <![CDATA[
            <a class="more" id="more]]></insert>
      <insert type="item-id" />
      <insert type="data"><![CDATA[" onblur="JavaScript:unsel(]]></insert>
      <insert type="item-id" />
      <insert type="data"><![CDATA[, readmorelink)" onfocus="JavaScript:sel(]]></insert>
      <insert type="item-id" />
      <insert type="data"><![CDATA[, readmorelink)" href="]]></insert>
      <insert type="item-link" />
      <insert type="data"><![CDATA["></a></div></div><div class="clear"></div></div>]]></insert>
    </if>
  </for>
  <insert type="data">
    <![CDATA[
      <div class="lastRow">&nbsp;</div>
    </div>
  </body>
</html>]]>
  </insert>
</template>