//News Bar script- By Premshree Pillai (premshree@hotmail.com)
//http://www.qiksearch.com/javascripts.htm
//Enhancements by Dynamic Drive
//Modified by Mark Vetanen 7-29-04
//Visit http://www.dynamicdrive.com for this script
// <script type='text/javascript' src='scrollbar/scrollbar.js'></script>
 var msgs = new Array(
     "Click here to win a FREE shirt!",
	 "New Version 8.5 - Now includes a vehicle symbol database!",
     "Free Tutorials and Demos!",
     "State Accident Report forms",
     "Mobile Data Collector!",
     "Get training",
     "Need money for software? Get a Grant!"	 
	 ); // No comma after last ticker msg

 var msg_url = new Array(
     "http://www.cadzone.com/User_Info/User_info.aspx",
	 "http://www.cadzone.com/Crash_Zone/Whats_New_V8.htm",
     "http://training.cadzone.com",
     "http://www.cadzone.com/Forms/Report_forms.htm",
     "http://www.cadzone.com/pocketzone/Pocket_Zone.htm",
     "http://training.cadzone.com",
	 "http://dev.cadzone.com/articles/grants.htm" 	 
	 ); // No comma after last ticker url

var barwidth=606; //Enter main bar width in px or % (was 585)
var setdelay=3000; //Enter delay between msgs, in mili-seconds
var mouseover_color='#E1FFE1'; //Specify highlight color
var mouseout_color='#FFFFFF'; //Specify default color
/////////////////////////////////////////////////////////////////////

var count=0;
var ns6=document.getElementById&&!document.all;
var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1;

if (ie4){
	document.write('<form style="margin-bottom:0;" name="news_bar"><input type="button" value="3" onclick="moveit(0)" class="scrollerstyle" style="width:22px; height:22px; border-right-width:0px;" name="prev" title="Previous News"><input type="button" name="news_bar_but" onclick="goURL();" style="color:#000000;background:#FFFFFF; width:'+barwidth+'; height:22px; border-width:1; border-color:#000000; cursor:hand" onmouseover="this.style.background=mouseover_color" onmouseout="this.style.background=mouseout_color"><input type="button" value="4" onclick="moveit(1)" class="scrollerstyle" style="width:22px; height:22px; border-left-width:0px;" name="next" title="Next News"></form>');
}
else if(ns6){
	document.write('<form style="margin-bottom:0;" name="news_bar"><input type="button" value="<" onclick="moveit(0)" style="width:22px; height:22px; border-right-width:0px;" name="prev" title="Previous News"><input type="button" name="news_bar_but" onclick="goURL();" style="color:#000000;background:#FFFFFF; width:'+barwidth+'; height:22px; border-width:1; border-color:#000000; cursor:hand" onmouseover="this.style.background=mouseover_color" onmouseout="this.style.background=mouseout_color"><input type="button" value=">" onclick="moveit(1)" style="width:22px; height:22px; border-left-width:0px;" name="next" title="Next News"></form>');	
}
else{
	document.write('<form style="margin-bottom:0;" name="news_bar"><input type="button" value="Previous" onclick="moveit(0)">');
	if (navigator.userAgent.indexOf("Opera")!=-1){
		document.write('<input type="button" name="news_bar_but" onclick="goURL();" style="width:'+barwidth+'" border="0">');
	}
	else {
		document.write('<input type="button" name="news_bar_but" onclick="goURL();" width="'+barwidth+'" border="0">');
		document.write('<input type="button" value="Next" onclick="moveit(1)"></form>');
	}
}

function init_news_bar(){
	document.news_bar.news_bar_but.value=msgs[count];
}

//moveit function by Dynamicdrive.com
function moveit(how){
	if (how==1){ //cycle foward
		if (count<msgs.length-1)
			count++;
		else
			count=0;
		}
	else{ //cycle backward
		if (count==0)
			count=msgs.length-1;
		else
			count--;
		}
	document.news_bar.news_bar_but.value=msgs[count];
}

setInterval("moveit(1)",setdelay);

function goURL(){
	location.href=msg_url[count];
}

init_news_bar();