

// 1. Function Find Current Language

function cur_lg()
         {
         curname=this.document.URL;
         position=curname.lastIndexOf("&");
         begin_curname=curname.substring(0,position);
         begin_curnamelength=begin_curname.length;
         position2=begin_curname.lastIndexOf("=");
         middle_curname=curname.substring(0,position2);
         middle_curnamelength=middle_curname.length;
         lang=begin_curname.substring(middle_curnamelength+1,begin_curnamelength);
         return lang;
         }


// 3. Function Make Visible
function make_visible(cur,which)
        {
        cur_browser=navigator.appName.substring(0,3);
        if (cur_browser=="Mic")
         {
         if(which==0)
          {
          cur.filters.alpha.opacity=100
          }
         else
          {
          cur.filters.alpha.opacity=35
          }
         }
        }

// 4. Function site_name
function site_name()
         {
         document.write('Hr 2 Hr');
         }

// 5. Function New Cookie
function newCookie(name,value)
         {
         today=new Date();
         ty=today.getYear();
         if (ty<100)
          {
          ty=ty+1900;
          }
         tm=today.getMonth();
         td=today.getDate();
         // one year value cookie... doesn't really work, hello 2009!
         nextday=new Date(ty+1,tm,td);
         dateExp=nextday.toGMTString();
         document.cookie=name+"="+value+";expires="+dateExp;
         }

// 6. Function Get Cookie
function getCookie(nameCookie)
         {
         var cookieFound=false;
         var begin=0;
         var end=0;
         var ch=document.cookie;
         var i=0;
         while (i<=ch.length)
         {
          begin=i;
          end=begin+nameCookie.length;
          if (ch.substring(begin,end)==nameCookie)
           {
           cookieFound=true;
           break;
           }
          i++;
          }
          if (cookieFound)
           {
           begin=end+1;
           end=document.cookie.indexOf(";",begin);
           if(end<begin)
            {
            end=document.cookie.length;
            }
           return document.cookie.substring(begin,end);
           }
         return "";
         }


/***************************/
// 9.6.
// Function Add Panel
/**************************/
// this is an particular "addFavorite" for NS6. You can load a Panel, a kind of super bookmark online.
// It is in fact a regular HTML page which is loaded.

function add_panel()

{
lang=cur_lg();
//alert(lang);
if (lang=="nl")
 {
 lng=" - Nl";
 }
if (lang=="fr")
 {
 lng=" - Fr";
 }
if (lang=="en")
 {
 lng=" - En";
 }
site_title="Hr 2 Hr"+lng;

oldname=top.content.document.URL;
begin_oldname=oldname.substring(0,16);
if (begin_oldname!='http://127.0.0.1')
 {
 site_url="http://www.hr2hr.com/"+lang+"/panel.php";
 }
else
 {
 site_url="http://127.0.0.1/newhr2hr/"+lang+"/panel.php";
 }
//site_url="../"+lg+"/panel.htm";
if (window.sidebar&&window.sidebar.addPanel)
 {
 window.sidebar.addPanel(site_title, site_url,"");
 }
}


// 11. Function belgrh
function belgrh()
         {
         cur_lang=getCookie("lan");
         cur_length=cur_lang.length;
         if (cur_length!="2")
          {
          popup();
          }
         }

// 12. Function Open Window
function popup()
         {
         var newwindow = window.open("access_home.htm","","Toolbar=no,resizable=no,width=470,height=350,status=yes,scrollbar=no");
         }