function browserCheck()

{

    var b = navigator.appName;

    if (b == "Netscape") 

        this.b = "ns";

    else if (b == "Microsoft Internet Explorer") 

        this.b = "ie";

    else 

        this.b = b

    this.us = navigator.userAgent;

    

    //Opera check

    

    this.opera = this.us.indexOf("Opera");

    if(this.opera != -1){

        this.opera = true;

        this.b = "";

    }

    else {

        this.opera = false;

    }

    

    //Firefox Check

    

    this.firefox = this.us.indexOf("Firefox");

    if(this.us.indexOf("Firefox")!=-1){

        this.firefox = true;    

    }else{

        this.firefox = false;   

    }

    

    //DOM Check

    

    this.DOM = (document.createElement && document.getElementsByTagName);

    

    this.version = navigator.appVersion;

    if (this.b == 'ie')

    { 

        var ve = this.version.indexOf("MSIE")

        this.v = parseInt(this.version.substr(ve+4))

    }

    else 

    this.v = parseInt(this.version)

    this.ns = (this.b=="ns" && this.v>=4)

    this.ns4 = (this.b=="ns" && this.v<5)

    this.ns5 = (this.b=="ns" && this.v==5)

    this.ie = (this.b=="ie" && this.v>=4)

    this.ie4 = (this.version.indexOf('MSIE 4')>0)

    this.ie5 = (this.version.indexOf('MSIE 5')>0)

    this.ie55 = (this.version.indexOf('MSIE 5.5')>0)

    this.ie6 = (this.version.indexOf('MSIE 6')>0) 

    this.min = (this.ns||this.ie)

}//end BrowserCheck() 



is = new browserCheck();



function Submenu(h){

    

    /*ImgObj = document.getElementById(h);

    X = ImgObj.offsetLeft;

    X = ImgObj.offsetParent.offsetLeft + X;

    X = ImgObj.offsetParent.offsetParent.offsetLeft + X;

    X = ImgObj.offsetParent.offsetParent.offsetParent.offsetLeft + X;

    X = X+20;

    Y= 73;*/

    

    ImgObj = document.getElementById(h);

    X = ImgObj.offsetLeft;

    X = ImgObj.offsetParent.offsetLeft + X;

    //alert(ImgObj.offsetParent.tagName);

    X = ImgObj.offsetParent.offsetParent.offsetLeft + X;

    X = ImgObj.offsetParent.offsetParent.offsetParent.offsetLeft + X;

    X = X+20;

    Y= 73;

    

    if(is.ns5){

        X = X - 2;

    }

    

    if(is.opera){

        X = ImgObj.offsetParent.offsetParent.offsetParent.offsetParent.offsetLeft + X - 20;

        Y = Y;

    }

    

    menu = h+"menu";

    showFloatMenuAt(menu,X,Y);

    

}



function SwitchImage(imgName, imgSrc) 

{

  if (document.images)

  {

    if (imgSrc != "none")

    {

      document.images[imgName].src = imgSrc;

    }

  }

}



var showedElement = "undefined";



function ViewElement(elname){

    Obj = document.getElementById(elname);

    Obj.style.display = "block";

    if(showedElement!="undefined"){

        Obj = document.getElementById(showedElement);

        Obj.style.display = "none";

        showedElement = "undefined";

    }

    showedElement = elname;

}



// Example:

// writeCookie("myCookie", "my name", 24);

// Stores the string "my name" in the cookie "myCookie" which expires after 24 hours.



function writeCookie(name, value, hours)

{

  var expire = "";

  if(hours != null)

  {

    expire = new Date((new Date()).getTime() + hours * 3600000);

    expire = "; expires=" + expire.toGMTString();

  }

  document.cookie = name + "=" + escape(value) + expire;

 }

 

 // Example:

 // alert( readCookie("myCookie") );

 function readCookie(name)

 {

   var cookieValue = "";

   var search = name + "=";

   if(document.cookie.length > 0)

   { 

     offset = document.cookie.indexOf(search);

     if (offset != -1)

     { 

       offset += search.length;

       end = document.cookie.indexOf(";", offset);

       if (end == -1) end = document.cookie.length;

       cookieValue = unescape(document.cookie.substring(offset, end))

     }

   }

   return cookieValue;

 }

 

 function WriteAction(){



            n = readCookie("ActionNumber");

            n = parseInt(n);

            

            if(!n){n=1;}

            if(n>2){n=1;}

            



            document.write(ActionArray[n]);

            document.write('<br>');

            document.write('<img src="/img/action' + n + '.png" alt="">');

            

            nc = n + 1;

            writeCookie("ActionNumber", nc, 1);

   }

 function WriteBanner(){

            document.write('<CENTER><a href="http://agrotrade.ua/ru/activity/seed_production" target="blank">Гибриды кукурузы и подсолнуха</a> от производителя</CENTER>');

            document.write('<br>');

            document.write('<CENTER><a href=http://drillex.com.ua target=_blank><EMBED SRC="/flash/drillex.swf" width="150" height="150"></EMBED></a></CENTER>');

            document.write('<br>');

            document.write('<CENTER><a href=http://navsys.com.ua target=_blank><EMBED height="273" width="150" SRC="/flash/navsys.swf"></a></CENTER>');

            document.write('<br>');

            document.write('<CENTER><a href=http://www.optima-pr.com.ua target=_blank><EMBED SRC="/flash/optima.swf" width="229"></EMBED></a></CENTER>');

            document.write('<br>');

            document.write('<CENTER>НПЭСТ ООО «Агрофирма «Семена» продает<a href="http://semenalidery.com" target="_blank"> семена подсолнуха, посевной материал</a>, гибриды подсолнуха в Украине ТМ «Семена лидеры»</CENTER>');

            document.write('<br>');

            document.write('<CENTER><a href="http://www.optima-pr.com.ua" target=_blank><B><FONT COLOR="#F33096">Наружная реклама в Харькове, реклама на транспорте</FONT><B></a></CENTER></br>');

            document.write('<br>');

            document.write('<CENTER><a href="http://www.perevodim.com.ua" target=_blank><img height="100" width="100" SRC="/img/gulfstream.gif" alt="perevodim.com.ua"></a></CENTER>');


   }
  

ActionArray = new Array(

    '',
    '<CENTER><a href=/news/action.shtml#friends2><img src=/img/friend.jpg></a></CENTER>',
    '<CENTER><a href=/news/action.shtml#action3><img src=/img/action3.jpg></a></CENTER>'


  );

 /* <img src=/img/li2.gif>&nbsp;&nbsp;Приведи друга и получи 2 юнита на свой счет! <br><br>-  Ваш друг оставляет заявку на подключение.<br />- Называет Ваш логин, как порекомендовавшего наши услуги.<br /> - В течение дня на Ваш счет будет добавлено 2 юнита (11 грн)! <br><a href="/news/action.shtml#friends">Подробней ...</a><br> */

