/* USE WORDWRAP AND MAXIMIZE THE WINDOW TO SEE THIS FILE
========================================
 V-NewsTicker v2.2
 License : Freeware (Enjoy it!)
 (c)2003 VASIL DINKOV- PLOVDIV, BULGARIA
========================================
 For IE4+, NS4+, Opera5+, Konqueror3.1+
========================================
 Get the NewsTicker script at:
 http://www.smartmenus.org/other.php
 and don't wait to get the Great SmartMenus script at:
 http://www.smartmenus.org
 LEAVE THESE NOTES PLEASE - delete the comments if you want */

// BUG in Opera:
// If you want to be able to control the body margins
// put the script right after the BODY tag, not in the HEAD!!!

// === 1 === FONT, COLORS, EXTRAS...
x_font='verdana,arial,sans-serif';
x_fontSize='10px';
x_fontSizeNS4='11px';
x_fontWeight='bold';
x_fontColor='#eda000';
x_textDecoration='none';
x_fontColorHover='#eda000';//		| won't work
x_textDecorationHover='underline';//	| in Netscape4
x_bgColor='transparent';
//set [='transparent'] for transparent
// set [='url(image_source)'] for image
x_top=0;//	|
x_left=0;//	| defining
x_width=150;//	| the box
x_height=120;//	|
x_paddingTop=2;
x_paddingLeft=2;
x_position='relative';// absolute/relative
x_timeout=1300;//1000 = 1 second
x_slideSpeed=40;
x_slideDirection=0;//0=down-up;1=up-down
x_pauseOnMouseOver=true;
// v2.2+ new below
x_slideStep=1;//pixels
x_textAlign='left';// left/center/right
x_textVAlign='middle';// top/middle/bottom - won't work in Netscape4

// === 2 === THE CONTENT - ['href','text','target']
// Use '' for href to have no link item


function x_fisherYates ( myArray ) {
  var i = myArray.length;
  if ( i == 0 ) return false;
  while ( --i ) {
     var j = Math.floor( Math.random() * ( i + 1 ) );
     var tempi = myArray[i];
     var tempj = myArray[j];
     myArray[i] = tempj;
     myArray[j] = tempi;
   }
}

x_fisherYates(x_content);
// ===

x_ua=navigator.userAgent;

x_nS4=document.layers?1:0;

x_iE=document.all&&!window.innerWidth&&x_ua.indexOf("MSIE")!=-1?1:0;

x_oP=x_ua.indexOf("Opera")!=-1&&document.clear?1:0;

x_oP7=x_oP&&document.appendChild?1:0;

x_oP4=x_ua.indexOf("Opera")!=-1&&!document.clear;

x_kN=x_ua.indexOf("Konqueror")!=-1&&parseFloat(x_ua.substring(x_ua.indexOf("Konqueror/")+10))<3.1?1:0;

x_count=x_content.length;x_cur=1;

x_cl=0;x_d=x_slideDirection?-1:1;

x_TIM=0;

x_fontSize2=x_nS4&&navigator.platform.toLowerCase().indexOf("win")!=-1?x_fontSizeNS4:x_fontSize;

x_canPause=0;

function x_getOS(a){
         return x_iE?document.all[a].style:x_nS4?document.layers["x_container"].document.layers[a]:document.getElementById(a).style
};

function x_start(){
         var o,px;
         o=x_getOS("x_1");
         px=x_oP&&!x_oP7||x_nS4?0:"px";
         if(parseInt(o.top)==x_paddingTop){
                x_canPause=1;
                if(x_count>1)x_TIM=setTimeout("x_canPause=0;x_slide()",x_timeout);
                        return
        }
        o.top=(parseInt(o.top)-x_slideStep*x_d)*x_d>x_paddingTop*x_d?parseInt(o.top)-x_slideStep*x_d+px:x_paddingTop+px;
                
        if(x_oP&&o.visibility.toLowerCase()!="visible")
                o.visibility="visible";
        setTimeout("x_start()",x_slideSpeed)
};

function x_slide()
{
 var o,o2,px;
 o=x_getOS("x_"+x_cur);
 o2=x_getOS("x_"+(x_cur<x_count?x_cur+1:1));
 px=x_oP&&!x_oP7||x_nS4?0:"px";
 
 if(parseInt(o2.top)==x_paddingTop){
        if(x_oP)
                o.visibility="hidden";
        o.top=x_height*x_d+px;
        x_cur=x_cur<x_count?x_cur+1:1;
        x_canPause=1;x_TIM=setTimeout("x_canPause=0;x_slide()",x_timeout);
        return
  }

  if(x_oP&&o2.visibility.toLowerCase()!="visible")
        o2.visibility="visible";

  if((parseInt(o2.top)-x_slideStep*x_d)*x_d>x_paddingTop*x_d){
        o.top=parseInt(o.top)-x_slideStep*x_d+px;o2.top=parseInt(o2.top)-x_slideStep*x_d+px
  }else{
       	o.top=-x_height*x_d+px;
        o2.top=x_paddingTop+px
  }
  setTimeout("x_slide()",x_slideSpeed)
};

if(x_nS4||x_iE||x_oP||document.getElementById&&!x_kN&&!x_oP4){
        document.write("<style>.vnewsticker11,a.vnewsticker11{font-family:"+x_font+";font-size:"+x_fontSize2+";color:"+x_fontColor+";text-decoration:"+x_textDecoration+";font-weight:"+x_fontWeight+"}a.vnewsticker11:hover{font-family:"+x_font+";font-size:"+x_fontSize2+";color:"+x_fontColorHover+";text-decoration:"+x_textDecorationHover+"}</style>");

        x_temp="<div "+(x_nS4?"name":"id")+"=x_container style='position:"+x_position+";top:"+x_top+"px;left:"+x_left+"px;width:"+x_width+"px;height:"+x_height+"px;background:"+x_bgColor+";layer-background"+(x_bgColor.indexOf("url(")==0?"-image":"-color")+":"+x_bgColor+";clip:rect(0,"+x_width+","+x_height+",0);overflow:hidden'>"+(x_iE?"<div style='position:absolute;top:0px;left:0px;width:100%;height:100%;clip:rect(0,"+x_width+","+x_height+",0)'>":"");
        for(x_i=0;x_i<x_count;x_i++)
                x_temp+="<div "+(x_nS4?"name":"id")+"=x_"+(x_i+1)+" style='position:absolute;top:"+(x_height*x_d)+"px;left:"+x_paddingLeft+"px;width:"+(x_width-x_paddingLeft*2)+"px;height:"+(x_height-x_paddingTop*2)+"px;clip:rect(0,"+(x_width-x_paddingLeft*2)+","+(x_height-x_paddingTop*2)+",0);overflow:hidden"+(x_oP?";visibility:hidden":"")+";text-align:"+x_textAlign+"' class=vnewsticker11>" + (!x_nS4?"<table width="+(x_width-x_paddingLeft*2)+" height="+(x_height-x_paddingTop*2)+" cellpadding=0 cellspacing=0 border=0><tr><td width="+(x_width-x_paddingLeft*2)+" height="+(x_height-x_paddingTop*2)+" align="+x_textAlign+" valign="+x_textVAlign+" class=vnewsticker11>":"")+(x_content[x_i][0]!=""?"<a href='"+x_content[x_i][0]+"' target='"+x_content[x_i][2]+"' class=vnewsticker11"+(x_pauseOnMouseOver?" onmouseover='if(x_canPause&&x_count>1){clearTimeout(x_TIM);x_cl=1}' onmouseout='if(x_canPause&&x_count>1&&x_cl)x_TIM=setTimeout(\"x_canPause=0;x_slide();x_cl=0\","+x_timeout+")'":"")+">":"<span"+(x_pauseOnMouseOver?" onmouseover='if(x_canPause&&x_count>1){clearTimeout(x_TIM);x_cl=1}' onmouseout='if(x_canPause&&x_count>1&&x_cl)x_TIM=setTimeout(\"x_canPause=0;x_slide();x_cl=0\","+x_timeout+")'":"")+">")+x_content[x_i][1]+(x_content[x_i][0]!=""?"</a>":"</span>")+(!x_nS4?"</td></tr></table>":"")+"</div>";x_temp+=(x_iE?"</div>":"")+"</div>";document.write(x_temp);setTimeout("x_start()",0);

        if(x_nS4)onresize=function(){location.reload()}
}

