<?xml version="1.0" encoding="UTF-8" ?>
<Module>
	<ModulePrefs 
							width="285" 
							height="272" 
	 						title="Canali TV italiani" 
							title_url="http://it.30minutelunchbreak.com" 
							description="Guarda canali TV Italiani" 
							author="30minutelunchbreak.com" 
							author_email="info@30minutelunchbreak.com" 
							thumbnail="http://www.30minutelunchbreak.com/gadgets/livetv_tn.jpg"
							screenshot="http://www.30minutelunchbreak.com/gadgets/livetvit.jpg" 
							author_location="Amsterdam, Netherlands">
 <Require feature="analytics" />
 <Locale lang="it" />
 </ModulePrefs>
 <UserPref name="kanaal" display_name="Canale TV predefinito:" default_value="RAI News24" datatype="string">
</UserPref>	 
<UserPref name="autoplay" display_name="Autostart:" default_value="Si" datatype="enum">
<EnumValue value="Si"/>
<EnumValue value="No"/>
</UserPref>
 
 <Content type="html">
     <![CDATA[
 
 <STYLE type=text/css>
input {width: 8em;font-size: 9px}

a.rstyle { 
color:#ffcc66;
font-size: 9px;
font-family: verdana, sans-serif;
}
a.rstyle:link        {color: #ffcc66;font-size: 9px;}
a.rstyle:visited     {color: #ffcc66;font-size: 9px;}


a.tstyle { 
color:#89a4ff;
font-size: 9px;
font-family: arial;
text-decoration:none;
font-weight: bold;
}
a.tstyle:link        {color: #89a4ff;font-size: 9px;}
a.tstyle:visited     {color: #89a4ff;font-size: 9px;}

select { 
 background-color: #000000; 
 color: #89a4ff;
 font-size: 7pt;
 font-family: verdana, sans-serif;
}

#pbutton { height: 26px;width: 25px }

</STYLE>

<script>
   // Track this gadget using Google Analytics.
   _IG_Analytics("UA-1098462-34", "/test_analyticslib");
</script>

<script language="JavaScript" for="MediaPlayer" event="playStateChange(newState)">
    wmpPlayStateChange(newState); </script>


<script language="javascript">
var chanch=0;
var iNews=0;
var ftxt = "";
var urls = "";
var prefs = new _IG_Prefs(__MODULE_ID__);
var kanPref = prefs.getString("kanaal");
var autoPref = prefs.getString("autoplay");
var is_ie = navigator.appName == 'Microsoft Internet Explorer';

var cat = [];
cat[0] = "Notizie"
cat[1] = "Generalita"
cat[2] = "Musica"
cat[3] = "Sport"
cat[4] = "Locale"
cat[5] = "Film"

var chn = [];
chn[0] = "Play TV";
chn[1] = "Piu Blu";
chn[2] = "Videolina";
chn[3] = "Bloomberg";
chn[4] = "Toto TV";
chn[5] = "TeleNord";
chn[6] = "RAI News24";
chn[7] = "3 Channel";
chn[8] = "All Music";
chn[9] = "RAI ultimo Tg1";
chn[10] = "Denaro TV";
chn[11] = "Meteo Channel";
chn[12] = "Lazio TV";
chn[13] = "Primocanale";
chn[14] = "Radio Italia";
chn[15] = "RTL 102.5";
chn[16] = "Sicilia TV";
chn[17] = "";
chn[18] = "Tele D1";
chn[19] = "Film Italiani";
chn[20] = "TV Gold";
chn[21] = "TV Oggi";
chn[22] = "Rocktelevision 1";
chn[23] = "PrimAntenna";
chn[24] = "E-TV";
chn[25] = "Quarto Canale TV";
chn[26] = "LA 9";
chn[27] = "Tiziana Lotto";
chn[28] = "CBL Film";
chn[29] = "Cinquestelle TV";
chn[30] = "Sport Italia";
chn[31] = "TeleRadioerre";
chn[32] = "RAI 1";
chn[33] = "RAI 2";
chn[34] = "RAI 3";
chn[35] = "RAI Sport";
chn[36] = "";
chn[37] = "RAI ultimo Tg2";
chn[38] = "RAI ultimo Tg3";
chn[39] = "Telecapri Sport";
chn[40] = "Canale 7";
chn[41] = "Canale 66";

var chs = [];
chs[0] = "http://www.30minutelunchbreak.com/gadgets/streams/play.asx";
chs[1] = "http://151.1.245.65/unitedcom-v";
chs[2] = "http://151.1.245.65/videolina";
chs[3] = "http://www.bloomberg.com/streams/video/LiveIT_nb.asx";
chs[4] = "http://www.lewebradio3.net/TotoTV";
chs[5] = "http://media.datasiel.net/telenord?WMContentBitrate=320000";
chs[6] = "http://mediapolis.rai.it/relinker/relinkerServlet.htm?cont=1";
chs[7] = "http://84.233.254.2/3Channel";
chs[8] = "http://live.mediaserver.kataweb.it/retea";
chs[9] = "http://link.rai.it/x/vod/ue/wmx/ultimo_tg1.asx";
chs[10] = "http://www.30minutelunchbreak.com/gadgets/streams/denaro.asx";
chs[11] = "http://media.meteo.it/TGItaBL.asx";
chs[12] = "mms://88.56.56.33:8081";
chs[13] = "mms://iptv.primocanale.it/diretta";
chs[14] = "http://radioitalialive.str.idc.extra.it/radioitaliatv";
chs[15] = "http://151.1.245.36/rtl102.5vs/";
chs[16] = "http://stream.ion.it/siciliatv";
chs[17] = "http://iptv.telecard.it/Cinquestelle";
chs[18] = "http://stream.mediaonline.it/teled1";
chs[19] = "http://www.lewebradio3.net/VedoFilmTV";
chs[20] = "http://88.56.56.33:8080/";
chs[21] = "http://www.30minutelunchbreak.com/gadgets/streams/tvoggi.asx";
chs[22] = "http://194.116.83.15/New";
chs[23] = "http://www.30minutelunchbreak.com/gadgets/streams/primantenna.asx";
chs[24] = "mms://streaming.e-tv.it/etvsatellite";
chs[25] = "http://212.48.126.114/quartocanale";
chs[26] = "mms://iptv.telecard.it/LA9SAT_HQ";
chs[27] = "http://195.62.238.59:1113/";
chs[28] = "mms://151.1.245.71/cblfilm-live";
chs[29] = "mms://iptv.telecard.it/Cinquestelle";
chs[30] = "http://mms.cdn-tiscali.com/sportitalia/";
chs[31] = "http://www.teleradioerre.com/Teleradioerre";
chs[32] = "http://mediapolis.rai.it/relinker/relinkerServlet.htm?cont=983";
chs[33] = "http://mediapolis.rai.it/relinker/relinkerServlet.htm?cont=984";
chs[34] = "http://mediapolis.rai.it/relinker/relinkerServlet.htm?cont=986";
chs[35] = "http://ad2.neodatagroup.com/ad/rai.jsp?/html.ng/sezione_RAI=rtvstreaming&subsezione_RAI=rtvlivesportpiustreaming";
chs[36] = "http://ski-media-win-1.lsops.net/euronews_it";
chs[37] = "http://link.rai.it/x/vod/ue/wmx/ultimo_tg2.asx";
chs[38] = "http://link.rai.it/x/vod/ue/wmx/ultimo_tg3.asx";
chs[39] = "http://209.227.204.1/telecaprisport.asx";
chs[40] = "http://151.1.245.65/CANALE7";
chs[41] = "mms://88.49.126.60:8080";
 
var chw = [];
chw[0] = "http://www.playtvitalia.it/";
chw[1] = "http://www.piublu.com/";
chw[2] = "http://www.videolina.it/";
chw[3] = "http://www.bloomberg.com";
chw[4] = "http://www.telecaprisport.it/";
chw[5] = "http://www.telenord.it/";
chw[6] = "http://www.rainews24.rai.it/";
chw[7] = "http://www.3channel.it/";
chw[8] = "http://www.allmusic.tv/";
chw[9] = "http://www.tg1.rai.it/";
chw[10] = "http://www.ildenaro.it/denarotv/";
chw[11] = "http://www.meteo.it/";
chw[12] = "http://www.laziotv.com/";
chw[13] = "http://www.primocanale.it/";
chw[14] = "http://www.radioitalia.it/";
chw[15] = "http://www.rtl.it/";
chw[16] = "http://www.siciliatv.org/";
chw[17] = "http://www.sky906.it/";
chw[18] = "http://www.d1television.it/";
chw[19] = "#";
chw[20] = "http://www.tvgold.it/";
chw[21] = "http://www.tvoggisalerno.it/";
chw[22] = "http://rocktelevision.it/";
chw[23] = "http://www.primantenna.it/";
chw[24] = "http://www.e-tv.it/";
chw[25] = "http://www.quartocanaletv.it/";
chw[26] = "http://www.la9.it/";
chw[27] = "http://www.tizianalotto.it/";
chw[28] = "http://www.cblfilm.it/";
chw[29] = "http://www.cinquestelletv.it/";
chw[30] = "http://www.sportitalia.com/";
chw[31] = "http://www.teleradioerre.com/";
chw[32] = "http://www.rai.it/";
chw[33] = "http://www.rai.it/";
chw[34] = "http://www.rai.it/";
chw[35] = "http://www.raisport.rai.it/";
chw[36] = "http://www.euronews.net/it/";
chw[37] = "http://www.tg2.rai.it/";
chw[38] = "http://www.tg3.rai.it/";
chw[39] = "http://www.telecapri.it/ ";
chw[40] = "http://www.canale7.tv/";
chw[41] = "http://www.canale66.com/";

_IG_RegisterOnloadHandler(startTV);


function initWMP(channel) {
 if (is_ie)
 		document.getElementById("TV2tje").innerHTML = "<OBJECT ID='MediaPlayer'  WIDTH='270' HEIGHT='230' CLASSID='CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6' TYPE='application/x-oleobject'><PARAM name='uiMode' value='mini'></object>";
 else
 		document.getElementById("TV2tje").innerHTML = "<OBJECT ID='MediaPlayer' WIDTH='270' HEIGHT='230'  type='application/x-ms-wmp' data='" + chs[channel] + "'></object>";

 }

function loadChan(channel) {
 var wmp = document.getElementById('MediaPlayer');
 wmp.URL=channel;
}

 function wmpPlayStateChange(newState) {
     if(newState==1)
		 	stopPlayer();
			if(newState==6)
			startPlayer();
} 

function fillCategory(){ 
     // this function is used to fill the category list on load
    addOption(document.drop_list.Category, cat[5], cat[5], "");
    addOption(document.drop_list.Category, cat[1], cat[1], "");
    addOption(document.drop_list.Category, cat[4], cat[4], "");
    addOption(document.drop_list.Category, cat[2], cat[2], "");
    addOption(document.drop_list.Category, cat[0], cat[0], "");
    addOption(document.drop_list.Category, cat[3], cat[3], "");
}
    
function SelectSubCat(){
    // ON selection of category this function will work
    
    removeAllOptions(document.drop_list.SubCat);
		addOption(document.drop_list.SubCat, "#", "Stazione:");
		
		if(document.drop_list.Category.value == cat[0]){
		addOption(document.drop_list.SubCat,"javascript:switchChannel(3)",chn[3]);
		addOption(document.drop_list.SubCat,"javascript:switchChannel(10)",chn[10]);
		addOption(document.drop_list.SubCat,"javascript:switchChannel(11)",chn[11]);	
		addOption(document.drop_list.SubCat,"javascript:switchChannel(6)",chn[6]);
		addOption(document.drop_list.SubCat,"javascript:switchChannel(9)",chn[9]);
		addOption(document.drop_list.SubCat,"javascript:switchChannel(37)",chn[37]);
		addOption(document.drop_list.SubCat,"javascript:switchChannel(38)",chn[38]);		
    }
		
	  if(document.drop_list.Category.value == cat[1]){
    addOption(document.drop_list.SubCat,"javascript:switchChannel(0)",chn[0]);
    addOption(document.drop_list.SubCat,"javascript:switchChannel(23)",chn[23]);
    addOption(document.drop_list.SubCat,"javascript:switchChannel(32)",chn[32]);
    addOption(document.drop_list.SubCat,"javascript:switchChannel(33)",chn[33]);
    addOption(document.drop_list.SubCat,"javascript:switchChannel(34)",chn[34]);
    addOption(document.drop_list.SubCat,"javascript:switchChannel(35)",chn[35]);
    addOption(document.drop_list.SubCat,"javascript:switchChannel(18)",chn[18]);
    addOption(document.drop_list.SubCat,"javascript:switchChannel(31)",chn[31]);		
    addOption(document.drop_list.SubCat,"javascript:switchChannel(20)",chn[20]);

    }
    
    if(document.drop_list.Category.value == cat[2]){

    addOption(document.drop_list.SubCat,"javascript:switchChannel(8)",chn[8]);
    addOption(document.drop_list.SubCat,"javascript:switchChannel(29)",chn[29]);
    addOption(document.drop_list.SubCat,"javascript:switchChannel(14)",chn[14]);
    addOption(document.drop_list.SubCat,"javascript:switchChannel(22)",chn[22]);
    addOption(document.drop_list.SubCat,"javascript:switchChannel(15)",chn[15]);
    addOption(document.drop_list.SubCat,"javascript:switchChannel(27)",chn[27]);
		}
		
		if(document.drop_list.Category.value == cat[3]){

    addOption(document.drop_list.SubCat,"javascript:switchChannel(35)",chn[35]);
    addOption(document.drop_list.SubCat,"javascript:switchChannel(30)",chn[30]);
    addOption(document.drop_list.SubCat,"javascript:switchChannel(39)",chn[39]);
		}

		if(document.drop_list.Category.value == cat[4]){

    addOption(document.drop_list.SubCat,"javascript:switchChannel(7)",chn[7]);
    addOption(document.drop_list.SubCat,"javascript:switchChannel(40)",chn[40]);
    addOption(document.drop_list.SubCat,"javascript:switchChannel(41)",chn[41]);		
    addOption(document.drop_list.SubCat,"javascript:switchChannel(24)",chn[24]);
    addOption(document.drop_list.SubCat,"javascript:switchChannel(26)",chn[26]);
    addOption(document.drop_list.SubCat,"javascript:switchChannel(12)",chn[12]);
    addOption(document.drop_list.SubCat,"javascript:switchChannel(1)",chn[1]);
    addOption(document.drop_list.SubCat,"javascript:switchChannel(13)",chn[13]);
    addOption(document.drop_list.SubCat,"javascript:switchChannel(25)",chn[25]);
    addOption(document.drop_list.SubCat,"javascript:switchChannel(16)",chn[16]);
    addOption(document.drop_list.SubCat,"javascript:switchChannel(21)",chn[21]);
    addOption(document.drop_list.SubCat,"javascript:switchChannel(5)",chn[5]);
    addOption(document.drop_list.SubCat,"javascript:switchChannel(2)",chn[2]);		
		}
		if(document.drop_list.Category.value == cat[5]){

    addOption(document.drop_list.SubCat,"javascript:switchChannel(28)",chn[28]);		
    addOption(document.drop_list.SubCat,"javascript:switchChannel(19)",chn[19]);
    addOption(document.drop_list.SubCat,"javascript:switchChannel(4)",chn[4]);
		}

		
}

function removeAllOptions(selectbox)
{
	var i;
	for(i=selectbox.options.length-1;i>=0;i--)
	{
		//selectbox.options.remove(i);
		selectbox.remove(i);
	}
}

function addOption(selectbox, value, text )
{
	var optn = document.createElement("OPTION");
	optn.text = text;
	optn.value = value;

	selectbox.options.add(optn);
}

function switchChannel(chnr)
{ 		
		if (is_ie)
			 document.getElementById('MediaPlayer').settings.autoStart = "true";
		
		if (!is_ie)
	 	 		initWMP(chnr);
		else		
		    loadChan(chs[chnr]);
		chanch=chnr;
  	GetMessage();
}

function openWeb(chnr)
{
		stopPlayer();
    window.open(chw[chnr],'mywindow','toolbar=yes,location=yes,resizable=yes,status=yes,menubar=yes,scrollbars=yes,width=1024,height=768');
}


function startTV()
{
  for (var i=0; i<42; i++)
  	{
   		if (kanPref == chn[i]){
   			 chanch = i;
  		}
  }
 fillCategory();
 if (is_ie)
		initWMP();
	GetMessage();

  if (autoPref=="No")
	{
			 if (is_ie)
			 		stopPlayer();
			 else		
			 	 showAd();
	}		 
	else
		  switchChannel(chanch);
}


function GetMessage()
{
 document.getElementById('myMsg').innerHTML = "<a class='rstyle' href='" + chw[chanch] + "' target='blank_'>"+ chn[chanch]+ "</a>  (Doppio click per lo schermo pieno)";
 }
 
function stopPlayer()
{ 
	  document.getElementById('MediaPlayer').settings.autoStart = "false";
		loadChan(chs[chanch]);
		document.getElementById('Adver').style.visibility="visible"; 
		
}

function showAd()
{
	
  var str="";
 str+= "<div style=' width:270px; height:230px;overflow:hidden; '>";
 str+= "<table width='270px' border='0' cellpadding='0' cellspacing='0'>";
			      str+= "<tr><td valign='top' align='center'>";
	
						str+='<iframe id="urlad" frameborder="0" height="185" name="frame1"  src="http://www.xs4all.nl/~noraz/gadit.html" scrolling="no"  width="270"><\/iframe>';
	
	
						str+= "</td></tr>";
						str+= "<tr><td valign='top' align='center'>";
							str+= "<img id='imstat' border=0 >";
			     str+='<div style="margin-top:-30px;margin-left:-230px;">';
            str+=' <input type="image" id="pbutton"  onClick="switchChannel(chanch)" title="Play">';
            str+=' <\/div>';
					
						str+= "</td></tr>";
  str+= "</table>";
  str+= "</div>";
 _gel('TV2tje').innerHTML = str;
 _gel("imstat").src = _IG_GetImageUrl("http://www.xs4all.nl/~noraz/wmpcontrol.png"); 
 _gel("pbutton").src = _IG_GetImageUrl("http://www.xs4all.nl/~noraz/wmpplay.png");

}

function startPlayer()
{
 		document.getElementById('Adver').style.visibility="hidden"; 
}

 
</script>

<table width="270" border="0" cellpadding="0" cellspacing="0" border="0" align="center" bgcolor="black">
<tr>
<td align="center" >
		<div id="myMsg"  style="width:270;background-color:#2b2b2b;color:#ffcc66;font-size: 9px;font-family: verdana, sans-serif;"></div>
		<div id="TV2tje" style="height:230;"></div>
    <div id="Adver" style="position:absolute;top:20px; width:270px; height:175px;"><iframe id="urlad" frameborder="0" height="175" name="frame1"  src="http://www.xs4all.nl/~noraz/gadit.html" scrolling="no"  width="270"></iframe></div>
    <div id="dropf" style="width:270px;" >
    <FORM name="drop_list" >
      <SELECT id="MainCat" NAME="Category" onChange="SelectSubCat()" size="1">
      <Option value="">Categoria:</option>
      </SELECT>
      <SELECT id="SubCat" NAME="Plaats" OnChange="location.href=this.options[this.selectedIndex].value" size="1">
      <Option value="">--</option>
      </SELECT>
    </FORM></div>
</td>
</tr>
</table>

<SCRIPT>
  function OnDSPlayStateChangeEvt(NewState)
  {
		if(NewState==10 || NewState==1)
		   showAd();
			if(NewState==6)
			startPlayer();

  }
</SCRIPT>

]]> </Content>
</Module>  