/************************************************
*
* shared.js
*
* General (Java) Scripts 
* for use with MSCMS 
*
* Snohomish County
* Department of Information Systems
* Web Services Team
*
* @created 2003-09-17
* @version 1.00
* @author Michael VonWald
*
************************************************/
/************************************************
*
* goBackOnePage()
*
* Navigate to homepage
*
* @param void
* @return void
*
************************************************/
function goBackOnePage() {
    window.history.back(1);
}

/************************************************
*
* goToParentDir()
*
* Navigate to homepage
*
* @param void
* @return void
*
************************************************/
function goToParentDir() {
    var currentPath = window.location.href;
    var pagePath = currentPath.substring(0,currentPath.lastIndexOf('/')+1);
    window.location = pagePath;
}


/************************************************
*
* popOpen()
*
* Creates a new window 440x660
*
* @param (string) url of new window
* @return void
*
************************************************/
function popOpen(targetUrl) {
    //  not sure if we need to do this now since URLs are genereated by CMS
    //var currentPath = window.location.href;
    //var pagePath = currentPath.substring(0,currentPath.lastIndexOf('/')+1) + targetUrl;

    // open in new window
    window.open(targetUrl,'Information','height=440,width=660,toolbar=no,status=yes,location=no,menubar=no,resizable=yes,scrollbars=yes');

}

/************************************************
*
* miniPopOpen()
*
* Creates a new window 400x500
*
* @param (string) url of new window
* @return void
*
************************************************/
function miniPopOpen(targetUrl) {
    //  not sure if we need to do this now since URLs are genereated by CMS
    //var currentPath = window.location.href;
    //var pagePath = currentPath.substring(0,currentPath.lastIndexOf('/')+1) + targetUrl;

    // open in new window
    window.open(targetUrl,'Information','height=400,width=500,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=no');

}

/************************************************
*
* resizeForAuthoring()
*
* Resizes window for Authoring mode
*
* @param void
* @return void
*
************************************************/
function resizeForAuthoring() {
    window.resizeTo(800,600);	
}

/************************************************
*
* mOver()
*
* MouseOver function for changing classnames
* facilitates different look for some elements
* of a Snohomish County web page or web application
*
* @param (string) id attribute value of element
* @return void
*
************************************************/
function mOver(elemId) {

    // note:
    // all mouseover classnames should be the
    // standard classname with the addition
    // of '-over' on the end
    //
    var OVER = "-over";

    // get document element
    var objElem = document.getElementById(elemId);

    // add '-over' to className
    objElem.className = objElem.className + OVER;
}


/************************************************
*
* mOut()
*
* MouseOut function for changing classnames
* facilitates different look for some elements
* of a Snohomish County web page or web application
*
* @param (string) id attribute value of element
* @return void
*
************************************************/
function mOut(elemId) {

    // note:
    // all mouseover classnames should be the
    // standard classname with the addition
    // of '-over' on the end
    //
    // create regular expression with this
    var regEx = /-over/;

    // get document element
    var objElem = document.getElementById(elemId);

    // replace '-over' with nothing
    objElem.className = objElem.className.replace(regEx,'');
}

