﻿
var modalWindow;
function image_mouseOver(objRef) {
    var overSrc = objRef.getAttribute('overSrc');
    var src = objRef.src;
    objRef.src = overSrc;
    objRef.setAttribute('overSrc', src);
}
function setAutomatic(id,checked)
{var objRef=document.getElementById(id);if(objRef)
{if(checked)
{objRef.disabled=true;}
else
{objRef.disabled=false;}}}
function toggleDisplay(id)
{var obj=document.getElementById(id);if(obj&&obj.style)
{obj.style.display=(obj.style.display=='none')?'':'none';}}
function replaceImage(id,src)
{var img=document.getElementById(id);if(img.filters)
{img.filters(0).Apply();}
img.src=src;if(img.filters)
{img.filters(0).Play();}}
function showModalWindow(url,width,height)
{modalWindow=document.getElementById("modalWindow");modalWindow.style.visibility="visible";var iframe=document.getElementById('modalWindowIFrame');if(document.body.offsetWidth)
{modalWindow.style.width=document.body.offsetWidth+"px";iframe.style.width=document.body.offsetWidth+"px";}
if(typeof(document.documentElement.scrollTop)!='nudefined')
{modalWindow.style.top=document.documentElement.scrollTop+"px";}
else
{modalWindow.style.top=document.scrollY+"px";}
iframe.src=url;document.onkeydown=closeModalWindow;addEvent("onscroll","scroll",onScroll);}
function closeModalWindow()
{modalWindow=document.getElementById("modalWindow");modalWindow.style.visibility="hidden";var iframe=document.getElementById('modalWindowIFrame');if(iframe)
{iframe.src='';}}
function onScroll()
{if(typeof(document.documentElement.scrollTop)!='nudefined')
{modalWindow.style.top=document.documentElement.scrollTop+"px";}
else
{modalWindow.style.top=document.scrollY+"px";}}
function addEvent(ieEvent,mozEvent,func)
{if(window.attachEvent)
{window.attachEvent(ieEvent,func);}
else
{window.addEventListener(mozEvent,func,false);}}
function addToFavorites(url, title)
{
    if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"");
	} else if( window.external ) { // IE Favorite
		window.external.AddFavorite( url, title); }
	else if(window.opera && window.print) { // Opera Hotlist
		return true; }
}

function setLoadingPanel(panelIdToHide, panelIdToShow) {
    var hide = document.getElementById(panelIdToHide);
    var show = document.getElementById(panelIdToShow);

    if (hide) {
        hide.style.display = 'none';
    }

    if (show) {
        show.style.display = 'block';
    }

    return true;
}
function setDisplay(id, show)
{
    var objRef = document.getElementById(id);
    if (objRef)
    {
        if(show)
        {
            objRef.style.display = '';
        }
        else
        {
            objRef.style.display = 'none';
        }
    }
}

function showTab(id) {
    var hidden = document.getElementById('opentab');
    hidden.value = id;
    toggleDisplay(id);
}

function popup(url, name, width, height, replace) {
    window.open(url, name, 'width=' + width + ', height=' + height + ', scrollbars=1', replace);
}