﻿// JScript File

function ConfirmDelete()
{
	var agree = confirm("Are you sure you wish to delete the selected pages?  All of the content will be permanently lost.");

	if (agree)
		return true;
	else
		return false;
}

function ConfirmDelete(msg)
{
	var agree = confirm(msg);

	if (agree)
		return true;
	else
		return false;
}

function Trim(string)
{
	return string.replace(/ /g, '');
}

function validNumber(num)
{
    if(isNaN(num))                
    return false
    else 
    return true        
}

function validPageOrder(ctlID)
{
    var num = document.getElementById(ctlID).value;
               
    if (validNumber(num))  
    {
        num = parseInt(num);
        
        if(isNaN(num)) 
        {
            num = 0;            
        }  
        
        document.getElementById(ctlID).value = num;
        return true
    }
    else
    {
        alert("Please enter a valid number.");
        document.getElementById(ctlID).focus();
        return false
    }  
}

//Begin Scrolling News Functions:
            var speed = 1;
            
            function init()
            {             
             var el = document.getElementById("divScrollingNews");
             el.style.overflow = 'hidden';  scrollFromBottom();
            }

            var go = 0;
            function scrollFromBottom()
            {if (speed>1){alert(speed)};
            var el = document.getElementById("divScrollingNews");
            if(el.scrollTop >= el.scrollHeight-200)
            { el.scrollTop = 0;  };     
            el.scrollTop = el.scrollTop + speed; 
            if(go == 0){    setTimeout("scrollFromBottom()",50);  };
            }           

            function stop(){  go = 1;}           

            function startit(){go = 0;  scrollFromBottom();}
            //End Scrolling News Functions

function windowOpener(url)
{
    if (url)
    {
        window.open (url, "window","location=1,status=1,scrollbars=1,resizable=1,width=800,height=600");
    }            
    return false          
}