﻿function comLoad(o)
{
    var theifame = document.frames['infoIfr'];
    try
    {
        if(o && theifame)
        {
            o.height=theifame.document.body.offsetHeight + 10;
//            o.width=theifame.document.body.offsetWidth;
        }
    }
    catch(e){alert(e);}
}
function comLoad1(o)
{
    var theifame = document.frames['infoIfr1'];
    try
    {
        if(o && theifame)
        {
            o.height=theifame.document.body.offsetHeight + 10;
            o.width=theifame.document.body.offsetWidth + 10;
//            o.width=theifame.document.body.offsetWidth;
        }
    }
    catch(e){alert(e);}
}
function showSite(o)
{
    var theObj = document.getElementById('station'+o);
    if(theObj)
    {
//        theObj.style.display = '';
        theObj.className = 'tipshow';
        
        var width = theObj.clientWidth;
        var heigth = theObj.clientHeight;
           
        
        var x = event.clientX;
        var y = event.clientY;
        
        if(x < width)
            theObj.style.left = (x + 10) + 'px';
        else
            theObj.style.left = (x - width - 10) + 'px';
        
        if(y < heigth)
            theObj.style.top = (y + 10) + 'px';
        else
            theObj.style.top = (y - heigth - 10) + 'px';      
    }
}
function viewForecastSite()
{
    var theList = document.getElementById('sitelist');
    var theTarget = document.getElementById('infoIfr');
    if(theList && theTarget)
    {
        theTarget.src = "/html/forecast/" + theList.value + ".htm";
    }
}
function viewFactSite()
{
    var theList = document.getElementById('sitelist');
    var theTarget = document.getElementById('infoIfr');
    if(theList && theTarget)
    {
        theTarget.src = "/html/fact/" + theList.value + ".htm";
    }
}
function hiddenSite(o)
{
    var theObj = document.getElementById('station'+o);
    if(theObj)
//        theObj.style.display = 'none';
        theObj.className = 'tip';
}