﻿	var strNews = new Array();
	var intCurrentLength = 0;
	var intCharTimeout = 75;
	var intStoryTimeout = 4500;
	var intNewsItem = 0;
		
	function startTicker(pstrText) {
		// create the news items
		strNews[0] = pstrText
		runTicker()	
	}
	
	function runTicker() {
		// default the timeout to be the character timeout
		var intTimeout = intCharTimeout;
		var objNews = document.getElementById("divNews")
		
		// set the news item text
		objNews.innerHTML =  strNews[intNewsItem].substring(0, intCurrentLength) + "_"
			
		// might need to show the news news item
		if (intCurrentLength == strNews[intNewsItem].length) {
			objNews.innerHTML = objNews.innerHTML.substr(0, objNews.innerHTML.length - 1)
			intCurrentLength = 0
			
			// decide which news item to show
			//if (intNewsItem == 4) {
				intNewsItem = 0;
			//}
			//else
            //				intNewsItem++;
			
			intTimeout = 0
		}
				
		// set the timeout and increment the counter
		intCurrentLength++;		
		
		if (intTimeout != 0)
		    setTimeout("runTicker()", intTimeout)
	}
	
	
    function EnterSearch(pobjText) {
    
        if (pobjText.value == "Search text...")
            pobjText.value = ""
            
    } 
    
    function ExitSearch(pobjText) {
    
        if (pobjText.value == "")
            pobjText.value = "Search text..."
    
    }     
    
    function forceClick(e, elemId) {
        var elem = document.getElementById(elemId);
        var evt = (e) ? e : window.event;
        var intKey = (evt.which) ? evt.which : evt.keyCode;
        
        if(intKey == 13) {
            elem.click();
            return false;
        }

        return true;
    }
	