/***********************************************
* Bookmark site script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
/* Modified to support Opera */
/*  http://www.dynamicdrive.com/dynamicindex9/addbook.htm */
function bookmarksite(title,url){
    if (window.sidebar) { // firefox
        window.sidebar.addPanel(title, url, "");
    } else if(window.opera && window.print){ // opera
        var elem = document.createElement('a');
        elem.setAttribute('href',url);
        elem.setAttribute('title',title);
        elem.setAttribute('rel','sidebar');
        elem.click();
    } else if(document.all) { // ie
        window.external.AddFavorite(url, title);
    }
}

function trim(s)
{   var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not a whitespace, append to returnString.
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (c != " ") returnString += c;
    }
    return returnString;
}

function checkSearch(frm, key) {
    var frmObj = document.getElementById(frm);
    var keyObj = document.getElementById(key);
    
    if(trim(keyObj.value) == '') {
        keyObj.style.border = '1px solid red';
        keyObj.focus();
    } else {
        frmObj.submit();
    }
}

function toogleImgtooltip(action) {
    var imgtooltipObj = document.getElementById('imgtooltip');
    
    switch(action) {
        case 'show':
            imgtooltipObj.style.visibility = 'visible';
            break;
        case 'hide':
            imgtooltipObj.style.visibility = 'hidden';
            break;
    }
}

actnews = 0;

function opennews(news) {
    var openObj = document.getElementById(actnews);
    var toopenObj = document.getElementById(news);
    
    if (actnews != 0) {
        openObj.style.overflow = 'hidden';
    }
    toopenObj.style.overflow = 'visible';
    actnews = news;
}

var acttool = 0;

function opentool(tool) {
    var openObj = document.getElementById(acttool);
    var toopenObj = document.getElementById(tool);
    
    if (acttool != 0) {
        openObj.style.overflow = 'hidden';
    }
    toopenObj.style.overflow = 'visible';
    acttool = tool;
}

var actlink = 0;

function openlink(link) {
    var openObj = document.getElementById(actlink);
    var toopenObj = document.getElementById(link);
    
    if (actlink != 0) {
        openObj.style.overflow = 'hidden';
    }
    toopenObj.style.overflow = 'visible';
    actlink = link;
}
