
var ns4 = (document.layers) ? true : false;  // browser sniffer
var ie4 = (document.all) ? true : false;
var op7 = (window.opera) ? true : false;
var ns6 = (document.getElementById&&!document.all) ? true : false;

function popw(loc,nam,wid,hei,othe)
{
    if (window.screen)
    {
        x = (screen.availWidth - wid) * 0.5;
        y = (screen.availHeight- hei) * 0.5;
    }
    else
    {
        x = 50;
        y = 50;
    }
    if (othe=='')
    {
        popupw=window.open(loc,nam,'width='+wid+',height='+hei);
    }
    else
    {
        popupw=window.open(loc,nam,'width='+wid+',height='+hei+','+othe);
    }
    popupw.moveTo(x,y);
    l=popupw.focus();
    return popupw;
}
function popMiniInfo(Show)
{
    popw('PopupArticle.aspx?Element=PopupArticle&Show=' + Show ,'ADS',750,550,'scrollbars=yes')
}
function setHomePage(obj,URL)
{
    try
    {
        if (ie4&&!op7&&obj)
        {
            if (!URL)
            {
                URL='http://' + window.location.host;
            }
	        obj.style.behavior='url(#default#homepage)';
	        obj.setHomePage(URL);
        }
    } 
    catch (e)
    {
        alert(e.message)
    }
    if (ie4&&!op7&&obj)
    {
      obj.style.behavior='';
    }
    return false;
}
function AddToFavorites(URL,Title){
    try
    {
        if (!URL)
        {
            URL='http://' + document.location.host;
        }
        if (!Title)
        {
            Title=document.title;
        }
        if (ie4&&!op7)
        {
	        window.external.AddFavorite(URL,Title);
        }
        else if (op7)
        {
            document.body.innerHTML += '<'+'a href="'+URL+'" title="'+Title+'" rel="sidebar" style="display: none;" id="addbookmark">click<'+'/a>';
            document.getElementById('addbookmark').click();
            document.getElementById('addbookmark').outerHTML = '';
        }
    }
    catch (e)
    {
        alert(e.message)
    }
    return false;
}
function popArticle(ID)
{
    popw('PopupArticle.aspx?Element=Article&ArticleID='+ID+'&Action=Popup','PopupArticle',660,550,'scrollbars=yes')
}
