<!--
var ModalDialogWindow;
var ModalDialogInterval;
var ModalDialog = new Object;

ModalDialog.value = '';
ModalDialog.eventhandler = ''; 

 function ModalDialogMaintainFocus()
 {
  try
  {
    if (ModalDialogWindow.closed)
     {
        window.clearInterval(ModalDialogInterval);
        eval(ModalDialog.eventhandler);       
        return;
     }
    ModalDialogWindow.focus(); 
  }
  catch (everything) {   }
 }
        
 function ModalDialogRemoveWatch()
 {
    ModalDialog.value = '';
    ModalDialog.eventhandler = '';
 }
        
 function ModalDialogShow(Title,BodyText,Buttons,EventHandler)
 {

   ModalDialogRemoveWatch();
   ModalDialog.eventhandler = EventHandler;

   var args='width=700,height=322,left=325,top=300,toolbar=0,';
       args+='location=0,status=0,menubar=0,scrollbars=1,resizable=0';  

   ModalDialogWindow=window.open("","",args); 
   ModalDialogWindow.document.open(); 
   ModalDialogWindow.document.write('<html>');
   ModalDialogWindow.document.write('<head>'); 
   ModalDialogWindow.document.write('<title>' + Title + '</title>');
   ModalDialogWindow.document.write('<script' + ' language=JavaScript>');
   ModalDialogWindow.document.write('function CloseForm(Response) ');
   ModalDialogWindow.document.write('{ ');
   ModalDialogWindow.document.write(' window.opener.ModalDialog.value = Response; ');
   ModalDialogWindow.document.write(' window.close(); ');
   ModalDialogWindow.document.write('} ');
   ModalDialogWindow.document.write('</script' + '><link href="http://www.teletext.co.uk/teletext.css" rel="stylesheet" type="text/css" /><link type="text/css" rel="stylesheet" href="/css/teletextwidget.css" />');        
   ModalDialogWindow.document.write('</head>');   
   ModalDialogWindow.document.write('<body id="popup" onblur="window.focus();">');   
   ModalDialogWindow.document.write('<div id="containerD"><div id="columnLeftD"><div class="subHead">Terms and Conditions</div><div id="text">These terms and conditions apply to you when you click on Create My Widget. You may terminate this agreement at any time by removing the Teletext Widget code from your intranet site. You may only install the Teletext Widget on an intranet site, not on commercial websites, personal pages or social media sites. By clicking on the Create My Widget button, you are granted a royalty-free, non-exclusive licence to display the selected Teletext headlines on your intranet site. You may not edit or alter the headlines you receive via the Teletext Widget.  In particular, when you use the Teletext Widget for an intranet site, you must not delete or otherwise remove the Teletext branding from the content received, ensuring the headlines are attributed to Teletext. You must not copy, sell or redistribute the content in the Teletext Widget other than as permitted by these terms and conditions. You must ensure the headlines within the Teletext Widget link to the full story on Teletext.co.uk. Teletext has the right to modify the service at any time. Our headlines and the information they contain are protected by copyright and other rights. The headlines and any underlying information, may not be: reproduced (whole or in part) in another medium, or rebroadcast without the express consent of Teletext and of the owners of any rights in the underlying material. Our name "Teletext" is a registered trademark.   You must not use our registered trademark other than as permitted by these terms and conditions and in particular you must not  purchase any domain name or other right or seek to procure that any website appears as a search result when a search is made for any words or phrases which include the word "teletext". Teletext has used reasonable care and skill in compiling the content of this service. However, neither Teletext nor its suppliers make any warranty: that your access to the service will be uninterrupted; or as to the accuracy of any information on the service. Neither Teletext nor any of the suppliers accept liability for any errors or omissions on the service. Teletext reserves the right to amend these terms and conditions at any time without prior notice. Any changes to these terms and conditions will be posted on this website.<br /><br /><br />' + Buttons + '</div></div></div>');
   ModalDialogWindow.document.write('</body>');
   ModalDialogWindow.document.write('</html>'); 
   ModalDialogWindow.document.close(); 
   ModalDialogWindow.focus(); 
   ModalDialogInterval = window.setInterval("ModalDialogMaintainFocus()",5);

}

 function YesNoCancel(BodyText,EventHandler)
 {
     var Buttons=''; 
     Buttons = '<a class="DialogLink" href=javascript:CloseForm("Yes");>I Agree</a>&nbsp;&nbsp;&nbsp;&nbsp;    ';
     Buttons += '<a class="DialogLink" href=javascript:CloseForm("No");>Cancel</a>  ';
     ModalDialogShow("Terms and Conditions",BodyText,Buttons,EventHandler);
 }
 
 function YesNoCancelReturnMethod()
 {
   document.getElementById("scriptowidget").value = ""; //needed with introduction of modal pop up 
   if(ModalDialog.value == 'Yes') {CreateScript(document.forms[0]);}
   ModalDialogRemoveWatch();
 }

function compteur_coches(obj)
{
    max = 5;

    box1 = obj.form.case1.checked;
    box2 = obj.form.case2.checked;
    box3 = obj.form.case3.checked;
    box4 = obj.form.case4.checked;
    box5 = obj.form.case5.checked;
    box6 = obj.form.case6.checked;
    box7 = obj.form.case7.checked;
    box8 = obj.form.case8.checked;
    box9 = obj.form.case9.checked;
    box10 = obj.form.case10.checked;
    box11 = obj.form.case11.checked;
    box12 = obj.form.case12.checked;
    box13 = obj.form.case13.checked;
    box14 = obj.form.case14.checked;
    box15 = obj.form.case15.checked;
    box16 = obj.form.case16.checked;
    nombre = (box1 ? 1 : 0) + (box2 ? 1 : 0) + (box3 ? 1 : 0) + (box4 ? 1 : 0) + (box5 ? 1 : 0) + (box6 ? 1 : 0) + (box7 ? 1 : 0) + (box8 ? 1 : 0) + (box9 ? 1 : 0) + (box10 ? 1 : 0) + (box11 ? 1 : 0) + (box12 ? 1 : 0) + (box13 ? 1 : 0) + (box14? 1 : 0) + (box15 ? 1 : 0) + (box16 ? 1 : 0);

    if (nombre > max)
    {
        alert("You can't check more than " + max + " boxes !");
        obj.checked = false;
    }
}

function IsNumeric(strString)
//  check for valid numeric strings	
{
    var strValidChars = "0123456789";
    var strChar;
    var blnResult = true;

    if (strString.length == 0) return false;

    //  test strString consists of valid characters listed above
    for (i = 0; i < strString.length && blnResult == true; i++)
    {
        strChar = strString.charAt(i);
        if (strValidChars.indexOf(strChar) == -1)
        {
            blnResult = false;
        }
    }
    
    return blnResult;
}

function CreateScript(oForm)
{
    var el, i = 0;
    var widgetString = "<script type='text/javascript' src='http://www.teletext.co.uk/js/FrameManager.js'></" + "script>\n<iframe id='Iframe2' src='http://www.teletext.co.uk/widgets/feedreader/TeletextFeedReader.aspx?";
    var selectedFeeds = "";
     
    while (el = oForm.elements[i++]) if (el.type == "checkbox") if(el.checked) selectedFeeds = selectedFeeds + "feed=" + el.value + "&";
    
    if(selectedFeeds.length < 1)
    {
        alert("You must select at least one feed.");
        return;
    }
    else
        widgetString = widgetString + selectedFeeds;
    
    if(document.getElementById("txtWidth").value.length < 1)
        widgetString = widgetString + "width=178'";
    else
    {
        if(IsNumeric(document.getElementById("txtWidth").value) == true)
            widgetString = widgetString + "width=" + document.getElementById("txtWidth").value + "'";
        else
        {
            alert("Width must be numeric.");
            document.getElementById("txtWidth").value = "";
            document.getElementById("scriptowidget").value = "";
            return;
        }
    }        
    
    widgetString = widgetString + " onload='FrameManager.registerFrame(this)' scrolling='no'	marginwidth='0' marginheight='0' frameborder='0' vspace='0' hspace='0' style='overflow:visible; width:100%; height:100%' name='ttFeedReader'></iframe>";
    document.getElementById("scriptowidget").value = widgetString;
}
// -->