function tiker(objName)
{

	var m_objName = objName;
	var m_ClientID=objName.substring(6)
    var m_isFirstTime =true;
    var m_DoRoll = null;
    this.Init = Tck_Init;
    this.Tck_Roll = Tck_Roll;
    this.Start = Tck_startRoll;
    this.Stop = Tck_stopRoll;
   
    function Tck_Roll() {

            if (window.document.readyState != 'undefined' && 
                window.document.readyState == 'complete' &&
               m_isFirstTime)
            {
                m_isFirstTime = false;
                Tck_Init();
            }

            var a = document.getElementById(m_ClientID + '_aTicker');
            if(a==null) a=document.getElementById('aTicker'); //irit
            var b=document.getElementById(m_ClientID + '_bTicker');
            if(b==null) b=document.getElementById('bTicker'); //irit

//            a.style.top = parseInt(a.style.top) - 1 + "px";

//            b.style.top = parseInt(b.style.top) - 1 + "px";

//            if (parseInt(a.style.top) < -a.offsetHeight) a.style.top = a.offsetHeight + "px";

//            if (parseInt(b.style.top) < -b.offsetHeight) b.style.top = b.offsetHeight + "px";

//            setTimeout("Tck_Roll()", 40); 
//		    var elaps = 40;
//		  
//    		
//		    //window.status = (a.style.top + " " + b.style.top)
		    a.style.top = parseInt(a.style.top)-1 + "px";
		    b.style.top = parseInt(b.style.top)-1 + "px";

//            var divRoll=document.getElementById('divRoll');

//            //dvori 29/12/2008 for barilan
////		    if(parseInt(a.style.top) < -a.offsetHeight)
////		    {
////    		     a.style.top = a.offsetHeight+parseInt(b.style.top) + "px";//+ (parseInt(divRoll.currentStyle.height)/10);
////    		}
////		    if(parseInt(b.style.top) < -b.offsetHeight)
////		    {
////		        b.style.top = b.offsetHeight+parseInt(a.style.top) + "px";//+ (parseInt(divRoll.currentStyle.height)/10);
////////////		    }

   if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)) 
		    {
		        if (parseInt(a.style.top) < ((-a.offsetHeight)*2))// && parseInt(b.style.top) < -b.offsetHeight) {
		        {
		          //     Tck_Init();
		            a.style.top = 0 + "px";
		            b.style.top = 0 + "px";
		        }
		    }
		    else
		    {
		    if (parseInt(a.style.top) < -a.offsetHeight) {
		        //alert("b top:" + b.style.top);
//                alert("b top:" + b.style.top);
                a.style.top = b.offsetHeight + parseInt(b.style.top) + "px"; //+ (parseInt(divRoll.currentStyle.height)/10);
//                alert("a top:"+ a.style.top);
                //                alert(a.style.top);
                //if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)) {
                  //  a.style.top = parseInt(b.style.top) + "px";
               }
    		
    		if (parseInt(b.style.top) < -b.offsetHeight)
		    {
		        b.style.top = a.offsetHeight + parseInt(a.style.top) + "px"; //+ (parseInt(divRoll.currentStyle.height)/10);
		      //  if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)) {
		     //       b.style.top = parseInt(a.style.top) + "px";
		     //   }
		    }
		 }
//		    
////		    if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)) {
////		        a.style.position = "relative";
////		        b.style.position = "relative";
////		        b.style.top = parseInt(a.style.top) + "px";
////		       // alert(a.style.top);
////		      //  alert(b.style.top);
////		    }

    }
    function Tck_startRoll() 
    {
        if (m_DoRoll)
            return;

	    m_DoRoll = setInterval(m_objName + ".Tck_Roll()", 40);
    }
    function Tck_stopRoll() 
    {
	    clearInterval(m_DoRoll);
	    m_DoRoll = null;
    }

    function Tck_Init()	{

	    a=document.getElementById(m_ClientID+  '_aTicker');
	    b=document.getElementById(m_ClientID+  '_bTicker');
   	
	    b.innerHTML = a.innerHTML;
    
	    a.style.top = 130 + "px";
	    b.style.top = a.offsetHeight + parseInt(a.style.top) + "px";// + (parseInt(divRoll.currentStyle.height)/10);

	if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent))
	{
	    a.style.position = "relative";
	    b.style.position = "relative";
	    b.style.top = parseInt(a.style.top) + "px";
	  //  b.style.display = 'none';
	  //  alert(a.style.top);
	  //  alert(b.style.top);
	}
	
	    Tck_startRoll();
    }
}


function roller(objName)
{
		var m_variableName = objName + "_jsObject";
		var m_objName = objName;
		
		var ie=document.all;
        var dom=document.getElementById;
		var scrollerdelay='6000' //delay between msg scrolls. 1000=1 second.
		var scrollerwidth='170px'
		var scrollerheight='90px'
		var scrollerbgcolor='white'
		var i=0;
       
        var stringtest = document.getElementById(objName + "_span").innerHTML;
        var messages=stringtest.split("*");
		this.doScroll = scroll;
		this.doMove = move;
		this.doMove2 = move2;
		
		function scroll()
		{
		
            if (messages.length>2)
            	i=2
            else
            	i=0
			
			
            if (ie||dom)
            {
            	
            	document.writeln('<div id="' + m_objName + 'main2" style="position:relative;width:'+scrollerwidth+';height:'+scrollerheight+';overflow:hidden;">')
            	document.writeln('<div style="position:absolute;width:'+scrollerwidth+';height:'+scrollerheight+';clip:rect(0 '+scrollerwidth+' '+scrollerheight+' 0);left:0px;top:0px">')
            	document.writeln('<div id="' + m_objName + '_first2" style="position:absolute;width:'+scrollerwidth+';left:0px;top:1px;">')
            	document.write(messages[0])
            	document.writeln('</div>')
            	document.writeln('<div id="' + m_objName + '_second2" style="position:absolute;width:'+scrollerwidth+';left:0px;top:0px;visibility:hidden">')
            	document.write(messages[dyndetermine=(messages.length==1)? 0 : 1])
            
            	document.writeln('</div>')
            	document.writeln('</div>')
            	document.writeln('</div>')
            }
			
            if (window.addEventListener)
                window.addEventListener("load", startscroll, false)
            else if (window.attachEvent)
                window.attachEvent("onload", startscroll)
            else if (ie||dom)
                window.onload += startscroll
            
            
            
        }
        
        
                                      
        function move(whichdiv)
        {
					
        	  tdiv=eval(whichdiv)
            	
           	 if (parseInt(tdiv.style.top)>0&&parseInt(tdiv.style.top)<=5)
           	 {
           	 	
            	tdiv.style.top=0+"px"
            	
            	setTimeout(m_variableName + ".doMove(tdiv)",scrollerdelay)
            	setTimeout(m_variableName + ".doMove2(second2_obj)",scrollerdelay)
            	return
             }
             
            
             if (parseInt(tdiv.style.top)>=tdiv.offsetHeight*-1)
             {
             	
            	tdiv.style.top=parseInt(tdiv.style.top)-5+"px"
            	setTimeout(m_variableName + ".doMove(tdiv)",50)
             }
             else
             {
             	 
            	tdiv.style.top=parseInt(scrollerheight)+"px"
            	tdiv.innerHTML=messages[i]
            	if (i==messages.length-1)
            		i=0
            	else
            		i++
              }
        }

        function move2(whichdiv)
        {
         
        	tdiv2=eval(whichdiv)
        	if (parseInt(tdiv2.style.top)>0&&parseInt(tdiv2.style.top)<=5)
        	{
        	
        		tdiv2.style.top=0+"px"
        		setTimeout(m_variableName + ".doMove2(tdiv2)",scrollerdelay)
        		setTimeout(m_variableName + ".doMove(first2_obj)",scrollerdelay)
        		return
        	}
        
        	if (parseInt(tdiv2.style.top)>=tdiv2.offsetHeight*-1)
        	{
        	
        		tdiv2.style.top=parseInt(tdiv2.style.top)-5+"px"
        		setTimeout(m_variableName + ".doMove2(second2_obj)",50)
        	}
        	else
        	{
        	
        		tdiv2.style.top=parseInt(scrollerheight)+"px"
        		tdiv2.innerHTML=messages[i]
        		if (i==messages.length-1)
        			i=0
        		else
        			i++
        	}
        }

        function startscroll()
        {
        
        	first2_obj=  document.getElementById(m_objName + '_first2')
        	
        	second2_obj= document.getElementById(m_objName + '_second2')
        	
        	
        	
        	move(first2_obj)
        	
        	
        	second2_obj.style.top=scrollerheight
        	second2_obj.style.visibility='visible'
        }
}
