
<!--   

 function CanHandleImage () 
 {  
  return ((IsNetscape() && (GetVersion() >= 3)) ||         
          (IsIE() && (GetVersion() >= 4))) 
 }

////////////////////////////////////////////////////////////////////////// 

 function LoadImage (img) 
 {  
  if (CanHandleImage())  
   {
    var a=new Image();    
    a.src=img;    
    return a;  
   }  
  else   
   return (null); 
 }

////////////////////////////////////////////////////////////////////////// 

 function ChangeImage (img1name, img2) 
 { if (CanHandleImage() && (img2 != null))  
   {   
    document[img1name].src=img2.src;  
   }
 }

////////////////////////////////////////////////////////////////////////// 

 function IsNetscape() 
 {  
  var bName = navigator.appName;  
  return (bName == "Netscape") 
 }

////////////////////////////////////////////////////////////////////////// 

 function IsIE() 
 {  
  var bName = navigator.appName;  
  return (bName == "Microsoft Internet Explorer") 
 }

////////////////////////////////////////////////////////////////////////// 

 function GetVersion() 
 {  
  return (parseInt(navigator.appVersion)); 
 }

//////////////////////////////////////////////////////////////////////////  
//////////////////////////////////////////////////////////////////////////

 function FocusAndSelect(aObject, SelectOn)
 {
  var s = new String(aObject.type);
  s = s.toUpperCase();
 
  if (s == "PASSWORD" || s == "TEXT" || s == "TEXTAREA")
  {
   if (IsNetscape || (IsIE && GetVersion >= 4.0))
    aObject.focus();
   if (SelectOn) aObject.select();
  }
 }

/////////////////////////////////////////////////////////////////////////////

function Trim (s)
 {
  if (s == null || s == "") return s;
 
  var von = 0;
  var bis = s.length;
 
  for (var i = 0; i < s.length; i++)
   if ( s.charAt(i) == " ")
    von++
   else
    break;
  
  if (von == s.length) return ""  

  for (var i = s.length-1; i >= 0 ; i--)
   if ( s.charAt(i) == " ")
    bis--
   else
    break;
  
  return s.substring(von, bis);
 }

/////////////////////////////////////////////////////////////////////////////

 function checkInput(aInput, msg)
 {
  if (Trim(aInput.value) == "") 
   {
    if (Trim(msg) != "") alert (msg);
    FocusAndSelect(aInput, true);
    return false;
   }
  else return true;
 } 

/////////////////////////////////////////////////////////////////////////////

function checkSelect(aSelect, msg)
 {
  if (aSelect.selectedIndex == 0 || aSelect.options[aSelect.selectedIndex].value == "0")
   {
    if (Trim(msg) != "") alert (msg);
    return (false);
   }
  else
   return (true);
 }
 
/////////////////////////////////////////////////////////////////////////////

 function FocusForm(aDocument)
 {
  if (aDocument.forms.length > 0 && aDocument.forms[0].elements.length > 0)
   FocusAndSelect(aDocument.forms[0].elements[0], true)
 }

 
/////////////////////////////////////////////////////////////////////////////
  

 function openWindowEx (url)
 {
  x = top.open(url, "info_window", "left=100,top=140,width=600,height=500,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes")
  if (x.focus != null)
  x.focus();
 }


/////////////////////////////////////////////////////////////////////////////
  

 function pfiche (ref, language)
 {
  window.location = "fiche.asp?ref=" + ref + "&language=" + language + "&p=1&c=0"
 }

/////////////////////////////////////////////////////////////////////////////
  

 function cfiche (ref, language)
 {
  window.location = "fiche.asp?ref=" + ref + "&language=" + language + "&p=1&c=1"
 }

/////////////////////////////////////////////////////////////////////////////

 function openInfo (url)
       {
        x = top.open(url, "input_window", "left=140,top=130,width=520,height=350,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes")
        if (x.focus != null)
         x.focus();
       }

/////////////////////////////////////////////////////////////////////////////

 function openAward ()
       {
        x = top.open("award.htm", "award", "left=140,top=130,width=162,height=227,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,maximize=no,minimize=no")
        if (x.focus != null)
          x.focus();
       }

/////////////////////////////////////////////////////////////////////////////

 function openNews1 ()
       {
        x = top.open("news1.htm", "news1", "left=140,top=130,width=398,height=310,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,maximize=no,minimize=no")
        if (x.focus != null)
          x.focus();
       }

/////////////////////////////////////////////////////////////////////////////

 function openNews2 ()
       {
        x = top.open("news2.htm", "news2", "left=140,top=130,width=398,height=310,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,maximize=no,minimize=no")
        if (x.focus != null)
          x.focus();
       }

/////////////////////////////////////////////////////////////////////////////

 function openNews3 ()
       {
        x = top.open("news3.htm", "news3", "left=140,top=130,width=398,height=310,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,maximize=no,minimize=no")
        if (x.focus != null)
          x.focus();
       }

/////////////////////////////////////////////////////////////////////////////

function openNews (url, aleft, atop, awidth, aheight)
       {
        openNewsPrim(url, "news", aleft, atop, awidth, aheight)
       }

/////////////////////////////////////////////////////////////////////////////

function openNewsPrim (url, wname, aleft, atop, awidth, aheight)
       {
        x = top.open(url, wname, "left=" + aleft + ",top=" + atop + ",width=" + awidth + ",height=" + aheight + ",toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,maximize=no,minimize=no")
        if (x.focus != null)
          x.focus();
       }

/////////////////////////////////////////////////////////////////////////////


 function checkDate(form, msg)
 {
  var tag = parseInt(form.dd.value, 10)
  var monat = parseInt(form.mm.value, 10)
  var jahr = parseInt(form.yy.value, 10)

  if (!checkInt(form.dd, tag, 1, msg) ||
      !checkInt(form.mm, monat, 1, msg) ||
      !checkInt(form.yy, jahr, 0, msg))
     return false;

  if (jahr < 100)
  {
   jahr += 2000
  }
  
  var D = new Date(jahr-2000, monat-1, tag)
         

  form.dd.value = D.getDate()
  form.mm.value = D.getMonth()+1
  form.yy.value = D.getYear()+2000
  return(true)
 }

/////////////////////////////////////////////////////////////////////////////

 function checkDateLivraison(form, fld, msg, minHoursOn, minHours, msg2)
 {

  var dd = eval("form." + fld + "_dd")
  var mm = eval("form." + fld + "_mm")
  var yy = eval("form." + fld + "_yy")

  var tag = parseInt(dd.value, 10)
  var monat = parseInt(mm.value, 10)
  var jahr = parseInt(yy.value, 10)

  if (!checkInt(dd, tag, 1, msg) ||
      !checkInt(mm, monat, 1, msg) ||
      !checkInt(yy, jahr, 0, msg))
     return false;

  if (jahr < 10)
  {
   jahr += 2000
  }
  else
  if (jahr < 100)
  {
   jahr += 1900
  }
  
  yy.value = jahr

  if (!checkInt(yy, jahr, 1900, msg))
    return false;
 
  if (jahr < 2000 )
  {
   jahr -= 1900
  }

  var D = new Date(jahr, monat-1, tag)
  dd.value = D.getDate()
  mm.value = D.getMonth()+1
  jahr = D.getYear() 
  if (jahr < 1900)
   jahr += 1900
  yy.value = jahr

  var today= new Date()

  D2 = today
  D2.setHours(D2.getHours()+ minHours)

  if (D2.getHours() >= 20)  //  apres 20 H
   D2.setDate(D2.getDate()+1)

  if (D2.getDay() == 0 )  // Sonntag 
   D2.setDate(D2.getDate()+1)

  var D3 = D2
  D3.setHours(0)
  D3.setMinutes(0)
  D3.setSeconds(0)

  if (!minHoursOn || D > D2 || Math.abs(D - D3) < 3600 * 1000 )
  {
   return(true)
  }
  else
  {
   jahr = D2.getYear() 
   if (jahr < 1900)
    jahr += 1900
   if (Trim(msg2) != "") alert (msg2 + " " + D2.getDate() + "/" + (D2.getMonth()+1) + "/" + jahr );
   FocusAndSelect(dd, true);
   return (false);
  }
 }

/////////////////////////////////////////////////////////////////////////////

function setCookie(name, value) 
{
 var argv = setCookie.arguments;
 var argc = setCookie.arguments.length;
 var expires = (argc > 2) ? argv[2] : null;
 var path = (argc > 3) ? argv[3] : null;
 var domain = (argc > 4) ? argv[4] : null;
 var secure = (argc > 5) ? argv[5] : false;
 document.cookie = name + "=" + escape (value) +
 ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
 ((path == null) ? "" : ("; path=" + path)) +
 ((domain == null) ? "" : ("; domain=" + domain)) +
 ((secure == true) ? "; secure" : "");
}
