// -------------------------------------------------------------------
// 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...</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])
}




<!--
// Meeting Summary
function randInt(low,high) {
 return Math.floor(Math.random()*(high-low+1)+low);
}

function showMeetingSumm(){
	var t = randInt(1,11)
	if (t == 1) {
		return '<a href="javascript:popUp(&#39;http://www.nga.org/portal/site/nga/menuitem.f3e4d086ac6dda968a278110501010a0/?vgnextoid=8903d5df1d552010VgnVCM1000001a01010aRCRD&#39;)"><b>1908 Meeting: Washington, DC (May 13-15)</b></a><br />Governors meet for the first time at the request of President Theodore Roosevelt to discuss natural resource conservation.';
	} else if (t == 2) {
		return '<a href="javascript:popUp(&#39;http://www.nga.org/portal/site/nga/menuitem.f3e4d086ac6dda968a278110501010a0/?vgnextoid=047761d4e1584010VgnVCM1000001a01010aRCRD&#39;)"><b>1912 Meeting: Richmond, VA (Dec. 3-7)</b></a><br />Articles of Organization are adopted for the new &#34;Governors&#39; Conference,&#34; made up of governors and governors-elect of &#39;states and territories.&#39;';
	} else if (t == 3) {
		return '<a href="javascript:popUp(&#39;http://www.nga.org/portal/site/nga/menuitem.f3e4d086ac6dda968a278110501010a0/?vgnextoid=33d280ed76b84010VgnVCM1000001a01010aRCRD&#39;)"><b>1925 Meeting: Poland Springs, ME (Jun. 29-Jul. 1)</b></a> First woman governor&#151;Nellie Ross of Wyoming&#151;is welcomed at the association&#39;s Annual Meeting in Maine.';
	} else if (t == 4) {
		return '<a href="javascript:popUp(&#39;http://www.nga.org/portal/site/nga/menuitem.f3e4d086ac6dda968a278110501010a0/?vgnextoid=1530e655ec694010VgnVCM1000001a01010aRCRD&#39;)"><b>1932 Meeting: Richmond, VA (Apr. 25-27)</b></a><br />President Herbert Hoover addresses the governors regarding the nation&#39;s economic problems.';
	} else if (t == 5) {
		return '<a href="http://www.nga.org/portal/site/nga/menuitem.f3e4d086ac6dda968a278110501010a0/?vgnextoid=c3e449f797a94010VgnVCM1000001a01010aRCRD&#39;)"><b>1947 Meeting: Salt Lake City, UT (Jul. 13-16)</b></a><br />Governors meet with members of Congress to discuss the equitable division of taxation between the states and the federal government.';
	} else if (t == 6) {
		return '<a href="javascript:popUp(&#39;http://www.nga.org/portal/site/nga/menuitem.f3e4d086ac6dda968a278110501010a0/?vgnextoid=c99c8aaa364a4010VgnVCM1000001a01010aRCRD&#39;)"><b>1953 Meeting: Seattle, WA (Aug. 2-6)</b></a><br />Governors discuss the baby boom and its anticipated effect on the U.S. educational system.';
	} else if (t == 7) {
		return '<a href="http://www.nga.org/portal/site/nga/menuitem.f3e4d086ac6dda968a278110501010a0/?vgnextoid=83c04025c2d4b010VgnVCM1000001a01010aRCRD&#39;)"><b>1960 Meeting: Glacier National Park, MT (Jun. 26-29)</b></a> Governors discuss concerns about Soviet superiority in the arms race and in education, and talk about pending legislation to provide medical care for the elderly.';
	} else if (t == 8) {
		return '<a href="javascript:popUp(&#39;http://www.nga.org/portal/site/nga/menuitem.f3e4d086ac6dda968a278110501010a0/?vgnextoid=0cd912c9caecb010VgnVCM1000001a01010aRCRD&#39;)"><b>1977 Annual Meeting: Detroit, MI (Sept. 7-9)</b></a><br />The meeting includes discussion of President Jimmy Carter&#39;s proposals for welfare reform.';
	} else if (t == 9) {
		return '<a href="javascript:popUp(&#39;http://www.nga.org/portal/site/nga/menuitem.f3e4d086ac6dda968a278110501010a0/?vgnextoid=38a4025f0dc6b010VgnVCM1000001a01010aRCRD&#39;)"><b>1989 Annual Meeting: Chicago, IL (Jul. 30-Aug. 1)</b></a> President George H. W. Bush speaks about the recent passage of welfare reform via the Family Support Act of 1988.';
	} else if (t == 10) {
		return '<a href="javascript:popUp(&#39;http://www.nga.org/portal/site/nga/menuitem.f3e4d086ac6dda968a278110501010a0/?vgnextoid=ee74025f0dc6b010VgnVCM1000001a01010aRCRD&#39;)"><b>1990 Annual Meeting: Mobile, AL (Jul. 29-31)</b></a><br />Governors discuss global climate change as well as strategies for achieving the goals set at the 1989 National Education Summit.';
	} else if (t == 11) {
		return '<a href="javascript:popUp(&#39;http://www.nga.org/portal/site/nga/menuitem.f3e4d086ac6dda968a278110501010a0/?vgnextoid=2cb887b62bc5b010VgnVCM1000001a01010aRCRD&#39;)"><b>2005 Annual Meeting: Des Moines, IA (Jul. 15-18)</b></a> For the first time in the nation&#39;s history, states reach a common definition for their high school graduation rate.';
	}
}
//-->


<!-- Begin
var newwindow;
function popUp(url)
{
	newwindow=window.open(url,'info','height=600,width=850,resizable=1,toolbar=1,menubar=1,scrollbars=1');
	if (window.focus) {newwindow.focus()}
}

// End -->
