function MM_CheckFlashVersion(reqVerStr,msg){
  with(navigator){
    var isIE  = (appVersion.indexOf("MSIE") != -1 && userAgent.indexOf("Opera") == -1);
    var isWin = (appVersion.toLowerCase().indexOf("win") != -1);
    if (!isIE || !isWin){  
      var flashVer = -1;
      if (plugins && plugins.length > 0){
        var desc = plugins["Shockwave Flash"] ? plugins["Shockwave Flash"].description : "";
        desc = plugins["Shockwave Flash 2.0"] ? plugins["Shockwave Flash 2.0"].description : desc;
        if (desc == "") flashVer = -1;
        else{
          var descArr = desc.split(" ");
          var tempArrMajor = descArr[2].split(".");
          var verMajor = tempArrMajor[0];
          var tempArrMinor = (descArr[3] != "") ? descArr[3].split("r") : descArr[4].split("r");
          var verMinor = (tempArrMinor[1] > 0) ? tempArrMinor[1] : 0;
          flashVer =  parseFloat(verMajor + "." + verMinor);
        }
      }
      // WebTV has Flash Player 4 or lower -- too low for video
      else if (userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 4.0;

      var verArr = reqVerStr.split(",");
      var reqVer = parseFloat(verArr[0] + "." + verArr[2]);
  
      if (flashVer < reqVer){
        if (confirm(msg))
          window.location = "http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";
      }
    }
  } 
}

function TextScroll(scrollname, div_name, up_name, down_name)
{
    this.div_name = div_name;
    this.name = scrollname;
    this.scrollCursor = 0;
    this.speed = 5;
    this.timeoutID = 0;
    this.div_obj = null;
    this.up_name = up_name;
    this.dn_name = down_name;

{
        if (document.getElementById) {
            div_obj = document.getElementById(this.div_name);
            if (div_obj) {
                this.div_obj = div_obj;
                this.div_obj.style.overflow = 'hidden';
            }
            div_up_obj = document.getElementById(this.up_name);
            div_dn_obj = document.getElementById(this.dn_name);
            if (div_up_obj && div_dn_obj) {
                div_up_obj.setAttribute("onmouseover", scrollname + ".scrollUp();")
                div_up_obj.setAttribute("onmouseout", scrollname + ".stopScroll();")

div_dn_obj.setAttribute("onmouseover", scrollname + ".scrollDown();")
                div_dn_obj.setAttribute("onmouseout", scrollname + ".stopScroll();")
            }
        }
    }

this.stopScroll = function() {
        clearTimeout(this.timeoutID);
    }

this.scrollUp = function() {
        if (this.div_obj) {
            this.scrollCursor = (this.scrollCursor - this.speed) < 0 ? 0 : this.scrollCursor - this.speed;
            this.div_obj.scrollTop = this.scrollCursor;
            this.timeoutID = setTimeout(this.name + ".scrollUp()", 60);
        }
    }

this.scrollDown = function() {
        if (this.div_obj) {
            this.scrollCursor += this.speed;
            this.div_obj.scrollTop = this.scrollCursor;
            this.timeoutID = setTimeout(this.name + ".scrollDown()", 60);
        }
    }

this.resetScroll = function() {
        if (this.div_obj) {
            this.div_obj.scrollTop = 0;
            this.scrollCursor = 0;
        }
    }
}

function open_gallery( gallery_name, id )
{
milkbox.changeOptions( { resizeTransition:'bounce:out', resizeDuration:1000, canvasBorderWidth:'0px', canvasPadding:'2px' } ) ;
milkbox.showGallery( { gallery:gallery_name, index:id } ) ;
}

function open_gallery_shadow( content, player, txt_title )
{
//alert( 'content:' + content + '\n player:' + player + '\ntxt_title:' + txt_title ) ;
//Shadowbox.open( { content: content, player: player, title: title } ) ;
}

function aa( content )
{
alert( 'content:' + content + '' ) ;
//Shadowbox.open( { content: content, player: player, title: title } ) ;
}

function news_writter( AJ_url, AJ_response_div_name, AJ_news_name )
{

AJ_url = AJ_url + '&news_id=' + AJ_news_name  ;

//alert( 'Calling url :  ' + AJ_url ) ;
//alert( 'Writting response in :  AJ_response_div_name :  ' + AJ_response_div_name ) ;

var AJ_response = '' ;
var AJ_status   = '' ;

new Ajax.Request( AJ_url,
                  {
                   method: 'get',
                   asynchronous: false,
                   onSuccess: function( transport )
                      {
                       AJ_response = transport.responseText ;
						$( AJ_response_div_name ).scrollTop = 0;
            			$( AJ_response_div_name ).scrollCursor = 0;
						clearTimeout(AJ_response_div_name.timeoutID);
						setTimeout(AJ_response_div_name, 0)
                       $( AJ_response_div_name ).innerHTML = AJ_response ;
                      }
                  } );
                 
}
