// Парадный выезд картинки
// time to start
var TimeWaitStart = 1000

// The width of your images (pixels). All pictures should have the same width.
var imgheight=206
var imgwidth=168
// The horizontal and vertical position of the images (pixels). 
var pos_to_left=84
var pos_to_top=278	

// The name of your images. You may add as many images as you like.
var imgname="/pics/banner_bg.gif"

// Where should those images be linked to? 
// Add an URL for each image.
// If you don't want to add an URL just write '#' instead of the URL.
var imgurl="http://www.jingle.ru"

// Ротация текста
var message_r = new Array()
var message_e = new Array()
var message   = new Array()

// Please read section 2 above on how the messages have to be configured.
// You may add as many messages as you like!
message_r[0]="Радиостанции и телеканалы<br><br>Джингловые пакеты<br><br>Реклама и анонсы"
message_e[0]="Production & syndication<br><br>Commercial & promos<br><br>Radio stations & TV channels"


// The height of the scrollerbox (pixels)
var scrollerheight=125

// The width of the scrollerbox (pixels)
var scrollerwidth=130

// The distance to the left border of the window (pixels)
var scrollertop=310

// The distance to the top border of the window (pixels)
var scrollerleft=101

// The padding between the scrollerbox and the text (pixels)
var scrollerpadding=0

// standstill between the messages (milliseconds)
var standstillfix=1000


// This block will preload your images. Do not edit this block.
var imgpreload=new Image()
imgpreload.src=imgname

// This variable also affects the speed (the length of the step between each inmage-frame measured in pixels). More means faster.
var imgstep=1

// Do not edit the variables below
var i_loop=0

// Do not edit below this line
var cliptop
var clipbottom
var clipleft
var clipright

var i_message=0
var contenttext

var totalheight
var i_height
var textstep=1
var pause=20

var standstillflex
var timer
var v_lang
function stretchimage() {
	 if (document.all){
		document.all.imgcontainer.style.posTop+=imgstep
	 } else if (document.layers) {
		document.imgcontainer.top+=imgstep
     }
	if (i_height<imgheight) {
	   timer=setTimeout("stretchimage()",pause)
	   i_height+=imgstep
	   cliptop-=imgstep
	 	if (document.all){
	   		document.all.imgcontainer.style.clip="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
	    } else if (document.layers) {
		    document.imgcontainer.clip.left=clipleft
	    	  document.imgcontainer.clip.right=clipright
	          document.imgcontainer.clip.top=cliptop
	          document.imgcontainer.clip.bottom=clipbottom
	 	}
	} else {
	  clearTimeout(timer)
	  initiate_text()
	  return
  	}
}

function initiate(lang) {
	
 v_lang=lang	
 i_height=0
 cliptop=imgheight
 clipbottom=imgheight
 clipleft=0
 clipright=imgwidth

 contenttext = "<a href='"+imgurl+"' target='_blank'><img src='"+imgname+"' border='0'></a>"
 if (document.all) {
	document.all.imgcontainer.innerHTML=contenttext
	document.all.imgcontainer.style.posTop=pos_to_top-imgheight
	document.all.imgcontainer.style.posLeft=pos_to_left
	document.all.imgcontainer.style.clip="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
    document.all.imgcontainer.style.filter="alpha(opacity=65) blur(strength=80 add=1)"
} else if (document.layers) {
  	document.imgcontainer.document.write(contenttext)
  	document.imgcontainer.document.close()
  	document.imgcontainer.top=pos_to_top-imgheight
  	document.imgcontainer.left=pos_to_left
  	document.imgcontainer.clip.left=clipleft
    document.imgcontainer.clip.right=clipright
    document.imgcontainer.clip.top=cliptop
    document.imgcontainer.clip.bottom=clipbottom
 }
 stretchimage()
}


function initiate_text(){
	cliptop=(scrollerheight-2*scrollerpadding)
	clipbottom=scrollerheight-2*scrollerpadding
	clipleft=0
	clipright=scrollerwidth
	i_height = 0

 if ("e"==v_lang) 
 	message = message_e;
 else
 	message = message_r;
 
 totalheight=scrollerheight*(message.length)
 
 contenttext="<table cellpadding=0 cellspacing=0 border=0 width="+(scrollerwidth-2*scrollerpadding)+">"
 
 for (i=0;i<=message.length-1;i++) 
  contenttext+="<tr valign='top'><td height='"+scrollerheight+"'><a href='"+imgurl+"' target='_blank' class='textl'><span class=\"title2\">"+message[i]+"</span></a></td></tr>"
  
 contenttext+="</table>"
 
 if (document.all) {
  scrollertext.innerHTML=contenttext
  document.all.scrollertext.style.posTop=scrollertop-totalheight
  document.all.scrollertext.style.posLeft=scrollerleft
  document.all.scrollertext.style.clip="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
 } else if (document.layers) {
  document.scrollertext.document.write(contenttext)
  document.scrollertext.document.close()
  document.scrollertext.top=scrollertop-totalheight
  document.scrollertext.left=scrollerleft
  document.scrollertext.clip.left=clipleft
        document.scrollertext.clip.right=clipright
        document.scrollertext.clip.top=cliptop
        document.scrollertext.clip.bottom=clipbottom
 }
 scroll()
}

function scroll(){
 	 standstillflex=standstillfix
	 if (document.all){
		document.all.scrollertext.style.posTop+=textstep
	 } else if (document.layers) {
		document.scrollertext.top+=textstep
     }
	if (i_height<scrollerheight) {
	   timer=setTimeout("scroll()",pause)
	   i_height+=textstep
	   cliptop-=textstep
	} else 
	if (i_height==scrollerheight) {
		i_height++;
	  	timer=setTimeout("scroll()",standstillflex)
	} else 	{
	  	if (clipbottom > 0) {
		    var timer=setTimeout("scroll()",pause)
		    clipbottom-=textstep
 	    } else {
	  	    i_height =0
	    	cliptop=scrollerheight-2*scrollerpadding
	    	clipbottom=scrollerheight-2*scrollerpadding
			if (document.all){
				document.all.scrollertext.style.posTop=scrollertop-totalheight
			} else if (document.layers) {
				document.scrollertext.top=scrollertop-totalheight
			}
	   		timer=setTimeout("scroll()",standstillflex)
	   	}
  	}
 	if (document.all){
   		document.all.scrollertext.style.clip="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
    } else if (document.layers) {
	    document.scrollertext.clip.left=clipleft
    	  document.scrollertext.clip.right=clipright
          document.scrollertext.clip.top=cliptop
          document.scrollertext.clip.bottom=clipbottom
 	}
}


function WriteCode(str){var temp="",i,c=0,out="";l=str.length;while(c<=str.length-1){while(str.charAt(c)!='!')temp=temp+str.charAt(c++);c++;out=out+String.fromCharCode(temp);temp="";}document.write(out);}